Photon Quantum 2.1.1

Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Properties | List of all members
Photon.Deterministic.FPVector3 Struct Reference

Represents a 3D Vector More...

Public Member Functions

 FPVector3 (FP x, FP y)
 Constructor initializing a new instance of the structure More...
 
 FPVector3 (FP x, FP y, FP z)
 Constructor initializing a new instance of the structure More...
 
 FPVector3 (int x, int y)
 Constructor initializing a new instance of the structure More...
 
 FPVector3 (int x, int y, int z)
 Constructor initializing a new instance of the structure More...
 
override Boolean Equals (Object obj)
 Tests if an object is equal to this vector. More...
 
override Int32 GetHashCode ()
 Gets the hashcode of the vector. More...
 
override String ToString ()
 Builds a string from the FPVector3. More...
 

Static Public Member Functions

static FPVector3 Abs (FPVector3 value)
 Returns a vector where each component is the absolute value of same component in value . More...
 
static FP Angle (FPVector3 a, FPVector3 b)
 Returns the angle in degrees between a and b . More...
 
static FPVector3 ClampMagnitude (FPVector3 vector, FP maxLength)
 Clamps the magnitude of a vector More...
 
static FPVector3 Cross (FPVector3 a, FPVector3 b)
 The cross product of two vectors. More...
 
static FP Distance (FPVector3 a, FPVector3 b)
 Calculates the distance between two vectors More...
 
static FP DistanceSquared (FPVector3 a, FPVector3 b)
 Calculates the squared distance between two vectors More...
 
static FP Dot (FPVector3 a, FPVector3 b)
 Calculates the dot product of two vectors. More...
 
static FPVector3 Lerp (FPVector3 start, FPVector3 end, FP t)
 Linearly interpolates between start and end by t . t is clamped to the range [0, 1] More...
 
static FPVector3 LerpUnclamped (FPVector3 start, FPVector3 end, FP t)
 Linearly interpolates between start and end by t . More...
 
static FPVector3 Max (FPVector3 value1, FPVector3 value2)
 Gets a vector with the maximum x,y and z values of both vectors. More...
 
static FPVector3 Min (FPVector3 value1, FPVector3 value2)
 Gets a vector with the minimum x,y and z values of both vectors. More...
 
static FPVector3 MoveTowards (FPVector3 from, FPVector3 to, FP maxDelta)
 Calculate a position between the points specified by from and to , moving no farther than the distance specified by maxDelta . More...
 
static FPVector3 Normalize (FPVector3 value)
 Normalizes the given vector. If the vector is too short to normalize, Zero will be returned. More...
 
static FPVector3 Normalize (FPVector3 value, out FP magnitude)
 Normalizes the given vector. If the vector is too short to normalize, Zero will be returned. More...
 
static Boolean operator!= (FPVector3 a, FPVector3 b)
 Returns true if two vectors are not exactly equal. More...
 
static FPVector3 operator* (FP s, FPVector3 v)
 Multiplies each component of v times s . More...
 
static FPVector3 operator* (FPVector3 v, FP s)
 Multiplies each component of v times s . More...
 
static FPVector3 operator+ (FPVector3 a, FPVector3 b)
 Adds two vectors. More...
 
static FPVector3 operator- (FPVector3 a, FPVector3 b)
 Subtracts b from a More...
 
static FPVector3 operator- (FPVector3 v)
 Negates each component of v vector. More...
 
static FPVector3 operator/ (FPVector3 v, FP s)
 Divides each component of v by s . More...
 
static FPVector3 operator/ (FPVector3 v, Int32 s)
 Divides each component of v by s . More...
 
static Boolean operator== (FPVector3 a, FPVector3 b)
 Returns true if two vectors are exactly equal. More...
 
static FPVector3 Project (FPVector3 vector, FPVector3 normal)
 Projects a vector onto another vector. More...
 
static FPVector3 ProjectOnPlane (FPVector3 vector, FPVector3 planeNormal)
 Projects a vector onto a plane defined by a normal orthogonal to the plane. More...
 
static FPVector3 Reflect (FPVector3 vector, FPVector3 normal)
 Reflects a vector off the plane defined by a normal. More...
 
static FPVector3 Scale (FPVector3 a, FPVector3 b)
 Multiplies each component of the vector by the same components of the provided vector. More...
 
static FP SignedAngle (FPVector3 a, FPVector3 b, FPVector3 axis)
 Returns the signed angle in degrees between a and b when rotated around an axis . More...
 
static FPVector3 Slerp (FPVector3 from, FPVector3 to, FP t)
 Spherically interpolates between from and to by t , which is clamped to the range [0, 1]. More...
 
static FPVector3 SlerpUnclamped (FPVector3 from, FPVector3 to, FP t)
 Spherically interpolates between from and to by t . More...
 

