ksQuaternion struct. More...
Public Member Functions | |
ksQuaternion (float x, float y, float z, float w) | |
Constructor. More... | |
void | Normalize () |
Normalizes this quaternion. More... | |
ksQuaternion | Inverse () |
Inversed quaternion. More... | |
void | Invert () |
Inverts this quaternion. More... | |
ksVector3 | ToEuler () |
Euler angle representation of this quaternion in degrees. More... | |
ksVector3 | ToEulerRadians () |
Euler angle representation of this quaternion in radians. More... | |
void | ToAxisAngle (out ksVector3 axis, out float angle) |
Converts the quaternion to axis-angle representation. More... | |
void | ToAxisAngleRadians (out ksVector3 axis, out float angle) |
Converts the quaternion to axis-angle representation. More... | |
ksVector3 | ToAngularDisplacement () |
angular displacement representation of this quaternion in degrees. More... | |
ksVector3 | ToAngularDisplacementRadians () |
Angular displacement representation of this quaternion in radians. More... | |
override string | ToString () |
Gets the string representation of the vector. More... | |
string | ToString (string format) |
Returns a string respresentation of the quaternion. More... | |
string | ToString (IFormatProvider provider) |
Returns a string respresentation of the quaternion. More... | |
override bool | Equals (object obj) |
Checks if this quaternion is equal to an object. More... | |
bool | Equals (ksQuaternion other) |
Checks if this quaternion is equal to another. More... | |
override int | GetHashCode () |
Gets the hash code for this quaternion. More... | |
Static Public Member Functions | |
static implicit | operator float[] (ksQuaternion value) |
Implicit conversion from ksQuaternion to float[4]. More... | |
static implicit | operator ksQuaternion (float[] value) |
Implicit conversion from float[] to ksQuaternion. More... | |
static ksQuaternion | FromEuler (ksVector3 euler) |
Constructs a ksQuaternion from euler angles. More... | |
static ksQuaternion | FromEulerRadians (ksVector3 euler) |
Constructs a ksQuaternion from euler angles. More... | |
static ksQuaternion | FromAxisAngle (ksVector3 axis, float angle) |
Constructs a ksQuaternion from an axis-angle. More... | |
static ksQuaternion | FromAxisAngleRadians (ksVector3 axis, float angle) |
Constructs a ksQuaternion from an axis-angle. More... | |
static ksQuaternion | FromAngularDisplacement (ksVector3 angularDisplacement) |
Constructs a ksQuaternion from angular displacement. More... | |
static ksQuaternion | FromAngularDisplacementRadians (ksVector3 angularDisplacement) |
Constructs a ksQuaternion from angular displacement. More... | |
static ksQuaternion | FromDirection (ksVector3 forward) |
Constructs a ksQuaternion from a forward direction, with ksVector3.Up as the up direction. More... | |
static ksQuaternion | FromDirection (ksVector3 forward, ksVector3 up) |
Constructs a ksQuaternion from forward and up directions. More... | |
static ksQuaternion | FromVectorDelta (ksVector3 startDirection, ksVector3 endDirection) |
Constructs a ksQuaternion that rotates one vector to another. More... | |
static ksQuaternion | RotateByEuler (ksQuaternion quaternion, ksVector3 euler) |
Rotates a quaternion by euler angles. More... | |
static ksQuaternion | RotateByEulerRadians (ksQuaternion quaternion, ksVector3 euler) |
Rotates a quaternion by euler angles. More... | |
static float | DeltaDegrees (ksQuaternion a, ksQuaternion b) |
Returns the angle in degrees between two quaternions. More... | |
static float | DeltaRadians (ksQuaternion a, ksQuaternion b) |
Returns the angle in radians between two quaternions. More... | |
static float | Dot (ksQuaternion a, ksQuaternion b) |
Computes the dot product of two quaternions. More... | |
static ksQuaternion | Lerp (ksQuaternion from, ksQuaternion to, float t) |
Interpolates linearly between two quaternions. More... | |
static ksQuaternion | Slerp (ksQuaternion from, ksQuaternion to, float t) |
Spherically interpolates between two quaternions. More... | |
static ksQuaternion | RotateTowards (ksQuaternion start, ksQuaternion target, float deltaAngle) |
Rotates a quaternion towards another. More... | |
static ksQuaternion | RotateTowardsRadians (ksQuaternion start, ksQuaternion target, float deltaAngle) |
Rotates a quaternion towards another. More... | |
static ksVector3 | AngularDisplacement (ksQuaternion start, ksQuaternion end) |
Returns the angular displacement between two quaternions. More... | |
static ksVector3 | AngularDisplacementRadians (ksQuaternion start, ksQuaternion end) |
Returns the angular displacement between two quaternions. More... | |
static ksQuaternion | AddAngularDisplacement (ksQuaternion quaternion, ksVector3 angularDisplacement) |
Rotates a quaternion using angular displacement. More... | |
static ksQuaternion | AddAngularDisplacementRadians (ksQuaternion quaternion, ksVector3 angularDisplacement) |
Rotates a quaternion using angular displacement. More... | |
static ksQuaternion | operator- (ksQuaternion q) |
Quaternion unary - operator. More... | |
static ksQuaternion | operator* (ksQuaternion lhs, ksQuaternion rhs) |
Quaternion multiplication. More... | |
static ksVector3 | operator* (ksQuaternion rotation, ksVector3 point) |
Rotates a vector by a quaternion. More... | |
static ksVector3 | operator* (ksVector3 point, ksQuaternion rotation) |
Rotates a vector by a quaternion. More... | |
static bool | operator== (ksQuaternion lhs, ksQuaternion rhs) |
Checks if two quaternions are equal. More... | |
static bool | operator!= (ksQuaternion lhs, ksQuaternion rhs) |
Checks if two quaternions are not equal. More... | |
static implicit | operator Quaternion (ksQuaternion value) |
Implicit conversion from ksQuaternion to Unity Quaternion. More... | |
static implicit | operator ksQuaternion (Quaternion value) |
Implicit conversion from Unity Quaternion to ksQuaternion. More... | |
static ksQuaternion | operator* (ksQuaternion lhs, Quaternion rhs) |
Quaternion multiplication with ksQuaternion and Unity Quaternion. More... | |
static Quaternion | operator* (Quaternion lhs, ksQuaternion rhs) |
Quaternion multiplication with Unity Quaternion and ksQuaternion. More... | |
static bool | operator== (ksQuaternion lhs, Quaternion rhs) |
Equality comparison with ksQuaternion and Unity Quaternion. More... | |
static bool | operator== (Quaternion lhs, ksQuaternion rhs) |
Equality comparison with Unity Quaternion and ksQuaternion. More... | |
static bool | operator!= (ksQuaternion lhs, Quaternion rhs) |
Inequality comparison with ksQuaternion and Unity Quaternion. More... | |
static bool | operator!= (Quaternion lhs, ksQuaternion rhs) |
Inequality comparison with Unity Quaternion and ksQuaternion. More... | |
Properties | |
static ksQuaternion | Identity [get] |
float | X [get, set] |
X value of this quaternion. More... | |
float | Y [get, set] |
Y value of this quaternion. More... | |
float | Z [get, set] |
Z value of this quaternion. More... | |
float | W [get, set] |
W value of this quaternion. More... | |
float | this[int index] [get, set] |
Indexer. More... | |
bool | IsValid [get] |
Checks if the quaternion is valid (the components are normalized). More... | |
ksQuaternion struct.
Quaternion struct
KS.Reactor.ksQuaternion.ksQuaternion | ( | float | x, |
float | y, | ||
float | z, | ||
float | w | ||
) |
Constructor.
x | X value. |
y | Y value. |
z | Z value. |
w | W value. |
|
static |
Rotates a quaternion using angular displacement.
quaternion | Quaternion to rotate. |
angularDisplacement | Angular displacement in degrees. |
|
static |
Rotates a quaternion using angular displacement.
quaternion | Quaternion to rotate. |
angularDisplacement | Angular displacement in radians. |
|
static |
Returns the angular displacement between two quaternions.
start | |
end |
|
static |
Returns the angular displacement between two quaternions.
start | |
end |
|
static |
Returns the angle in degrees between two quaternions.
a | |
b |
|
static |
Returns the angle in radians between two quaternions.
a | |
b |
|
static |
Computes the dot product of two quaternions.
a | |
b |
bool KS.Reactor.ksQuaternion.Equals | ( | ksQuaternion | other | ) |
Checks if this quaternion is equal to another.
other | Other quaternion to compare with. |
override bool KS.Reactor.ksQuaternion.Equals | ( | object | obj | ) |
Checks if this quaternion is equal to an object.
obj | Object to compare with this quaternion. |
|
static |
|
static |
Constructs a ksQuaternion from angular displacement.
angularDisplacement | Angular displacement in radians. |
|
static |
Constructs a ksQuaternion from an axis-angle.
axis | Axis of rotation. |
angle | Angle of rotation in degrees. |
|
static |
Constructs a ksQuaternion from an axis-angle.
axis | Axis of rotation. |
angle | Angle of rotation in radians. |
|
static |
Constructs a ksQuaternion from a forward direction, with ksVector3.Up as the up direction.
forward | Forward direction. |
|
static |
Constructs a ksQuaternion from forward and up directions.
forward | Forward direction. |
up | Up direction. |
|
static |
|
static |
|
static |
Constructs a ksQuaternion that rotates one vector to another.
startDirection | Start direction. |
endDirection | End direction. |
override int KS.Reactor.ksQuaternion.GetHashCode | ( | ) |
Gets the hash code for this quaternion.
ksQuaternion KS.Reactor.ksQuaternion.Inverse | ( | ) |
Inversed quaternion.
void KS.Reactor.ksQuaternion.Invert | ( | ) |
Inverts this quaternion.
|
static |
Interpolates linearly between two quaternions.
from | Quaternion to interpolate from. |
to | Quaternion to interpolate to. |
t | Value between 0 and 1 that determines the amount of interpolation. |
void KS.Reactor.ksQuaternion.Normalize | ( | ) |
Normalizes this quaternion.
|
static |
Implicit conversion from ksQuaternion to float[4].
|
static |
Implicit conversion from float[] to ksQuaternion.
|
static |
Implicit conversion from Unity Quaternion to ksQuaternion.
value | Unity quaternion |
|
static |
Implicit conversion from ksQuaternion to Unity Quaternion.
value | Reactor quaternion |
|
static |
Checks if two quaternions are not equal.
lhs | |
rhs |
|
static |
|
static |
|
static |
Quaternion multiplication.
lhs | |
rhs |
|
static |
Quaternion multiplication with ksQuaternion and Unity Quaternion.
lhs | |
rhs |
|
static |
Rotates a vector by a quaternion.
rotation | Rotation to apply. |
point | Point to rotate. |
|
static |
Rotates a vector by a quaternion.
point | Point to rotate. |
rotation | Rotation to apply. |
|
static |
Quaternion multiplication with Unity Quaternion and ksQuaternion.
lhs | |
rhs |
|
static |
Quaternion unary - operator.
q |
|
static |
Checks if two quaternions are equal.
lhs | |
rhs |
|
static |
|
static |
|
static |
Rotates a quaternion by euler angles.
quaternion | Quaternion to rotate. |
euler | Euler angles in degrees to rotate by. |
|
static |
Rotates a quaternion by euler angles.
quaternion | Quaternion to rotate. |
euler | Euler angles in radians to rotate by. |
|
static |
Rotates a quaternion towards another.
start | Start rotation. |
target | Target to rotate towards. |
deltaAngle | Delta angle in degrees to rotate. It will not overshoot the target. Negative values will rotate away from the target. |
|
static |
Rotates a quaternion towards another.
start | Start rotation. |
target | Target to rotate towards. |
deltaAngle | Delta angle in radians to rotate. It will not overshoot the target. Negative values will rotate away from the target. |
|
static |
Spherically interpolates between two quaternions.
from | Quaternion to interpolate from. |
to | Quaternion to interpolate to. |
t | Value between 0 and 1 that determines the amount of interpolation. |
ksVector3 KS.Reactor.ksQuaternion.ToAngularDisplacement | ( | ) |
angular displacement representation of this quaternion in degrees.
ksVector3 KS.Reactor.ksQuaternion.ToAngularDisplacementRadians | ( | ) |
Angular displacement representation of this quaternion in radians.
void KS.Reactor.ksQuaternion.ToAxisAngle | ( | out ksVector3 | axis, |
out float | angle | ||
) |
Converts the quaternion to axis-angle representation.
axis | Axis of rotation. |
angle | Angle of rotation in degrees. |
void KS.Reactor.ksQuaternion.ToAxisAngleRadians | ( | out ksVector3 | axis, |
out float | angle | ||
) |
Converts the quaternion to axis-angle representation.
axis | Axis of rotation. |
angle | Angle of rotation in radians. |
ksVector3 KS.Reactor.ksQuaternion.ToEuler | ( | ) |
Euler angle representation of this quaternion in degrees.
ksVector3 KS.Reactor.ksQuaternion.ToEulerRadians | ( | ) |
Euler angle representation of this quaternion in radians.
override string KS.Reactor.ksQuaternion.ToString | ( | ) |
Gets the string representation of the vector.
string KS.Reactor.ksQuaternion.ToString | ( | IFormatProvider | provider | ) |
Returns a string respresentation of the quaternion.
provider |
string KS.Reactor.ksQuaternion.ToString | ( | string | format | ) |
Returns a string respresentation of the quaternion.
format |
|
get |
Checks if the quaternion is valid (the components are normalized).
|
getset |
Indexer.
|
getset |
W value of this quaternion.
|
getset |
X value of this quaternion.
|
getset |
Y value of this quaternion.
|
getset |
Z value of this quaternion.