Falco Engine 3.9.0.1 (beta)
FalcoEngine.Vector3 Struct Reference

Public Member Functions

 Vector3 (float x, float y, float z)
 
void Scale (Vector3 scale)
 
override int GetHashCode ()
 
override bool Equals (object other)
 
bool Equals (Vector3 other)
 
void Normalize ()
 
override string ToString ()
 
string ToString (string format)
 

Static Public Member Functions

static Vector3 operator+ (Vector3 a, Vector3 b)
 
static Vector3 operator- (Vector3 a, Vector3 b)
 
static Vector3 operator- (Vector3 a)
 
static Vector3 operator* (Vector3 a, float b)
 
static Vector3 operator* (float d, Vector3 a)
 
static Vector3 operator/ (Vector3 a, float d)
 
static bool operator== (Vector3 lhs, Vector3 rhs)
 
static bool operator!= (Vector3 lhs, Vector3 rhs)
 
static Vector3 Lerp (Vector3 a, Vector3 b, float t)
 
static Vector3 LerpUnclamped (Vector3 a, Vector3 b, float t)
 
static Vector3 Cross (Vector3 lhs, Vector3 rhs)
 
static Vector3 Reflect (Vector3 inDirection, Vector3 inNormal)
 
static Vector3 Normalize (Vector3 value)
 
static float Dot (Vector3 lhs, Vector3 rhs)
 
static Vector3 Project (Vector3 vector, Vector3 onNormal)
 
static Vector3 ProjectOnPlane (Vector3 vector, Vector3 planeNormal)
 
static float Angle (Vector3 from, Vector3 to)
 
static float SignedAngle (Vector3 from, Vector3 to, Vector3 axis)
 
static float Distance (Vector3 a, Vector3 b)
 
static Vector3 ClampMagnitude (Vector3 vector, float maxLength)
 
static float Magnitude (Vector3 vector)
 
static float SqrMagnitude (Vector3 vector)
 
static Vector3 Min (Vector3 lhs, Vector3 rhs)
 
static Vector3 Max (Vector3 lhs, Vector3 rhs)
 

Public Attributes

float x
 
float y
 
float z
 

Static Public Attributes

const float kEpsilon = 1E-05f
 
const float kEpsilonNormalSqrt = 1E-15f
 

Properties

static Vector3 zero = new Vector3(0f, 0f, 0f) [get]
 
static Vector3 one = new Vector3(1f, 1f, 1f) [get]
 
static Vector3 forward = new Vector3(0f, 0f, 1f) [get]
 
static Vector3 back = new Vector3(0f, 0f, -1f) [get]
 
static Vector3 up = new Vector3(0f, 1f, 0f) [get]
 
static Vector3 down = new Vector3(0f, -1f, 0f) [get]
 
static Vector3 left = new Vector3(-1f, 0f, 0f) [get]
 
static Vector3 right = new Vector3(1f, 0f, 0f) [get]
 
static Vector3 positiveInfinity = new Vector3(float.PositiveInfinity, float.PositiveInfinity, float.PositiveInfinity) [get]
 
static Vector3 negativeInfinity = new Vector3(float.NegativeInfinity, float.NegativeInfinity, float.NegativeInfinity) [get]
 
float magnitude [get]
 
float sqrMagnitude [get]
 
Vector3 normalized [get]
 

Detailed Description

Definition at line 8 of file Vector3.cs.

Constructor & Destructor Documentation

◆ Vector3()

FalcoEngine.Vector3.Vector3 ( float  x,
float  y,
float  z 
)

Definition at line 17 of file Vector3.cs.

Member Function Documentation

◆ Angle()

static float FalcoEngine.Vector3.Angle ( Vector3  from,
Vector3  to 
)
static

Returns the angle in degrees between from and to.

Parameters
fromThe vector from which the angular difference is measured.
toThe vector to which the angular difference is measured.
Returns
The angle in degrees between the two vectors.

Definition at line 273 of file Vector3.cs.

◆ ClampMagnitude()

static Vector3 FalcoEngine.Vector3.ClampMagnitude ( Vector3  vector,
float  maxLength 
)
static

Returns a copy of vector with its magnitude clamped to maxLength.

Parameters
vector
maxLength

Definition at line 313 of file Vector3.cs.

◆ Cross()

static Vector3 FalcoEngine.Vector3.Cross ( Vector3  lhs,
Vector3  rhs 
)
static

Cross Product of two vectors.

Parameters
lhs
rhs

Definition at line 188 of file Vector3.cs.

◆ Distance()

static float FalcoEngine.Vector3.Distance ( Vector3  a,
Vector3  b 
)
static

Returns the distance between a and b.

Parameters
a
b

Definition at line 302 of file Vector3.cs.

◆ Dot()

