C# Class BEPUutilities.Quaternion

Provides XNA-like quaternion support.
Afficher le fichier Open project: tonypeng/Bloxel Class Usage Examples

Méthodes publiques

Свойство Type Description
W float
X float
Y float
Z float

Méthodes publiques

Méthode Description
Add ( &a, &b, &result ) : void

Adds two quaternions together.

Concatenate ( a, b ) : Quaternion

Multiplies two quaternions together in opposite order.

Concatenate ( &a, &b, &result ) : void

Multiplies two quaternions together in opposite order.

Conjugate ( quaternion ) : Quaternion

Computes the conjugate of the quaternion.

Conjugate ( &quaternion, &result ) : void

Computes the conjugate of the quaternion.

CreateFromAxisAngle ( BEPUutilities.Vector3 axis, float angle ) : Quaternion

Creates a quaternion from an axis and angle.

CreateFromAxisAngle ( BEPUutilities.Vector3 &axis, float angle, &q ) : void

Creates a quaternion from an axis and angle.

CreateFromRotationMatrix ( BEPUutilities.Matrix r ) : Quaternion

Creates a quaternion from a rotation matrix.

CreateFromRotationMatrix ( Matrix3x3 r ) : Quaternion

Creates a quaternion from a rotation matrix.

CreateFromRotationMatrix ( BEPUutilities.Matrix &r, &q ) : void

Constructs a quaternion from a rotation matrix.

CreateFromRotationMatrix ( Matrix3x3 &r, &q ) : void

Constructs a quaternion from a rotation matrix.

CreateFromYawPitchRoll ( float yaw, float pitch, float roll ) : Quaternion

Constructs a quaternion from yaw, pitch, and roll.

CreateFromYawPitchRoll ( float yaw, float pitch, float roll, &q ) : void

Constructs a quaternion from yaw, pitch, and roll.

Equals ( other ) : bool

Indicates whether the current object is equal to another object of the same type.

Equals ( object obj ) : bool

Indicates whether this instance and a specified object are equal.

GetAngleFromQuaternion ( &q ) : float

Computes the angle change represented by a normalized quaternion.

GetAxisAngleFromQuaternion ( &q, BEPUutilities.Vector3 &axis, float &angle ) : void

Computes the axis angle representation of a normalized quaternion.

GetHashCode ( ) : int

Returns the hash code for this instance.

GetLocalRotation ( &rotation, &targetBasis, &localRotation ) : void

Transforms the rotation into the local space of the target basis such that rotation = Quaternion.Concatenate(localRotation, targetBasis)

GetQuaternionBetweenNormalizedVectors ( BEPUutilities.Vector3 &v1, BEPUutilities.Vector3 &v2, &q ) : void

Computes the quaternion rotation between two normalized vectors.

GetRelativeRotation ( &start, &end, &relative ) : void

Computes the rotation from the start orientation to the end orientation such that end = Quaternion.Concatenate(start, relative).

Inverse ( quaternion ) : Quaternion

Computes the inverse of the quaternion.

Inverse ( &quaternion, &result ) : void

Computes the inverse of the quaternion.

Length ( ) : float

Computes the length of the quaternion.

LengthSquared ( ) : float

Computes the squared length of the quaternion.

Multiply ( &a, &b, &result ) : void

Multiplies two quaternions.

Multiply ( &q, float scale, &result ) : void

Scales a quaternion.

Normalize ( quaternion ) : Quaternion

Ensures the quaternion has unit length.

Normalize ( ) : void

Scales the quaternion such that it has unit length.

Normalize ( &quaternion, &toReturn ) : void

Ensures the quaternion has unit length.

Quaternion ( float x, float y, float z, float w ) : System

Constructs a new Quaternion.

Slerp ( start, end, float interpolationAmount ) : Quaternion

Blends two quaternions together to get an intermediate state.

Slerp ( &start, &end, float interpolationAmount, &result ) : void

Blends two quaternions together to get an intermediate state.

Transform ( Vector3 v, rotation ) : Vector3

Transforms the vector using a quaternion.

Transform ( Vector3 &v, &rotation, Vector3 &result ) : void

Transforms the vector using a quaternion.

TransformX ( float x, &rotation, Vector3 &result ) : void

Transforms a vector using a quaternion. Specialized for x,0,0 vectors.

TransformY ( float y, &rotation, Vector3 &result ) : void

Transforms a vector using a quaternion. Specialized for 0,y,0 vectors.

TransformZ ( float z, &rotation, Vector3 &result ) : void

Transforms a vector using a quaternion. Specialized for 0,0,z vectors.

operator ( ) : Quaternion

Multiplies two quaternions.

operator ( ) : bool

Tests components for equality.

Method Details

Add() public static méthode

Adds two quaternions together.
public static Add ( &a, &b, &result ) : void
a First quaternion to add.
b Second quaternion to add.
result Sum of the addition.
Résultat void

Concatenate() public static méthode

