TrueSync
Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Properties | List of all members
TrueSync.TSQuaternion Struct Reference

A Quaternion representing an orientation. More...

Public Member Functions

 TSQuaternion (FP x, FP y, FP z, FP w)
 Initializes a new instance of the JQuaternion structure. More...
 
void Set (FP new_x, FP new_y, FP new_z, FP new_w)
 
void SetFromToRotation (TSVector fromDirection, TSVector toDirection)
 
void Normalize ()
 Sets the length of the quaternion to one. More...
 
override string ToString ()
 

Static Public Member Functions

static FP Angle (TSQuaternion a, TSQuaternion b)
 
static TSQuaternion Add (TSQuaternion quaternion1, TSQuaternion quaternion2)
 Quaternions are added. More...
 
static TSQuaternion Euler (FP x, FP y, FP z)
 
static TSQuaternion Euler (TSVector eulerAngles)
 
static TSQuaternion AngleAxis (FP angle, TSVector axis)
 
static void CreateFromYawPitchRoll (FP yaw, FP pitch, FP roll, out TSQuaternion result)
 
static void Add (ref TSQuaternion quaternion1, ref TSQuaternion quaternion2, out TSQuaternion result)
 Quaternions are added. More...
 
static TSQuaternion Conjugate (TSQuaternion value)
 
static FP Dot (TSQuaternion a, TSQuaternion b)
 
static TSQuaternion Inverse (TSQuaternion rotation)
 
static TSQuaternion FromToRotation (TSVector fromVector, TSVector toVector)
 
static TSQuaternion Lerp (TSQuaternion a, TSQuaternion b, FP t)
 
static TSQuaternion LerpUnclamped (TSQuaternion a, TSQuaternion b, FP t)
 
static TSQuaternion Subtract (TSQuaternion quaternion1, TSQuaternion quaternion2)
 Quaternions are subtracted. More...
 
static void Subtract (ref TSQuaternion quaternion1, ref TSQuaternion quaternion2, out TSQuaternion result)
 Quaternions are subtracted. More...
 
static TSQuaternion Multiply (TSQuaternion quaternion1, TSQuaternion quaternion2)
 Multiply two quaternions. More...
 
static void Multiply (ref TSQuaternion quaternion1, ref TSQuaternion quaternion2, out TSQuaternion result)
 Multiply two quaternions. More...
 
static TSQuaternion Multiply (TSQuaternion quaternion1, FP scaleFactor)
 Scale a quaternion More...
 
static void Multiply (ref TSQuaternion quaternion1, FP scaleFactor, out TSQuaternion result)
 Scale a quaternion More...
 
static TSQuaternion CreateFromMatrix (TSMatrix matrix)
 Creates a quaternion from a matrix. More...
 
static void CreateFromMatrix (ref TSMatrix matrix, out TSQuaternion result)
 Creates a quaternion from a matrix. More...
 
static TSQuaternion operator* (TSQuaternion value1, TSQuaternion value2)
 Multiply two quaternions. More...
 
static TSQuaternion operator+ (TSQuaternion value1, TSQuaternion value2)
 Add two quaternions. More...
 
static TSQuaternion operator- (TSQuaternion value1, TSQuaternion value2)
 Subtract two quaternions. More...
 
static TSVector operator* (TSQuaternion quat, TSVector vec)
 Rotates a TSVector by the TSQuanternion.
 

Public Attributes

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...
 
FP w
 The W component of the quaternion. More...
 

Static Public Attributes

static readonly TSQuaternion identity
 

Properties

TSVector eulerAngles [get]
 

Detailed Description

A Quaternion representing an orientation.

Definition at line 29 of file TSQuaternion.cs.

Constructor & Destructor Documentation

TrueSync.TSQuaternion.TSQuaternion ( FP  x,
FP  y,
FP  z,
FP  w 
)

Initializes a new instance of the JQuaternion structure.

Parameters
xThe X component of the quaternion.
yThe Y component of the quaternion.
zThe Z component of the quaternion.
wThe W component of the quaternion.

Definition at line 54 of file TSQuaternion.cs.

Member Function Documentation

static TSQuaternion TrueSync.TSQuaternion.Add ( TSQuaternion  quaternion1,
TSQuaternion  quaternion2 
)
static

Quaternions are added.

Parameters
quaternion1The first quaternion.
quaternion2The second quaternion.
Returns
The sum of both quaternions.

Definition at line 116 of file TSQuaternion.cs.

static void TrueSync.TSQuaternion.Add ( ref TSQuaternion  quaternion1,
ref TSQuaternion  quaternion2,
out TSQuaternion  result 
)
static

Quaternions are added.