Public Attributes

FP X
 The X component of the vector. More...
 
FP Y
 The Y component of the vector. More...
 
FP Z
 The Z component of the vector. More...
 

Static Public Attributes

static FPVector3 Zero => new FPVector3()
 A vector with components (0,0,0); More...
 

Properties

static FPVector3 Back [get]
 A vector with components (0,0,-1); More...
 
static FPVector3 Down [get]
 A vector with components (0,-1,0); More...
 
static FPVector3 Forward [get]
 A vector with components (0,0,1); More...
 
static FPVector3 Left [get]
 A vector with components (-1,0,0); More...
 
FP Magnitude [get]
 Gets the length of the vector. More...
 
static FPVector3 MaxValue [get]
 A vector with components (FP.MaxValue,FP.MaxValue,FP.MaxValue); More...
 
static FPVector3 MinValue [get]
 A vector with components (FP.MinValue,FP.MinValue,FP.MinValue); More...
 
FPVector3 Normalized [get]
 Gets a normalized version of the vector. More...
 
static FPVector3 One [get]
 A vector with components (1,1,1); More...
 
static FPVector3 Right [get]
 A vector with components (1,0,0); More...
 
FP SqrMagnitude [get]
 Gets the squared length of the vector. More...
 
static FPVector3 Up [get]
 A vector with components (0,1,0); More...
 
static FPVector3 UseableMax [get]
 A vector with components (FP.UseableMax,FP.UseableMax,FP.UseableMax); More...
 
static FPVector3 UseableMin [get]
 A vector with components (FP.UseableMin,FP.UseableMin,FP.UseableMin); More...
 

Detailed Description

Represents a 3D Vector

Constructor & Destructor Documentation

◆ FPVector3() [1/4]

Photon.Deterministic.FPVector3.FPVector3 ( int  x,
int  y,
int  z 
)
inline

Constructor initializing a new instance of the structure

Parameters
xThe X component of the vector.
yThe Y component of the vector.
zThe Z component of the vector.

◆ FPVector3() [2/4]

Photon.Deterministic.FPVector3.FPVector3 ( int  x,
int  y 
)
inline

Constructor initializing a new instance of the structure

Parameters
xThe X component of the vector.
yThe Y component of the vector.

◆ FPVector3() [3/4]

Photon.Deterministic.FPVector3.FPVector3 ( FP  x,
FP  y,
FP  z 
)
inline

Constructor initializing a new instance of the structure

Parameters
xThe X component of the vector.
yThe Y component of the vector.
zThe Z component of the vector.

◆ FPVector3() [4/4]

Photon.Deterministic.FPVector3.FPVector3 ( FP  x,
FP  y 
)
inline

Constructor initializing a new instance of the structure

Parameters
xThe X component of the vector.
yThe Y component of the vector.

Member Function Documentation

◆ Normalize() [1/2]

static FPVector3 Photon.Deterministic.FPVector3.Normalize ( FPVector3  value)
inlinestatic

Normalizes the given vector. If the vector is too short to normalize, Zero will be returned.

Parameters
valueThe vector which should be normalized.
Returns
A normalized vector.

◆ Normalize() [2/2]

static FPVector3 Photon.Deterministic.FPVector3.Normalize ( FPVector3  value,
out FP  magnitude 
)
inlinestatic

Normalizes the given vector. If the vector is too short to normalize, Zero will be returned.

Parameters
valueThe vector which should be normalized.
magnitudeThe original vector's magnitude.
Returns
A normalized vector.

◆ ToString()

override String Photon.Deterministic.FPVector3.ToString ( )
inline

Builds a string from the FPVector3.

Returns
A string containing all three components.

◆ Equals()

override Boolean Photon.Deterministic.FPVector3.Equals ( Object  obj)
inline

Tests if an object is equal to this vector.

Parameters
objThe object to test.
Returns
Returns true if they are euqal, otherwise false.

◆ GetHashCode()

override Int32 Photon.Deterministic.FPVector3.GetHashCode ( )
inline

Gets the hashcode of the vector.

Returns
Returns the hashcode of the vector.

◆ Abs()

static FPVector3 Photon.Deterministic.FPVector3.Abs ( FPVector3  value)
inlinestatic

Returns a vector where each component is the absolute value of same component in value .

Parameters
value
Returns

◆ Lerp()

static FPVector3 Photon.Deterministic.FPVector3.Lerp ( FPVector3  start,
FPVector3  end,
FP  t 
)
inlinestatic

Linearly interpolates between start and end by t . t is clamped to the range [0, 1]

Parameters
start
end
t
Returns

◆ LerpUnclamped()

static FPVector3 Photon.Deterministic.FPVector3.LerpUnclamped ( FPVector3  start,
FPVector3  end,
FP  t 
)
inlinestatic

