A Quaternion representing an orientation. More...
Public Member Functions | |
FPQuaternion (FP x, FP y, FP z, FP w) | |
Creates a new instance of FPQuaternion More... | |
Static Public Member Functions | |
static FP | Angle (FPQuaternion a, FPQuaternion b) |
Returns the angle in degrees between two rotations a and b . More... | |
static FPQuaternion | AngleAxis (FP angle, FPVector3 axis) |
Creates a rotation which rotates angle degrees around axis . More... | |
static FPQuaternion | Conjugate (FPQuaternion value) |
Returns conjugate quaternion. This method computes the equivalent to the following pseduo-code: More... | |
static FPQuaternion | CreateFromYawPitchRoll (FP yaw, FP pitch, FP roll) |
Returns a rotation that rotates roll radians around the z axis, pitch radians around the x axis, and yaw radians around the y axis. More... | |
static FP | Dot (FPQuaternion a, FPQuaternion b) |
Returns the dot product between two rotations. This method computes the equivalent to the following pseduo-code: More... | |
static FPQuaternion | Euler (FP x, FP y, FP z) |
Returns a rotation that rotates z degrees around the z axis, x degrees around the x axis, and y degrees around the y axis. More... | |
static FPQuaternion | Euler (FPVector3 eulerAngles) |
Returns a rotation that rotates eulerAngles .z degrees around the z axis, eulerAngles .x degrees around the x axis, and eulerAngles .y degrees around the y axis. More... | |
static FPQuaternion | FromToRotation (FPVector3 fromVector, FPVector3 toVector) |
Creates a quaternion which rotates from fromVector to toVector (normalized internally). If these vectors are known to be normalized or have magnitude close to 1, FromToRotationSkipNormalize can be used for better performance. More... | |
static FPQuaternion | FromToRotationSkipNormalize (FPVector3 fromVector, FPVector3 toVector) |
Creates a quaternion which rotates from fromVector to toVector (not normalized internally). If these vectors are known to be normalized or have magnitude close to 1, use FromToRotation instead. More... | |
static FPQuaternion | Inverse (FPQuaternion value) |
Returns the Inverse of rotation value . If value is normalized it will be faster to call Conjugate(FPQuaternion). If value has a magnitude close to 0, value will be returned. More... | |
static bool | IsIdentity (FPQuaternion value) |
Checks if the quaternion is the identity quaternion More... | |
static bool | IsZero (FPQuaternion value) |
Checks if the quaternion is the invalid zero quaternion More... | |
static FPQuaternion | Lerp (FPQuaternion a, FPQuaternion b, FP t) |
Interpolates between a and b by t and normalizes the result afterwards. The parameter t is clamped to the range [0, 1]. More... | |
static FPQuaternion | LerpUnclamped (FPQuaternion a, FPQuaternion b, FP t) |
Interpolates between a and b by t and normalizes the result afterwards. More... | |
static FPQuaternion | LookRotation (FPVector3 forward) |
Creates a rotation with the specified forward direction and FPVector3.Up. More... | |
static FPQuaternion | LookRotation (FPVector3 forward, FPVector3 up, bool orthoNormalize=false) |
Creates a rotation with the specified forward and up directions. More... | |
static FPQuaternion | Normalize (FPQuaternion value) |
Converts this quaternion value to one with the same orientation but with a magnitude of 1. If value has a magnitude close to 0, Identity is returned. More... | |
static FPQuaternion | operator* (FP left, FPQuaternion right) |
Scales quaternion right with left . More... | |
static FPQuaternion | operator* (FPQuaternion left, FP right) |
Scales quaternion left with right . More... | |
static FPQuaternion | operator* (FPQuaternion left, FPQuaternion right) |
Computes product of two quaternions. Fully equivalent to Unity's Quaternion multiplication. See Product(FPQuaternion, FPQuaternion) for details. More... | |
static FPVector3 | operator* (FPQuaternion quat, FPVector3 point) |
Rotates the point point with rotation quat . More... | |
static FPQuaternion | operator+ (FPQuaternion left, FPQuaternion right) |
Adds each component of right to left . More... | |
static FPQuaternion | operator- (FPQuaternion left, FPQuaternion right) |
Subtracts each component of right from left . More... | |
static FPQuaternion | Product (FPQuaternion left, FPQuaternion right) |
Creates product of two quaternions. Can be used to combine two rotations. Just like in the case of FPMatrix4x4 the righmost operand gets applied first. This method computes the equivalent to the following pseduo-code: More... | |
static FPQuaternion | RadianAxis (FP radians, FPVector3 axis) |
Creates a rotation which rotates radians radians around axis . More... | |
static FPQuaternion | RotateTowards (FPQuaternion from, FPQuaternion to, FP maxDegreesDelta) |
Rotates a rotation from towards to by an angular step of maxDegreesDelta . More... | |
static FPQuaternion | Slerp (FPQuaternion from, FPQuaternion to, FP t) |
Spherically interpolates between from and to by t and normalizes the result afterwards. t is clamped to the range [0, 1]. More... | |
static FPQuaternion | SlerpUnclamped (FPQuaternion from, FPQuaternion to, FP t) |
Spherically interpolates between from and to by t and normalizes the result afterwards. More... | |
Public Attributes | |
FPVector3 | AsEuler => ToEulerZXY(this) |
Returns one of possible Euler angles representation, where rotations are performed around the Z axis, the X axis, and the Y axis, in that order. More... | |
FPQuaternion | Conjugated => Conjugate(this) |
Creates this quaternion's conjugate. For normalized quaternions this property represents inverse rotation and should be used instead of Inverted More... | |
FPQuaternion | Inverted => Inverse(this) |
Creates this quaternion's inverse. If this quaternion is normalized, use Conjugated instead. More... | |
FP | Magnitude => FP.FromRaw(FPMath.SqrtRaw(MagnitudeSqrRaw)) |
Return this quaternion's magnitude. More... | |
FP | MagnitudeSqr => FP.FromRaw(MagnitudeSqrRaw) |
Returns square of this quaternion's magnitude. More... | |
FPQuaternion | Normalized => Normalize(this) |
Returns this quaternion with magnitude of 1. Most API functions expect and return normalized quaternions, so unless components get set manually, there should not be a need to normalize quaternions More... | |
FP | W |
The W component of the quaternion. More... | |
FP | X |
The X component of the quaternion. More... | |
FP | Y |
The Y component of the quaternion. More... | |
FP | Z |
The Z component of the quaternion. More... | |
Properties | |
static FPQuaternion | Identity [get] |
Quaternion corresponding to "no rotation". More... | |
A Quaternion representing an orientation.
Creates a new instance of FPQuaternion
x | X component. |
y | Y component. |
z | Z component. |
w | W component. |
|
inlinestatic |
Creates product of two quaternions. Can be used to combine two rotations. Just like in the case of FPMatrix4x4 the righmost operand gets applied first. This method computes the equivalent to the following pseduo-code:
FPQuaternion result; result.x = (left.w * right.x) + (left.x * right.w) + (left.y * right.z) - (left.z * right.y); result.y = (left.w * right.y) - (left.x * right.z) + (left.y * right.w) + (left.z * right.x); result.z = (left.w * right.z) + (left.x * right.y) - (left.y * right.x) + (left.z * right.w); result.w = (left.w * right.w) - (left.x * right.x) - (left.y * right.y) - (left.z * right.z); return result;
left | |
right |
|
inlinestatic |
Returns conjugate quaternion. This method computes the equivalent to the following pseduo-code:
return new FPQuaternion(-value.X, -value.Y, -value.Z, value.W);
Conjugate can be used instead of an inverse quaterion if value is normalized.
value |
|
inlinestatic |
Checks if the quaternion is the identity quaternion
value |
|
inlinestatic |
Checks if the quaternion is the invalid zero quaternion
value |
|
inlinestatic |
Returns the dot product between two rotations. This method computes the equivalent to the following pseduo-code:
return a.X * b.X + a.Y * b.Y + a.Z * b.Z + a.W * b.W;
a | |
b |
|
inlinestatic |
Creates a quaternion which rotates from fromVector to toVector (normalized internally). If these vectors are known to be normalized or have magnitude close to 1, FromToRotationSkipNormalize can be used for better performance.
fromVector | |
toVector |
|
inlinestatic |
Creates a quaternion which rotates from fromVector to toVector (not normalized internally). If these vectors are known to be normalized or have magnitude close to 1, use FromToRotation instead.
fromVector | |
toVector |
|
inlinestatic |
Interpolates between a and b by t and normalizes the result afterwards. The parameter t is clamped to the range [0, 1].
a | |
b | |
t |
|
inlinestatic |
Interpolates between a and b by t and normalizes the result afterwards.
a | |
b | |
t |
|
inlinestatic |
Returns a rotation that rotates roll radians around the z axis, pitch radians around the x axis, and yaw radians around the y axis.
yaw | Yaw in radians |
pitch | Pitch in radians |
roll | Roll in radians |
|
inlinestatic |
Returns the angle in degrees between two rotations a and b .
a | |
b |
|
static |
Creates a rotation with the specified forward direction and FPVector3.Up.
forward |
|
inlinestatic |
Creates a rotation with the specified forward and up directions.
forward | |
up | |
orthoNormalize |
|
inlinestatic |
Spherically interpolates between from and to by t and normalizes the result afterwards. t is clamped to the range [0, 1].
FPLut needs to be initialised.
from | |
to | |
t |
|
inlinestatic |
Spherically interpolates between from and to by t and normalizes the result afterwards.
FPLut needs to be initialised.
from | |
to | |
t |
|
inlinestatic |
Rotates a rotation from towards to by an angular step of maxDegreesDelta .
from | |
to | |
maxDegreesDelta |
|
inlinestatic |
Returns a rotation that rotates z degrees around the z axis, x degrees around the x axis, and y degrees around the y axis.
x | |
y | |
z |
|
inlinestatic |
Returns a rotation that rotates eulerAngles .z degrees around the z axis, eulerAngles .x degrees around the x axis, and eulerAngles .y degrees around the y axis.
eulerAngles |
|
inlinestatic |
Creates a rotation which rotates angle degrees around axis .
FPLut needs to be initialised.
angle | |
axis |
|
inlinestatic |
Creates a rotation which rotates radians radians around axis .
FPLut needs to be initialised.
radians | |
axis |
|
inlinestatic |
Returns the Inverse of rotation value . If value is normalized it will be faster to call Conjugate(FPQuaternion). If value has a magnitude close to 0, value will be returned.
FPLut needs to be initialised.
value |
|
inlinestatic |
Converts this quaternion value to one with the same orientation but with a magnitude of 1. If value has a magnitude close to 0, Identity is returned.
value |
|
static |
Computes product of two quaternions. Fully equivalent to Unity's Quaternion multiplication. See Product(FPQuaternion, FPQuaternion) for details.
left | |
right |
|
inlinestatic |
Scales quaternion left with right .
left | |
right |
|
static |
Scales quaternion right with left .
right | |
left |
|
inlinestatic |
Adds each component of right to left .
left | |
right |
|
inlinestatic |
Subtracts each component of right from left .
left | |
right |
|
inlinestatic |
Rotates the point point with rotation quat .
quat | |
point |
FP Photon.Deterministic.FPQuaternion.X |
The X component of the quaternion.
FP Photon.Deterministic.FPQuaternion.Y |
The Y component of the quaternion.
FP Photon.Deterministic.FPQuaternion.Z |
The Z component of the quaternion.
FP Photon.Deterministic.FPQuaternion.W |
The W component of the quaternion.
FPQuaternion Photon.Deterministic.FPQuaternion.Normalized => Normalize(this) |
Returns this quaternion with magnitude of 1. Most API functions expect and return normalized quaternions, so unless components get set manually, there should not be a need to normalize quaternions
FPQuaternion Photon.Deterministic.FPQuaternion.Inverted => Inverse(this) |
Creates this quaternion's inverse. If this quaternion is normalized, use Conjugated instead.
FPQuaternion Photon.Deterministic.FPQuaternion.Conjugated => Conjugate(this) |
Creates this quaternion's conjugate. For normalized quaternions this property represents inverse rotation and should be used instead of Inverted
FP Photon.Deterministic.FPQuaternion.MagnitudeSqr => FP.FromRaw(MagnitudeSqrRaw) |
Returns square of this quaternion's magnitude.
FP Photon.Deterministic.FPQuaternion.Magnitude => FP.FromRaw(FPMath.SqrtRaw(MagnitudeSqrRaw)) |
Return this quaternion's magnitude.
FPVector3 Photon.Deterministic.FPQuaternion.AsEuler => ToEulerZXY(this) |
Returns one of possible Euler angles representation, where rotations are performed around the Z axis, the X axis, and the Y axis, in that order.
|
staticget |
Quaternion corresponding to "no rotation".