Table of Contents

Struct Vector3

Namespace
BasilEngine.Mathematics
Assembly
BasilEngine.dll
[Disabled]
public struct Vector3
Inherited Members

Constructors

Vector3(float, float, float)

Initializes a new Vector3.

public Vector3(float x, float y, float z)

Parameters

x float

X component.

y float

Y component.

z float

Z component.

Fields

x

X component of the vector.

public float x

Field Value

float

y

Y component of the vector.

public float y

Field Value

float

z

Z component of the vector.

public float z

Field Value

float

Properties

Forward

Forward vector (0,0,1).

public static Vector3 Forward { get; }

Property Value

Vector3

Right

Right vector (1,0,0).

public static Vector3 Right { get; }

Property Value

Vector3

Up

Up vector (0,1,0).

public static Vector3 Up { get; }

Property Value

Vector3

Zero

Vector representing (0,0,0).

public static Vector3 Zero { get; }

Property Value

Vector3

Methods

Cross(Vector3, Vector3)

Calculates the cross product of two vectors.

public static Vector3 Cross(Vector3 a, Vector3 b)

Parameters

a Vector3
b Vector3

Returns

Vector3

Distance(Vector3, Vector3)

Distance between two vectors.

public static float Distance(Vector3 a, Vector3 b)

Parameters

a Vector3
b Vector3

Returns

float

DistanceSqr(Vector3, Vector3)

Squared distance between two vectors.

public static float DistanceSqr(Vector3 a, Vector3 b)

Parameters

a Vector3
b Vector3

Returns

float

Dot(Vector3, Vector3)

Calculates the dot product of two vectors.

public static float Dot(Vector3 a, Vector3 b)

Parameters

a Vector3
b Vector3

Returns

float

Lerp(Vector3, Vector3, float)

Linearly interpolates between two vectors with clamping.

public static Vector3 Lerp(Vector3 a, Vector3 b, float t)

Parameters

a Vector3
b Vector3
t float

Returns

Vector3

Magnitude()

Magnitude (length) of the vector.

public float Magnitude()

Returns

float

MagnitudeSqr()

Squared magnitude of the vector.

public float MagnitudeSqr()

Returns

float

Normalize()

Returns a normalized copy of the vector.

public Vector3 Normalize()

Returns

Vector3

ToString()

Returns the fully qualified type name of this instance.

public override string ToString()

Returns

string

The fully qualified type name.

Operators

operator +(Vector3, Vector3)

Adds two vectors component-wise.

public static Vector3 operator +(Vector3 a, Vector3 b)

Parameters

a Vector3
b Vector3

Returns

Vector3

operator --(Vector3)

Decrements each component by 1.

public static Vector3 operator --(Vector3 a)

Parameters

a Vector3

Returns

Vector3

operator /(Vector3, float)

Divides a vector by a scalar.

public static Vector3 operator /(Vector3 a, float scalar)

Parameters

a Vector3
scalar float

Returns

Vector3

operator ++(Vector3)

Increments each component by 1.

public static Vector3 operator ++(Vector3 a)

Parameters

a Vector3

Returns

Vector3

operator *(Vector3, float)

Multiplies a vector by a scalar.

public static Vector3 operator *(Vector3 a, float scalar)

Parameters

a Vector3
scalar float

Returns

Vector3

operator *(float, Vector3)

Multiplies a vector by a scalar.

public static Vector3 operator *(float scalar, Vector3 a)

Parameters

scalar float
a Vector3

Returns

Vector3

operator -(Vector3, Vector3)

Subtracts two vectors component-wise.

public static Vector3 operator -(Vector3 a, Vector3 b)

Parameters

a Vector3
b Vector3

Returns

Vector3

operator -(Vector3)

Negates a vector.

public static Vector3 operator -(Vector3 a)

Parameters

a Vector3

Returns

Vector3