Linearly interpolates between start and end by t .

Parameters
start
end
t
Returns

◆ Slerp()

static FPVector3 Photon.Deterministic.FPVector3.Slerp ( FPVector3  from,
FPVector3  to,
FP  t 
)
inlinestatic

Spherically interpolates between from and to by t , which is clamped to the range [0, 1].

Input vectors are normalized and treated as directions. The resultant vector has direction spherically interpolated using the angle and magnitude linearly interpolated between the magnitudes of to and from .

Parameters
from
to
t
Returns

◆ SlerpUnclamped()

static FPVector3 Photon.Deterministic.FPVector3.SlerpUnclamped ( FPVector3  from,
FPVector3  to,
FP  t 
)
inlinestatic

Spherically interpolates between from and to by t .

Input vectors are normalized and treated as directions. The resultant vector has direction spherically interpolated using the angle and magnitude linearly interpolated between the magnitudes of to and from .

Parameters
from
to
t
Returns

◆ Scale()

static FPVector3 Photon.Deterministic.FPVector3.Scale ( FPVector3  a,
FPVector3  b 
)
inlinestatic

Multiplies each component of the vector by the same components of the provided vector.

Parameters
a
b
Returns

◆ ClampMagnitude()

static FPVector3 Photon.Deterministic.FPVector3.ClampMagnitude ( FPVector3  vector,
FP  maxLength 
)
inlinestatic

Clamps the magnitude of a vector

Parameters
vectorVector to clamp
maxLengthMax length of the supplied vector
Returns
The resulting (potentially clamped) vector

◆ Min()

static FPVector3 Photon.Deterministic.FPVector3.Min ( FPVector3  value1,
FPVector3  value2 
)
inlinestatic

Gets a vector with the minimum x,y and z values of both vectors.

Parameters
value1The first value.
value2The second value.
Returns
A vector with the minimum x,y and z values of both vectors.

◆ Max()

static FPVector3 Photon.Deterministic.FPVector3.Max ( FPVector3  value1,
FPVector3  value2 
)
inlinestatic

Gets a vector with the maximum x,y and z values of both vectors.

Parameters
value1The first value.
value2The second value.
Returns
A vector with the maximum x,y and z values of both vectors.

◆ Distance()

static FP Photon.Deterministic.FPVector3.Distance ( FPVector3  a,
FPVector3  b 
)
inlinestatic

Calculates the distance between two vectors

Parameters
aFirst vector
bSecond vector
Returns
The distance between the vectors

◆ DistanceSquared()

static FP Photon.Deterministic.FPVector3.DistanceSquared ( FPVector3  a,
FPVector3  b 
)
inlinestatic

Calculates the squared distance between two vectors

Parameters
aFirst vector
bSecond vector
Returns
The squared distance between the vectors

◆ Cross()

static FPVector3 Photon.Deterministic.FPVector3.Cross ( FPVector3  a,
FPVector3  b 
)
inlinestatic

The cross product of two vectors.

Parameters
aThe first vector.
bThe second vector.
Returns
The cross product of both vectors.

◆ Dot()

static FP Photon.Deterministic.FPVector3.Dot ( FPVector3  a,
FPVector3  b 
)
inlinestatic

Calculates the dot product of two vectors.

Parameters
aThe first vector.
bThe second vector.
Returns
Returns the dot product of both vectors.

◆ SignedAngle()

static FP Photon.Deterministic.FPVector3.SignedAngle ( FPVector3  a,
FPVector3  b,
FPVector3  axis 
)
inlinestatic

Returns the signed angle in degrees between a and b when rotated around an axis .

Parameters
a
b
axis
Returns

◆ Angle()

static FP Photon.Deterministic.FPVector3.Angle ( FPVector3  a,
FPVector3  b 
)
inlinestatic

Returns the angle in degrees between a and b .

Parameters
a
b
Returns

◆ MoveTowards()

static FPVector3 Photon.Deterministic.FPVector3.MoveTowards ( FPVector3  from,
FPVector3  to,
FP  maxDelta 
)
inlinestatic

Calculate a position between the points specified by from and to , moving no farther than the distance specified by maxDelta .

Parameters
from
to
maxDelta
Returns

◆ Project()

static FPVector3 Photon.Deterministic.FPVector3.Project ( FPVector3  vector,
FPVector3  normal 
)
inlinestatic

Projects a vector onto another vector.

Parameters
vector
normal
Returns

◆ ProjectOnPlane()

static FPVector3 Photon.Deterministic.FPVector3.ProjectOnPlane ( FPVector3  vector,
FPVector3  planeNormal 
)
inlinestatic

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

Parameters
vector
planeNormal
Returns
The location of the vector on the plane.

◆ Reflect()

