The Open Toolkit library  1.1
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties Events
Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Properties | List of all members
OpenTK.Quaterniond Struct Reference

Represents a double-precision Quaternion. More...

Inherits IEquatable< Quaterniond >.

Public Member Functions

 Quaterniond (Vector3d v, double w)
 Construct a new Quaterniond from vector and w components More...
 
 Quaterniond (double x, double y, double z, double w)
 Construct a new Quaterniond More...
 
void ToAxisAngle (out Vector3d axis, out double angle)
 Convert the current quaternion to axis angle representation More...
 
Vector4d ToAxisAngle ()
 Convert this instance to an axis-angle representation. More...
 
Quaterniond Normalized ()
 Returns a copy of the Quaterniond scaled to unit length. More...
 
void Invert ()
 Reverses the rotation angle of this Quaterniond. More...
 
Quaterniond Inverted ()
 Returns a copy of this Quaterniond with its rotation angle reversed. More...
 
void Normalize ()
 Scales the Quaterniond to unit length. More...
 
void Conjugate ()
 Inverts the Vector3d component of this Quaterniond. More...
 
override string ToString ()
 Returns a System.String that represents the current Quaterniond. More...
 
override bool Equals (object other)
 Compares this object instance to another object for equality. More...
 
override int GetHashCode ()
 Provides the hash code for this object. More...
 
bool Equals (Quaterniond other)
 Compares this Quaterniond instance to another Quaterniond for equality. More...
 

Static Public Member Functions

static Quaterniond Add (Quaterniond left, Quaterniond right)
 Add two quaternions More...
 
static void Add (ref Quaterniond left, ref Quaterniond right, out Quaterniond result)
 Add two quaternions More...
 
static Quaterniond Sub (Quaterniond left, Quaterniond right)
 Subtracts two instances. More...
 
static void Sub (ref Quaterniond left, ref Quaterniond right, out Quaterniond result)
 Subtracts two instances. More...
 
static Quaterniond Mult (Quaterniond left, Quaterniond right)
 Multiplies two instances. More...
 
static void Mult (ref Quaterniond left, ref Quaterniond right, out Quaterniond result)
 Multiplies two instances. More...
 
static Quaterniond Multiply (Quaterniond left, Quaterniond right)
 Multiplies two instances. More...
 
static void Multiply (ref Quaterniond left, ref Quaterniond right, out Quaterniond result)
 Multiplies two instances. More...
 
static void Multiply (ref Quaterniond quaternion, double scale, out Quaterniond result)
 Multiplies an instance by a scalar. More...
 
static Quaterniond Multiply (Quaterniond quaternion, double scale)
 Multiplies an instance by a scalar. More...
 
static Quaterniond Conjugate (Quaterniond q)
 Get the conjugate of the given Quaterniond More...
 
static void Conjugate (ref Quaterniond q, out Quaterniond result)
 Get the conjugate of the given Quaterniond More...
 
static Quaterniond Invert (Quaterniond q)
 Get the inverse of the given Quaterniond More...
 
static void Invert (ref Quaterniond q, out Quaterniond result)
 Get the inverse of the given Quaterniond More...
 
static Quaterniond Normalize (Quaterniond q)
 Scale the given Quaterniond to unit length More...
 
static void Normalize (ref Quaterniond q, out Quaterniond result)
 Scale the given Quaterniond to unit length More...
 
static Quaterniond FromAxisAngle (Vector3d axis, double angle)
 Build a Quaterniond from the given axis and angle More...
 
static Quaterniond FromMatrix (Matrix3d matrix)
 Builds a quaternion from the given rotation matrix More...
 
static void FromMatrix (ref Matrix3d matrix, out Quaterniond result)
 Builds a quaternion from the given rotation matrix More...
 
static Quaterniond Slerp (Quaterniond q1, Quaterniond q2, double blend)
 Do Spherical linear interpolation between two quaternions More...
 