Multiplies two quaternions together in opposite order.
public static Concatenate ( a, b ) : Quaternion
a First quaternion to multiply.
b Second quaternion to multiply.
Résultat Quaternion

Concatenate() public static méthode

Multiplies two quaternions together in opposite order.
public static Concatenate ( &a, &b, &result ) : void
a First quaternion to multiply.
b Second quaternion to multiply.
result Product of the multiplication.
Résultat void

Conjugate() public static méthode

Computes the conjugate of the quaternion.
public static Conjugate ( quaternion ) : Quaternion
quaternion Quaternion to conjugate.
Résultat Quaternion

Conjugate() public static méthode

Computes the conjugate of the quaternion.
public static Conjugate ( &quaternion, &result ) : void
quaternion Quaternion to conjugate.
result Conjugated quaternion.
Résultat void

CreateFromAxisAngle() public static méthode

Creates a quaternion from an axis and angle.
public static CreateFromAxisAngle ( BEPUutilities.Vector3 axis, float angle ) : Quaternion
axis BEPUutilities.Vector3 Axis of rotation.
angle float Angle to rotate around the axis.
Résultat Quaternion

CreateFromAxisAngle() public static méthode

Creates a quaternion from an axis and angle.
public static CreateFromAxisAngle ( BEPUutilities.Vector3 &axis, float angle, &q ) : void
axis BEPUutilities.Vector3 Axis of rotation.
angle float Angle to rotate around the axis.
q Quaternion representing the axis and angle rotation.
Résultat void

CreateFromRotationMatrix() public static méthode

Creates a quaternion from a rotation matrix.
public static CreateFromRotationMatrix ( BEPUutilities.Matrix r ) : Quaternion
r BEPUutilities.Matrix Rotation matrix used to create a new quaternion.
Résultat Quaternion

CreateFromRotationMatrix() public static méthode

Creates a quaternion from a rotation matrix.
public static CreateFromRotationMatrix ( Matrix3x3 r ) : Quaternion
r Matrix3x3 Rotation matrix used to create a new quaternion.
Résultat Quaternion

CreateFromRotationMatrix() public static méthode

Constructs a quaternion from a rotation matrix.
public static CreateFromRotationMatrix ( BEPUutilities.Matrix &r, &q ) : void
r BEPUutilities.Matrix Rotation matrix to create the quaternion from.
q Quaternion based on the rotation matrix.
Résultat void

CreateFromRotationMatrix() public static méthode

Constructs a quaternion from a rotation matrix.
public static CreateFromRotationMatrix ( Matrix3x3 &r, &q ) : void
r Matrix3x3 Rotation matrix to create the quaternion from.
q Quaternion based on the rotation matrix.
Résultat void

CreateFromYawPitchRoll() public static méthode

Constructs a quaternion from yaw, pitch, and roll.
public static CreateFromYawPitchRoll ( float yaw, float pitch, float roll ) : Quaternion
yaw float Yaw of the rotation.
pitch float Pitch of the rotation.
roll float Roll of the rotation.
Résultat Quaternion

CreateFromYawPitchRoll() public static méthode

Constructs a quaternion from yaw, pitch, and roll.
public static CreateFromYawPitchRoll ( float yaw, float pitch, float roll, &q ) : void
yaw float Yaw of the rotation.
pitch float Pitch of the rotation.
roll float Roll of the rotation.
q Quaternion representing the yaw, pitch, and roll.
Résultat void

Equals() public méthode

Indicates whether the current object is equal to another object of the same type.
public Equals ( other ) : bool
other An object to compare with this object.
Résultat bool

Equals() public méthode

Indicates whether this instance and a specified object are equal.
public Equals ( object obj ) : bool
obj object Another object to compare to.
Résultat bool

GetAngleFromQuaternion() public static méthode

Computes the angle change represented by a normalized quaternion.
public static GetAngleFromQuaternion ( &q ) : float
q Quaternion to be converted.
Résultat float

GetAxisAngleFromQuaternion() public static méthode

Computes the axis angle representation of a normalized quaternion.
public static GetAxisAngleFromQuaternion ( &q, BEPUutilities.Vector3 &axis, float &angle ) : void
q Quaternion to be converted.
axis BEPUutilities.Vector3 Axis represented by the quaternion.
angle float Angle around the axis represented by the quaternion.
Résultat void

GetHashCode() public méthode

Returns the hash code for this instance.
public GetHashCode ( ) : int
Résultat int

GetLocalRotation() public static méthode

Transforms the rotation into the local space of the target basis such that rotation = Quaternion.Concatenate(localRotation, targetBasis)
public static GetLocalRotation ( &rotation, &targetBasis, &localRotation ) : void
rotation Rotation in the original frame of reference.
targetBasis Basis in the original frame of reference to transform the rotation into.
localRotation Rotation in the local space of the target basis.
Résultat void

GetQuaternionBetweenNormalizedVectors() public static méthode