static float FalcoEngine.Vector3.Dot ( Vector3  lhs,
Vector3  rhs 
)
static

Dot Product of two vectors.

Parameters
lhs
rhs

Definition at line 235 of file Vector3.cs.

◆ Equals() [1/2]

override bool FalcoEngine.Vector3.Equals ( object  other)

Returns true if the given vector is exactly equal to this vector.

Parameters
other

Definition at line 169 of file Vector3.cs.

◆ Equals() [2/2]

bool FalcoEngine.Vector3.Equals ( Vector3  other)

Definition at line 178 of file Vector3.cs.

◆ GetHashCode()

override int FalcoEngine.Vector3.GetHashCode ( )

Definition at line 160 of file Vector3.cs.

◆ Lerp()

static Vector3 FalcoEngine.Vector3.Lerp ( Vector3  a,
Vector3  b,
float  t 
)
static

Linearly interpolates between two vectors.

Parameters
a
b
t

Definition at line 132 of file Vector3.cs.

◆ LerpUnclamped()

static Vector3 FalcoEngine.Vector3.LerpUnclamped ( Vector3  a,
Vector3  b,
float  t 
)
static

Linearly interpolates between two vectors.

Parameters
a
b
t

Definition at line 144 of file Vector3.cs.

◆ Magnitude()

static float FalcoEngine.Vector3.Magnitude ( Vector3  vector)
static

Definition at line 322 of file Vector3.cs.

◆ Max()

static Vector3 FalcoEngine.Vector3.Max ( Vector3  lhs,
Vector3  rhs 
)
static

Returns a vector that is made from the largest components of two vectors.

Parameters
lhs
rhs

Definition at line 347 of file Vector3.cs.

◆ Min()

static Vector3 FalcoEngine.Vector3.Min ( Vector3  lhs,
Vector3  rhs 
)
static

Returns a vector that is made from the smallest components of two vectors.

Parameters
lhs
rhs

Definition at line 337 of file Vector3.cs.

◆ Normalize() [1/2]

void FalcoEngine.Vector3.Normalize ( )

Definition at line 217 of file Vector3.cs.

◆ Normalize() [2/2]

static Vector3 FalcoEngine.Vector3.Normalize ( Vector3  value)
static

Makes this vector have a magnitude of 1.

Parameters
value

Definition at line 207 of file Vector3.cs.

◆ operator!=()

static bool FalcoEngine.Vector3.operator!= ( Vector3  lhs,
Vector3  rhs 
)
static

Definition at line 59 of file Vector3.cs.

◆ operator*() [1/2]

static Vector3 FalcoEngine.Vector3.operator* ( float  d,
Vector3  a 
)
static

Definition at line 44 of file Vector3.cs.

◆ operator*() [2/2]

static Vector3 FalcoEngine.Vector3.operator* ( Vector3  a,
float  b 
)
static

Definition at line 39 of file Vector3.cs.

◆ operator+()

static Vector3 FalcoEngine.Vector3.operator+ ( Vector3  a,
Vector3  b 
)
static

Definition at line 24 of file Vector3.cs.

◆ operator-() [1/2]

static Vector3 FalcoEngine.Vector3.operator- ( Vector3  a)
static

Definition at line 34 of file Vector3.cs.

◆ operator-() [2/2]

static Vector3 FalcoEngine.Vector3.operator- ( Vector3  a,
Vector3  b 
)
static

Definition at line 29 of file Vector3.cs.

◆ operator/()

static Vector3 FalcoEngine.Vector3.operator/ ( Vector3  a,
float  d 
)
static

Definition at line 49 of file Vector3.cs.

◆ operator==()

static bool FalcoEngine.Vector3.operator== ( Vector3  lhs,
Vector3  rhs 
)
static

Definition at line 54 of file Vector3.cs.

◆ Project()

static Vector3 FalcoEngine.Vector3.Project ( Vector3  vector,
Vector3  onNormal 
)
static

Projects a vector onto another vector.

Parameters
vector
onNormal

Definition at line 245 of file Vector3.cs.

◆ ProjectOnPlane()

static Vector3 FalcoEngine.Vector3.ProjectOnPlane ( Vector3  vector,
Vector3  planeNormal 
)
static

Projects a vector onto a plane defined by a normal orthogonal to the plane.

Parameters
vector
planeNormal

Definition at line 260 of file Vector3.cs.

◆ Reflect()

static Vector3 FalcoEngine.Vector3.Reflect ( Vector3  inDirection,
Vector3  inNormal 
)
static

Reflects a vector off the plane defined by a normal.

Parameters
inDirection
inNormal

Definition at line 198 of file Vector3.cs.

◆ Scale()

void FalcoEngine.Vector3.Scale ( Vector3  scale)

Multiplies every component of this vector by the same component of scale.

