C# Класс BEPUutilities.Quaternion

Provides XNA-like quaternion support.
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
W float
X float
Y float
Z float

Открытые методы

Метод Описание
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.

Описание методов

Add() публичный статический Метод

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.
Результат void

Concatenate() публичный статический Метод

Multiplies two quaternions together in opposite order.
public static Concatenate ( a, b ) : Quaternion
a First quaternion to multiply.
b Second quaternion to multiply.
Результат Quaternion

Concatenate() публичный статический Метод

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.
Результат void

Conjugate() публичный статический Метод

Computes the conjugate of the quaternion.
public static Conjugate ( quaternion ) : Quaternion
quaternion Quaternion to conjugate.
Результат Quaternion

Conjugate() публичный статический Метод

Computes the conjugate of the quaternion.
public static Conjugate ( &quaternion, &result ) : void
quaternion Quaternion to conjugate.
result Conjugated quaternion.
Результат void

CreateFromAxisAngle() публичный статический Метод

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.
Результат Quaternion

CreateFromAxisAngle() публичный статический Метод

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.
Результат void

CreateFromRotationMatrix() публичный статический Метод

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.
Результат Quaternion

CreateFromRotationMatrix() публичный статический Метод

Creates a quaternion from a rotation matrix.
public static CreateFromRotationMatrix ( Matrix3x3 r ) : Quaternion
r Matrix3x3 Rotation matrix used to create a new quaternion.
Результат Quaternion

CreateFromRotationMatrix() публичный статический Метод

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.
Результат void

CreateFromRotationMatrix() публичный статический Метод

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.
Результат void

CreateFromYawPitchRoll() публичный статический Метод

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.
Результат Quaternion

CreateFromYawPitchRoll() публичный статический Метод

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.
Результат void

Equals() публичный Метод

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.
Результат bool

Equals() публичный Метод

Indicates whether this instance and a specified object are equal.
public Equals ( object obj ) : bool
obj object Another object to compare to.
Результат bool

GetAngleFromQuaternion() публичный статический Метод

Computes the angle change represented by a normalized quaternion.
public static GetAngleFromQuaternion ( &q ) : float
q Quaternion to be converted.
Результат float

GetAxisAngleFromQuaternion() публичный статический Метод

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.
Результат void

GetHashCode() публичный Метод

Returns the hash code for this instance.
public GetHashCode ( ) : int
Результат int

GetLocalRotation() публичный статический Метод

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.
Результат void

GetQuaternionBetweenNormalizedVectors() публичный статический Метод

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.
Результат void

GetRelativeRotation() публичный статический Метод

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.
Результат void

Inverse() публичный статический Метод

Computes the inverse of the quaternion.
public static Inverse ( quaternion ) : Quaternion
quaternion Quaternion to invert.
Результат Quaternion

Inverse() публичный статический Метод

Computes the inverse of the quaternion.
public static Inverse ( &quaternion, &result ) : void
quaternion Quaternion to invert.
result Result of the inversion.
Результат void

Length() публичный Метод

Computes the length of the quaternion.
public Length ( ) : float
Результат float

LengthSquared() публичный Метод

Computes the squared length of the quaternion.
public LengthSquared ( ) : float
Результат float

Multiply() публичный статический Метод

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.
Результат void

Multiply() публичный статический Метод

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.
Результат void

Normalize() публичный статический Метод

Ensures the quaternion has unit length.
public static Normalize ( quaternion ) : Quaternion
quaternion Quaternion to normalize.
Результат Quaternion

Normalize() публичный Метод

Scales the quaternion such that it has unit length.
public Normalize ( ) : void
Результат void

Normalize() публичный статический Метод

Ensures the quaternion has unit length.
public static Normalize ( &quaternion, &toReturn ) : void
quaternion Quaternion to normalize.
toReturn Normalized quaternion.
Результат void

Quaternion() публичный Метод

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.
Результат System

Slerp() публичный статический Метод

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.
Результат Quaternion

Slerp() публичный статический Метод

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.
Результат void

Transform() публичный статический Метод

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.
Результат Vector3

Transform() публичный статический Метод

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.
Результат void

TransformX() публичный статический Метод

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.
Результат void

TransformY() публичный статический Метод

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.
Результат void

TransformZ() публичный статический Метод

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.
Результат void

operator() публичный статический Метод

Multiplies two quaternions.
public static operator ( ) : Quaternion
Результат Quaternion

operator() публичный статический Метод

Tests components for equality.
public static operator ( ) : bool
Результат bool

Описание свойств

W публичное свойство

W component of the quaternion.
public float W
Результат float

X публичное свойство

X component of the quaternion.
public float X
Результат float

Y публичное свойство

Y component of the quaternion.
public float Y
Результат float

Z публичное свойство

Z component of the quaternion.
public float Z
Результат float