Computes the quaternion rotation between two normalized vectors.
public static GetQuaternionBetweenNormalizedVectors ( BEPUutilities.Vector3 &v1, BEPUutilities.Vector3 &v2, &q ) : void
v1 BEPUutilities.Vector3 First unit-length vector.
v2 BEPUutilities.Vector3 Second unit-length vector.
q Quaternion representing the rotation from v1 to v2.
Résultat void

GetRelativeRotation() public static méthode

Computes the rotation from the start orientation to the end orientation such that end = Quaternion.Concatenate(start, relative).
public static GetRelativeRotation ( &start, &end, &relative ) : void
start Starting orientation.
end Ending orientation.
relative Relative rotation from the start to the end orientation.
Résultat void

Inverse() public static méthode

Computes the inverse of the quaternion.
public static Inverse ( quaternion ) : Quaternion
quaternion Quaternion to invert.
Résultat Quaternion

Inverse() public static méthode

Computes the inverse of the quaternion.
public static Inverse ( &quaternion, &result ) : void
quaternion Quaternion to invert.
result Result of the inversion.
Résultat void

Length() public méthode

Computes the length of the quaternion.
public Length ( ) : float
Résultat float

LengthSquared() public méthode

Computes the squared length of the quaternion.
public LengthSquared ( ) : float
Résultat float

Multiply() public static méthode

Multiplies two quaternions.
public static Multiply ( &a, &b, &result ) : void
a First quaternion to multiply.
b Second quaternion to multiply.
result Product of the multiplication.
Résultat void

Multiply() public static méthode

Scales a quaternion.
public static Multiply ( &q, float scale, &result ) : void
q Quaternion to multiply.
scale float Amount to multiply each component of the quaternion by.
result Scaled quaternion.
Résultat void

Normalize() public static méthode

Ensures the quaternion has unit length.
public static Normalize ( quaternion ) : Quaternion
quaternion Quaternion to normalize.
Résultat Quaternion

Normalize() public méthode

Scales the quaternion such that it has unit length.
public Normalize ( ) : void
Résultat void

Normalize() public static méthode

Ensures the quaternion has unit length.
public static Normalize ( &quaternion, &toReturn ) : void
quaternion Quaternion to normalize.
toReturn Normalized quaternion.
Résultat void

Quaternion() public méthode

Constructs a new Quaternion.
public Quaternion ( float x, float y, float z, float w ) : System
x float X component of the quaternion.
y float Y component of the quaternion.
z float Z component of the quaternion.
w float W component of the quaternion.
Résultat System

Slerp() public static méthode

Blends two quaternions together to get an intermediate state.
public static Slerp ( start, end, float interpolationAmount ) : Quaternion
start Starting point of the interpolation.
end Ending point of the interpolation.
interpolationAmount float Amount of the end point to use.
Résultat Quaternion

Slerp() public static méthode

Blends two quaternions together to get an intermediate state.
public static Slerp ( &start, &end, float interpolationAmount, &result ) : void
start Starting point of the interpolation.
end Ending point of the interpolation.
interpolationAmount float Amount of the end point to use.
result Interpolated intermediate quaternion.
Résultat void

Transform() public static méthode

Transforms the vector using a quaternion.
public static Transform ( Vector3 v, rotation ) : Vector3
v Vector3 Vector to transform.
rotation Rotation to apply to the vector.
Résultat Vector3

Transform() public static méthode

Transforms the vector using a quaternion.
public static Transform ( Vector3 &v, &rotation, Vector3 &result ) : void
v Vector3 Vector to transform.
rotation Rotation to apply to the vector.
result Vector3 Transformed vector.
Résultat void

TransformX() public static méthode

Transforms a vector using a quaternion. Specialized for x,0,0 vectors.
public static TransformX ( float x, &rotation, Vector3 &result ) : void
x float X component of the vector to transform.
rotation Rotation to apply to the vector.
result Vector3 Transformed vector.
Résultat void

TransformY() public static méthode

Transforms a vector using a quaternion. Specialized for 0,y,0 vectors.
public static TransformY ( float y, &rotation, Vector3 &result ) : void
y float Y component of the vector to transform.
rotation Rotation to apply to the vector.
result Vector3 Transformed vector.
Résultat void

TransformZ() public static méthode

Transforms a vector using a quaternion. Specialized for 0,0,z vectors.
public static TransformZ ( float z, &rotation, Vector3 &result ) : void
z float Z component of the vector to transform.
rotation Rotation to apply to the vector.
result Vector3 Transformed vector.
Résultat void

operator() public static méthode

Multiplies two quaternions.
public static operator ( ) : Quaternion
Résultat Quaternion

operator() public static méthode

Tests components for equality.
public static operator ( ) : bool
Résultat bool

Property Details

W public_oe property

W component of the quaternion.
public float W
Résultat float

X public_oe property

X component of the quaternion.
public float X
Résultat float

Y public_oe property

Y component of the quaternion.
public float Y
Résultat float

Z public_oe property

Z component of the quaternion.
public float Z
Résultat float