Parameters
quaternion1The first quaternion.
quaternion2The second quaternion.
resultThe sum of both quaternions.

Definition at line 178 of file TSQuaternion.cs.

static TSQuaternion TrueSync.TSQuaternion.CreateFromMatrix ( TSMatrix  matrix)
static

Creates a quaternion from a matrix.

Parameters
matrixA matrix representing an orientation.
Returns
JQuaternion representing an orientation.

Definition at line 348 of file TSQuaternion.cs.

static void TrueSync.TSQuaternion.CreateFromMatrix ( ref TSMatrix  matrix,
out TSQuaternion  result 
)
static

Creates a quaternion from a matrix.

Parameters
matrixA matrix representing an orientation.
resultJQuaternion representing an orientation.

Definition at line 360 of file TSQuaternion.cs.

static TSQuaternion TrueSync.TSQuaternion.Multiply ( TSQuaternion  quaternion1,
TSQuaternion  quaternion2 
)
static

Multiply two quaternions.

Parameters
quaternion1The first quaternion.
quaternion2The second quaternion.
Returns
The product of both quaternions.

Definition at line 264 of file TSQuaternion.cs.

static void TrueSync.TSQuaternion.Multiply ( ref TSQuaternion  quaternion1,
ref TSQuaternion  quaternion2,
out TSQuaternion  result 
)
static

Multiply two quaternions.

Parameters
quaternion1The first quaternion.
quaternion2The second quaternion.
resultThe product of both quaternions.

Definition at line 277 of file TSQuaternion.cs.

static TSQuaternion TrueSync.TSQuaternion.Multiply ( TSQuaternion  quaternion1,
FP  scaleFactor 
)
static

Scale a quaternion

Parameters
quaternion1The quaternion to scale.
scaleFactorScale factor.
Returns
The scaled quaternion.

Definition at line 305 of file TSQuaternion.cs.

static void TrueSync.TSQuaternion.Multiply ( ref TSQuaternion  quaternion1,
FP  scaleFactor,
out TSQuaternion  result 
)
static

Scale a quaternion

Parameters
quaternion1The quaternion to scale.
scaleFactorScale factor.
resultThe scaled quaternion.

Definition at line 318 of file TSQuaternion.cs.

void TrueSync.TSQuaternion.Normalize ( )

Sets the length of the quaternion to one.

Definition at line 331 of file TSQuaternion.cs.

static TSQuaternion TrueSync.TSQuaternion.operator* ( TSQuaternion  value1,
TSQuaternion  value2 
)
static

Multiply two quaternions.

Parameters
value1The first quaternion.
value2The second quaternion.
Returns
The product of both quaternions.

Definition at line 409 of file TSQuaternion.cs.

static TSQuaternion TrueSync.TSQuaternion.operator+ ( TSQuaternion  value1,
TSQuaternion  value2 
)
static

Add two quaternions.

Parameters
value1The first quaternion.
value2The second quaternion.
Returns
The sum of both quaternions.

Definition at line 424 of file TSQuaternion.cs.

static TSQuaternion TrueSync.TSQuaternion.operator- ( TSQuaternion  value1,
TSQuaternion  value2 
)
static

Subtract two quaternions.

Parameters
value1The first quaternion.
value2The second quaternion.
Returns
The difference of both quaternions.

Definition at line 439 of file TSQuaternion.cs.

static TSQuaternion TrueSync.TSQuaternion.Subtract ( TSQuaternion  quaternion1,
TSQuaternion  quaternion2 
)
static

Quaternions are subtracted.

Parameters
quaternion1The first quaternion.
quaternion2The second quaternion.
Returns
The difference of both quaternions.

Definition at line 235 of file TSQuaternion.cs.

static void TrueSync.TSQuaternion.Subtract ( ref TSQuaternion  quaternion1,
ref TSQuaternion  quaternion2,
out TSQuaternion  result 
)
static

Quaternions are subtracted.

Parameters
quaternion1The first quaternion.
quaternion2The second quaternion.
resultThe difference of both quaternions.

Definition at line 248 of file TSQuaternion.cs.

Member Data Documentation

FP TrueSync.TSQuaternion.w

The W component of the quaternion.

Definition at line 39 of file TSQuaternion.cs.

FP TrueSync.TSQuaternion.x

The X component of the quaternion.

Definition at line 33 of file TSQuaternion.cs.

FP TrueSync.TSQuaternion.y

The Y component of the quaternion.

Definition at line 35 of file TSQuaternion.cs.

FP TrueSync.TSQuaternion.z

The Z component of the quaternion.

Definition at line 37 of file TSQuaternion.cs.


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