static Quaterniond operator+ (Quaterniond left, Quaterniond right)
 Adds two instances. More...
 
static Quaterniond operator- (Quaterniond left, Quaterniond right)
 Subtracts two instances. More...
 
static Quaterniond operator* (Quaterniond left, Quaterniond right)
 Multiplies two instances. More...
 
static Quaterniond operator* (Quaterniond quaternion, double scale)
 Multiplies an instance by a scalar. More...
 
static Quaterniond operator* (double scale, Quaterniond quaternion)
 Multiplies an instance by a scalar. More...
 
static bool operator== (Quaterniond left, Quaterniond right)
 Compares two instances for equality. More...
 
static bool operator!= (Quaterniond left, Quaterniond right)
 Compares two instances for inequality. More...
 

Public Attributes

Vector3d xyz
 
double w
 

Static Public Attributes

static readonly Quaterniond Identity = new Quaterniond(0, 0, 0, 1)
 Defines the identity quaternion. More...
 

Properties

Vector3d XYZ [get, set]
 Gets or sets an OpenTK.Vector3d with the X, Y and Z components of this instance. More...
 
Vector3d Xyz [get, set]
 Gets or sets an OpenTK.Vector3d with the X, Y and Z components of this instance. More...
 
double X [get, set]
 Gets or sets the X component of this instance. More...
 
double Y [get, set]
 Gets or sets the Y component of this instance. More...
 
double Z [get, set]
 Gets or sets the Z component of this instance. More...
 
double W [get, set]
 Gets or sets the W component of this instance. More...
 
double Length [get]
 Gets the length (magnitude) of the Quaterniond. More...
 
double LengthSquared [get]
 Gets the square of the Quaterniond length (magnitude). More...
 

Detailed Description

Represents a double-precision Quaternion.

Constructor & Destructor Documentation

OpenTK.Quaterniond.Quaterniond ( Vector3d  v,
double  w 
)

Construct a new Quaterniond from vector and w components

Parameters
vThe vector part
wThe w part
OpenTK.Quaterniond.Quaterniond ( double  x,
double  y,
double  z,
double  w 
)

Construct a new Quaterniond

Parameters
xThe x component
yThe y component
zThe z component
wThe w component

Member Function Documentation

static Quaterniond OpenTK.Quaterniond.Add ( Quaterniond  left,
Quaterniond  right 
)
static

Add two quaternions

Parameters
leftThe first operand
rightThe second operand
Returns
The result of the addition
static void OpenTK.Quaterniond.Add ( ref Quaterniond  left,
ref Quaterniond  right,
out Quaterniond  result 
)
static

Add two quaternions

Parameters
leftThe first operand
rightThe second operand
resultThe result of the addition
void OpenTK.Quaterniond.Conjugate ( )

Inverts the Vector3d component of this Quaterniond.

static Quaterniond OpenTK.Quaterniond.Conjugate ( Quaterniond  q)
static

Get the conjugate of the given Quaterniond

Parameters
qThe Quaterniond
Returns
The conjugate of the given Quaterniond
static void OpenTK.Quaterniond.Conjugate ( ref Quaterniond  q,
out Quaterniond  result 
)
static

Get the conjugate of the given Quaterniond

Parameters
qThe Quaterniond
resultThe conjugate of the given Quaterniond
override bool OpenTK.Quaterniond.Equals ( object  other)

Compares this object instance to another object for equality.

Parameters
otherThe other object to be used in the comparison.
Returns
True if both objects are Quaternions of equal value. Otherwise it returns false.
bool OpenTK.Quaterniond.Equals ( Quaterniond  other)

Compares this Quaterniond instance to another Quaterniond for equality.

Parameters
otherThe other Quaterniond to be used in the comparison.
Returns
True if both instances are equal; false otherwise.
static Quaterniond OpenTK.Quaterniond.FromAxisAngle ( Vector3d  axis,
double  angle 
)
static

Build a Quaterniond from the given axis and angle