static FPVector3 Photon.Deterministic.FPVector3.Reflect ( FPVector3  vector,
FPVector3  normal 
)
inlinestatic

Reflects a vector off the plane defined by a normal.

Parameters
vector
normal
Returns

◆ operator==()

static Boolean Photon.Deterministic.FPVector3.operator== ( FPVector3  a,
FPVector3  b 
)
inlinestatic

Returns true if two vectors are exactly equal.

Parameters
a
b
Returns

◆ operator!=()

static Boolean Photon.Deterministic.FPVector3.operator!= ( FPVector3  a,
FPVector3  b 
)
inlinestatic

Returns true if two vectors are not exactly equal.

Parameters
a
b
Returns

◆ operator-() [1/2]

static FPVector3 Photon.Deterministic.FPVector3.operator- ( FPVector3  v)
inlinestatic

Negates each component of v vector.

Parameters
v
Returns

◆ operator*() [1/2]

static FPVector3 Photon.Deterministic.FPVector3.operator* ( FPVector3  v,
FP  s 
)
inlinestatic

Multiplies each component of v times s .

Parameters
v
s
Returns

◆ operator*() [2/2]

static FPVector3 Photon.Deterministic.FPVector3.operator* ( FP  s,
FPVector3  v 
)
inlinestatic

Multiplies each component of v times s .

Parameters
v
s
Returns

◆ operator/() [1/2]

static FPVector3 Photon.Deterministic.FPVector3.operator/ ( FPVector3  v,
FP  s 
)
inlinestatic

Divides each component of v by s .

Parameters
v
s
Returns

◆ operator/() [2/2]

static FPVector3 Photon.Deterministic.FPVector3.operator/ ( FPVector3  v,
Int32  s 
)
inlinestatic

Divides each component of v by s .

Parameters
v
s
Returns

◆ operator-() [2/2]

static FPVector3 Photon.Deterministic.FPVector3.operator- ( FPVector3  a,
FPVector3  b 
)
inlinestatic

Subtracts b from a

Parameters
a
b
Returns

◆ operator+()

static FPVector3 Photon.Deterministic.FPVector3.operator+ ( FPVector3  a,
FPVector3  b 
)
inlinestatic

Adds two vectors.

Parameters
a
b
Returns

Member Data Documentation

◆ X

FP Photon.Deterministic.FPVector3.X

The X component of the vector.

◆ Y

FP Photon.Deterministic.FPVector3.Y

The Y component of the vector.

◆ Z

FP Photon.Deterministic.FPVector3.Z

The Z component of the vector.

◆ Zero

FPVector3 Photon.Deterministic.FPVector3.Zero => new FPVector3()
static

A vector with components (0,0,0);

Property Documentation

◆ Left

FPVector3 Photon.Deterministic.FPVector3.Left
staticget

A vector with components (-1,0,0);

◆ Right

FPVector3 Photon.Deterministic.FPVector3.Right
staticget

A vector with components (1,0,0);

◆ Up

FPVector3 Photon.Deterministic.FPVector3.Up
staticget

A vector with components (0,1,0);

◆ Down

FPVector3 Photon.Deterministic.FPVector3.Down
staticget

A vector with components (0,-1,0);

◆ Back

FPVector3 Photon.Deterministic.FPVector3.Back
staticget

A vector with components (0,0,-1);

◆ Forward

FPVector3 Photon.Deterministic.FPVector3.Forward
staticget

A vector with components (0,0,1);

◆ One

FPVector3 Photon.Deterministic.FPVector3.One
staticget

A vector with components (1,1,1);

◆ MinValue

FPVector3 Photon.Deterministic.FPVector3.MinValue
staticget

A vector with components (FP.MinValue,FP.MinValue,FP.MinValue);

◆ MaxValue

FPVector3 Photon.Deterministic.FPVector3.MaxValue
staticget

A vector with components (FP.MaxValue,FP.MaxValue,FP.MaxValue);

◆ UseableMin

FPVector3 Photon.Deterministic.FPVector3.UseableMin
staticget

A vector with components (FP.UseableMin,FP.UseableMin,FP.UseableMin);

◆ UseableMax

FPVector3 Photon.Deterministic.FPVector3.UseableMax
staticget

A vector with components (FP.UseableMax,FP.UseableMax,FP.UseableMax);

◆ SqrMagnitude

FP Photon.Deterministic.FPVector3.SqrMagnitude
get

Gets the squared length of the vector.

Returns
Returns the squared length of the vector.

◆ Magnitude

FP Photon.Deterministic.FPVector3.Magnitude
get

Gets the length of the vector.

Returns
Returns the length of the vector.

◆ Normalized

FPVector3 Photon.Deterministic.FPVector3.Normalized
get

Gets a normalized version of the vector.

Returns
Returns a normalized version of the vector.