C# Class QualisysRealTime.Unity.Skeleton.QuaternionHelper2

ファイルを表示 Open project: qualisys/Qualisys-Unity-SDK Class Usage Examples

Public Properties

Property Type Description
Zero Quaternion
precision float

Public Methods

Method Description
DifferenceBetween ( Quaternion right, Quaternion left ) : float

Calculates the difference in rotation between two Quaternions if result is 0, there is no difference between the Quaternions if the results is 1, the difference is 180 degrees difference

FromMatrix ( Matrix4 matrix ) : Quaternion

Builds a quaternion from the given rotation matrix

FromMatrix ( Matrix4 &matrix, Quaternion &result ) : void

Builds a quaternion from the given rotation matrix

GetOrientation ( OpenTK.Vector3 forwardPoint, OpenTK.Vector3 leftPoint, OpenTK.Vector3 rightPoint ) : Quaternion

Get orientation of three points, where on point defines forward

GetOrientationFromYX ( OpenTK.Vector3 y, OpenTK.Vector3 x ) : Quaternion

Get quaternion with front and right vector

GetOrientationFromZY ( OpenTK.Vector3 z, OpenTK.Vector3 y ) : Quaternion

Get quaternion with front and right vector

GetRotationBetween ( OpenTK.Vector3 a, OpenTK.Vector3 b, float stiffness = 1f ) : Quaternion

Returns a quaternion representing the rotation from vector a to b Robust, does not return NaN

IsNaN ( this q ) : bool

Check if any element in quaternion is NaN

LookAtRight ( OpenTK.Vector3 source, OpenTK.Vector3 target, OpenTK.Vector3 x ) : Quaternion

Get quaternion with rotation as Y axis from source towards target and X close to right parameter

LookAtUp ( OpenTK.Vector3 source, OpenTK.Vector3 target, OpenTK.Vector3 z ) : Quaternion

Get quaternion with rotation as Y axis towards target as close as z parameter as possible

Rotate ( Quaternion quaternion, OpenTK.Vector3 vec ) : OpenTK.Vector3
RotationBetween ( OpenTK.Vector3 from, OpenTK.Vector3 to ) : Quaternion

Returns a quaternion representing the rotation between vectors Not robust, but faster

RotationX ( float radians ) : Quaternion

Rotation around X axis

RotationY ( float radians ) : Quaternion

Rotation around Y axis

RotationZ ( float radians ) : Quaternion

Rotation around Z axis

Method Details

DifferenceBetween() public static method

Calculates the difference in rotation between two Quaternions if result is 0, there is no difference between the Quaternions if the results is 1, the difference is 180 degrees difference
public static DifferenceBetween ( Quaternion right, Quaternion left ) : float
right Quaternion
left Quaternion
return float

FromMatrix() public static method

Builds a quaternion from the given rotation matrix
public static FromMatrix ( Matrix4 matrix ) : Quaternion
matrix Matrix4 A rotation matrix
return Quaternion

FromMatrix() public static method

Builds a quaternion from the given rotation matrix
public static FromMatrix ( Matrix4 &matrix, Quaternion &result ) : void
matrix Matrix4 A rotation matrix
result Quaternion The equivalent quaternion
return void

GetOrientation() public static method

Get orientation of three points, where on point defines forward
public static GetOrientation ( OpenTK.Vector3 forwardPoint, OpenTK.Vector3 leftPoint, OpenTK.Vector3 rightPoint ) : Quaternion
forwardPoint OpenTK.Vector3
leftPoint OpenTK.Vector3
rightPoint OpenTK.Vector3
return Quaternion

GetOrientationFromYX() public static method

Get quaternion with front and right vector
public static GetOrientationFromYX ( OpenTK.Vector3 y, OpenTK.Vector3 x ) : Quaternion
y OpenTK.Vector3
x OpenTK.Vector3
return Quaternion

GetOrientationFromZY() public static method

Get quaternion with front and right vector
public static GetOrientationFromZY ( OpenTK.Vector3 z, OpenTK.Vector3 y ) : Quaternion
z OpenTK.Vector3
y OpenTK.Vector3
return Quaternion

GetRotationBetween() public static method

Returns a quaternion representing the rotation from vector a to b Robust, does not return NaN
public static GetRotationBetween ( OpenTK.Vector3 a, OpenTK.Vector3 b, float stiffness = 1f ) : Quaternion
a OpenTK.Vector3 The first vector
b OpenTK.Vector3 The secound vector
stiffness float Stiffness value
return Quaternion

IsNaN() public static method

Check if any element in quaternion is NaN
public static IsNaN ( this q ) : bool
q this
return bool

LookAtRight() public static method

Get quaternion with rotation as Y axis from source towards target and X close to right parameter
public static LookAtRight ( OpenTK.Vector3 source, OpenTK.Vector3 target, OpenTK.Vector3 x ) : Quaternion
source OpenTK.Vector3 Position vector to look from
target OpenTK.Vector3 Position vector to look at
x OpenTK.Vector3
return Quaternion

LookAtUp() public static method

Get quaternion with rotation as Y axis towards target as close as z parameter as possible
public static LookAtUp ( OpenTK.Vector3 source, OpenTK.Vector3 target, OpenTK.Vector3 z ) : Quaternion
source OpenTK.Vector3 The source position vector to look from
target OpenTK.Vector3
z OpenTK.Vector3
return Quaternion

Rotate() public static method

public static Rotate ( Quaternion quaternion, OpenTK.Vector3 vec ) : OpenTK.Vector3
quaternion Quaternion
vec OpenTK.Vector3
return OpenTK.Vector3

RotationBetween() public static method

Returns a quaternion representing the rotation between vectors Not robust, but faster
public static RotationBetween ( OpenTK.Vector3 from, OpenTK.Vector3 to ) : Quaternion
from OpenTK.Vector3 The vetor the rotation start from
to OpenTK.Vector3 The vector the quaternion should result in if from vector was transformed by the resulting Quaternion
return Quaternion

RotationX() public static method

Rotation around X axis
public static RotationX ( float radians ) : Quaternion
radians float rotation amount
return Quaternion

RotationY() public static method

Rotation around Y axis
public static RotationY ( float radians ) : Quaternion
radians float rotation amount
return Quaternion

RotationZ() public static method

Rotation around Z axis
public static RotationZ ( float radians ) : Quaternion
radians float rotation amount
return Quaternion

Property Details

Zero public_oe static_oe property

Defines the zero quaternion.
public static Quaternion Zero
return Quaternion

precision public_oe static_oe property

public static float precision
return float