Parameters
axisThe axis to rotate about
angleThe rotation angle in radians
Returns
static Quaterniond OpenTK.Quaterniond.FromMatrix ( Matrix3d  matrix)
static

Builds a quaternion from the given rotation matrix

Parameters
matrixA rotation matrix
Returns
The equivalent quaternion
static void OpenTK.Quaterniond.FromMatrix ( ref Matrix3d  matrix,
out Quaterniond  result 
)
static

Builds a quaternion from the given rotation matrix

Parameters
matrixA rotation matrix
resultThe equivalent quaternion
override int OpenTK.Quaterniond.GetHashCode ( )

Provides the hash code for this object.

Returns
A hash code formed from the bitwise XOR of this objects members.
void OpenTK.Quaterniond.Invert ( )

Reverses the rotation angle of this Quaterniond.

static Quaterniond OpenTK.Quaterniond.Invert ( Quaterniond  q)
static

Get the inverse of the given Quaterniond

Parameters
qThe Quaterniond to invert
Returns
The inverse of the given Quaterniond
static void OpenTK.Quaterniond.Invert ( ref Quaterniond  q,
out Quaterniond  result 
)
static

Get the inverse of the given Quaterniond

Parameters
qThe Quaterniond to invert
resultThe inverse of the given Quaterniond
Quaterniond OpenTK.Quaterniond.Inverted ( )

Returns a copy of this Quaterniond with its rotation angle reversed.

static Quaterniond OpenTK.Quaterniond.Mult ( Quaterniond  left,
Quaterniond  right 
)
static

Multiplies two instances.

Parameters
leftThe first instance.
rightThe second instance.
Returns
A new instance containing the result of the calculation.
static void OpenTK.Quaterniond.Mult ( ref Quaterniond  left,
ref Quaterniond  right,
out Quaterniond  result 
)
static

Multiplies two instances.

Parameters
leftThe first instance.
rightThe second instance.
resultA new instance containing the result of the calculation.
static Quaterniond OpenTK.Quaterniond.Multiply ( Quaterniond  left,
Quaterniond  right 
)
static

Multiplies two instances.

Parameters
leftThe first instance.
rightThe second instance.
Returns
A new instance containing the result of the calculation.
static void OpenTK.Quaterniond.Multiply ( ref Quaterniond  left,
ref Quaterniond  right,
out Quaterniond  result 
)
static

Multiplies two instances.

Parameters
leftThe first instance.
rightThe second instance.
resultA new instance containing the result of the calculation.
static void OpenTK.Quaterniond.Multiply ( ref Quaterniond  quaternion,
double  scale,
out Quaterniond  result 
)
static

Multiplies an instance by a scalar.

Parameters
quaternionThe instance.
scaleThe scalar.
resultA new instance containing the result of the calculation.
static Quaterniond OpenTK.Quaterniond.Multiply ( Quaterniond  quaternion,
double  scale 
)
static

Multiplies an instance by a scalar.

Parameters
quaternionThe instance.
scaleThe scalar.
Returns
A new instance containing the result of the calculation.
void OpenTK.Quaterniond.Normalize ( )

Scales the Quaterniond to unit length.

static Quaterniond OpenTK.Quaterniond.Normalize ( Quaterniond  q)
static

Scale the given Quaterniond to unit length

Parameters
qThe Quaterniond to normalize
Returns
The normalized Quaterniond
static void OpenTK.Quaterniond.Normalize ( ref Quaterniond  q,
out Quaterniond  result 
)
static

Scale the given Quaterniond to unit length

Parameters
qThe Quaterniond to normalize
resultThe normalized Quaterniond
Quaterniond OpenTK.Quaterniond.Normalized ( )

Returns a copy of the Quaterniond scaled to unit length.

static bool OpenTK.Quaterniond.operator!= ( Quaterniond  left,
Quaterniond  right 
)
static

Compares two instances for inequality.

Parameters
leftThe first instance.
rightThe second instance.
Returns
True, if left does not equal right; false otherwise.
static Quaterniond OpenTK.Quaterniond.operator* ( Quaterniond  left,
Quaterniond  right 
)
static

Multiplies two instances.

Parameters
leftThe first instance.
rightThe second instance.
Returns
The result of the calculation.
static Quaterniond OpenTK.Quaterniond.operator* ( Quaterniond  quaternion,
double  scale 
)
static

Multiplies an instance by a scalar.

Parameters
quaternionThe instance.
scaleThe scalar.
Returns
A new instance containing the result of the calculation.
static Quaterniond OpenTK.Quaterniond.operator* ( double  scale,
Quaterniond  quaternion 
)
static

Multiplies an instance by a scalar.

Parameters
quaternionThe instance.
scaleThe scalar.
Returns
A new instance containing the result of the calculation.
static Quaterniond OpenTK.Quaterniond.operator+ ( Quaterniond  left,
Quaterniond  right 
)
static

Adds two instances.

Parameters
leftThe first instance.
rightThe second instance.
Returns
The result of the calculation.
static Quaterniond OpenTK.Quaterniond.operator- ( Quaterniond  left,
Quaterniond  right 
)
static

Subtracts two instances.

Parameters
leftThe first instance.
rightThe second instance.
Returns
The result of the calculation.
static bool OpenTK.Quaterniond.operator== ( Quaterniond  left,
Quaterniond  right 
)
static

Compares two instances for equality.

Parameters
leftThe first instance.
rightThe second instance.
Returns
True, if left equals right; false otherwise.
static Quaterniond OpenTK.Quaterniond.Slerp ( Quaterniond  q1,
Quaterniond  q2,
double  blend 
)
static

Do Spherical linear interpolation between two quaternions

Parameters
q1The first Quaterniond
q2The second Quaterniond
blendThe blend factor
Returns
A smooth blend between the given quaternions
static Quaterniond OpenTK.Quaterniond.Sub ( Quaterniond  left,
Quaterniond  right 
)
static

Subtracts two instances.

Parameters
leftThe left instance.
rightThe right instance.
Returns
The result of the operation.
static void OpenTK.Quaterniond.Sub ( ref Quaterniond  left,
ref Quaterniond  right,
out Quaterniond  result 
)
static

Subtracts two instances.

Parameters
leftThe left instance.
rightThe right instance.
resultThe result of the operation.
void OpenTK.Quaterniond.ToAxisAngle ( out Vector3d  axis,
out double  angle 
)

Convert the current quaternion to axis angle representation

Parameters
axisThe resultant axis
angleThe resultant angle
Vector4d OpenTK.Quaterniond.ToAxisAngle ( )

Convert this instance to an axis-angle representation.

Returns
A Vector4 that is the axis-angle representation of this quaternion.
override string OpenTK.Quaterniond.ToString ( )

Returns a System.String that represents the current Quaterniond.

Returns

Member Data Documentation

readonly Quaterniond OpenTK.Quaterniond.Identity = new Quaterniond(0, 0, 0, 1)
static

Defines the identity quaternion.

Property Documentation

double OpenTK.Quaterniond.Length
get

Gets the length (magnitude) of the Quaterniond.

See Also
LengthSquared
double OpenTK.Quaterniond.LengthSquared
get

Gets the square of the Quaterniond length (magnitude).

double OpenTK.Quaterniond.W
getset

Gets or sets the W component of this instance.

double OpenTK.Quaterniond.X
getset

Gets or sets the X component of this instance.

Vector3d OpenTK.Quaterniond.XYZ
getset

Gets or sets an OpenTK.Vector3d with the X, Y and Z components of this instance.

Vector3d OpenTK.Quaterniond.Xyz
getset

Gets or sets an OpenTK.Vector3d with the X, Y and Z components of this instance.

double OpenTK.Quaterniond.Y
getset

Gets or sets the Y component of this instance.

double OpenTK.Quaterniond.Z
getset

Gets or sets the Z component of this instance.