Parameters
scale

Definition at line 153 of file Vector3.cs.

◆ SignedAngle()

static float FalcoEngine.Vector3.SignedAngle ( Vector3  from,
Vector3  to,
Vector3  axis 
)
static

Returns the signed angle in degrees between from and to.

Parameters
fromThe vector from which the angular difference is measured.
toThe vector to which the angular difference is measured.
axisA vector around which the other vectors are rotated.

Definition at line 290 of file Vector3.cs.

◆ SqrMagnitude()

static float FalcoEngine.Vector3.SqrMagnitude ( Vector3  vector)
static

Definition at line 327 of file Vector3.cs.

◆ ToString() [1/2]

override string FalcoEngine.Vector3.ToString ( )

Returns a nicely formatted string for this vector.

Parameters
format

Definition at line 356 of file Vector3.cs.

◆ ToString() [2/2]

string FalcoEngine.Vector3.ToString ( string  format)

Returns a nicely formatted string for this vector.

Parameters
format

Definition at line 365 of file Vector3.cs.

Member Data Documentation

◆ kEpsilon

const float FalcoEngine.Vector3.kEpsilon = 1E-05f
static

Definition at line 14 of file Vector3.cs.

◆ kEpsilonNormalSqrt

const float FalcoEngine.Vector3.kEpsilonNormalSqrt = 1E-15f
static

Definition at line 15 of file Vector3.cs.

◆ x

float FalcoEngine.Vector3.x

Definition at line 10 of file Vector3.cs.

◆ y

float FalcoEngine.Vector3.y

Definition at line 11 of file Vector3.cs.

◆ z

float FalcoEngine.Vector3.z

Definition at line 12 of file Vector3.cs.

Property Documentation

◆ back

Vector3 FalcoEngine.Vector3.back = new Vector3(0f, 0f, -1f)
staticget

Shorthand for writing Vector3(0, 0, -1).

Definition at line 82 of file Vector3.cs.

◆ down

Vector3 FalcoEngine.Vector3.down = new Vector3(0f, -1f, 0f)
staticget

Shorthand for writing Vector3(0, -1, 0).

Definition at line 92 of file Vector3.cs.

◆ forward

Vector3 FalcoEngine.Vector3.forward = new Vector3(0f, 0f, 1f)
staticget

Shorthand for writing Vector3(0, 0, 1).

Definition at line 77 of file Vector3.cs.

◆ left

Vector3 FalcoEngine.Vector3.left = new Vector3(-1f, 0f, 0f)
staticget

Shorthand for writing Vector3(-1, 0, 0).

Definition at line 97 of file Vector3.cs.

◆ magnitude

float FalcoEngine.Vector3.magnitude
get

Definition at line 114 of file Vector3.cs.

◆ negativeInfinity

Vector3 FalcoEngine.Vector3.negativeInfinity = new Vector3(float.NegativeInfinity, float.NegativeInfinity, float.NegativeInfinity)
staticget

Shorthand for writing Vector3(float.NegativeInfinity, float.NegativeInfinity, float.NegativeInfinity).

Definition at line 112 of file Vector3.cs.

◆ normalized

Vector3 FalcoEngine.Vector3.normalized
get

Returns this vector with a magnitude of 1 (Read Only).

Definition at line 124 of file Vector3.cs.

◆ one

Vector3 FalcoEngine.Vector3.one = new Vector3(1f, 1f, 1f)
staticget

Shorthand for writing Vector3(1, 1, 1).

Definition at line 72 of file Vector3.cs.

◆ positiveInfinity

Vector3 FalcoEngine.Vector3.positiveInfinity = new Vector3(float.PositiveInfinity, float.PositiveInfinity, float.PositiveInfinity)
staticget

Shorthand for writing Vector3(float.PositiveInfinity, float.PositiveInfinity, float.PositiveInfinity).

Definition at line 107 of file Vector3.cs.

◆ right

Vector3 FalcoEngine.Vector3.right = new Vector3(1f, 0f, 0f)
staticget

Shorthand for writing Vector3(1, 0, 0).

Definition at line 102 of file Vector3.cs.

◆ sqrMagnitude

float FalcoEngine.Vector3.sqrMagnitude
get

Returns the squared length of this vector (Read Only).

Definition at line 119 of file Vector3.cs.

◆ up

Vector3 FalcoEngine.Vector3.up = new Vector3(0f, 1f, 0f)
staticget

Shorthand for writing Vector3(0, 1, 0).

Definition at line 87 of file Vector3.cs.

◆ zero

Vector3 FalcoEngine.Vector3.zero = new Vector3(0f, 0f, 0f)
staticget

Shorthand for writing Vector3(0, 0, 0).

Definition at line 67 of file Vector3.cs.


The documentation for this struct was generated from the following file: