d3dx9math.h 의 내용

 

//--------------------------

// Quaternion

//--------------------------

 

// inline

 

FLOAT D3DXQuaternionLength

( CONST D3DXQUATERNION *pQ );

 

// Length squared, or "norm"

FLOAT D3DXQuaternionLengthSq

( CONST D3DXQUATERNION *pQ );

 

FLOAT D3DXQuaternionDot

( CONST D3DXQUATERNION *pQ1, CONST D3DXQUATERNION *pQ2 );

 

// (0, 0, 0, 1)

D3DXQUATERNION* D3DXQuaternionIdentity

( D3DXQUATERNION *pOut );

 

BOOL D3DXQuaternionIsIdentity

( CONST D3DXQUATERNION *pQ );

 

// (-x, -y, -z, w)

D3DXQUATERNION* D3DXQuaternionConjugate

( D3DXQUATERNION *pOut, CONST D3DXQUATERNION *pQ );

 

 

// non-inline

#ifdef __cplusplus

extern "C" {

#endif

 

// Compute a quaternin's axis and angle of rotation. Expects unit quaternions.

void WINAPI D3DXQuaternionToAxisAngle

( CONST D3DXQUATERNION *pQ, D3DXVECTOR3 *pAxis, FLOAT *pAngle );

 

// Build a quaternion from a rotation matrix.

D3DXQUATERNION* WINAPI D3DXQuaternionRotationMatrix

( D3DXQUATERNION *pOut, CONST D3DXMATRIX *pM);

 

// Rotation about arbitrary axis.

D3DXQUATERNION* WINAPI D3DXQuaternionRotationAxis

( D3DXQUATERNION *pOut, CONST D3DXVECTOR3 *pV, FLOAT Angle );

 

// Yaw around the Y axis, a pitch around the X axis,

// and a roll around the Z axis.

D3DXQUATERNION* WINAPI D3DXQuaternionRotationYawPitchRoll

( D3DXQUATERNION *pOut, FLOAT Yaw, FLOAT Pitch, FLOAT Roll );

 

// Quaternion multiplication. The result represents the rotation Q2

// followed by the rotation Q1. (Out = Q2 * Q1)

D3DXQUATERNION* WINAPI D3DXQuaternionMultiply

( D3DXQUATERNION *pOut, CONST D3DXQUATERNION *pQ1,

CONST D3DXQUATERNION *pQ2 );

 

D3DXQUATERNION* WINAPI D3DXQuaternionNormalize

( D3DXQUATERNION *pOut, CONST D3DXQUATERNION *pQ );

 

// Conjugate and re-norm

D3DXQUATERNION* WINAPI D3DXQuaternionInverse

( D3DXQUATERNION *pOut, CONST D3DXQUATERNION *pQ );

 

// Expects unit quaternions.

// if q = (cos(theta), sin(theta) * v); ln(q) = (0, theta * v)

D3DXQUATERNION* WINAPI D3DXQuaternionLn

( D3DXQUATERNION *pOut, CONST D3DXQUATERNION *pQ );

 

// Expects pure quaternions. (w == 0) w is ignored in calculation.

// if q = (0, theta * v); exp(q) = (cos(theta), sin(theta) * v)

D3DXQUATERNION* WINAPI D3DXQuaternionExp

( D3DXQUATERNION *pOut, CONST D3DXQUATERNION *pQ );

// Spherical linear interpolation between Q1 (t == 0) and Q2 (t == 1).

// Expects unit quaternions.

D3DXQUATERNION* WINAPI D3DXQuaternionSlerp

( D3DXQUATERNION *pOut, CONST D3DXQUATERNION *pQ1,

CONST D3DXQUATERNION *pQ2, FLOAT t );

 

// Spherical quadrangle interpolation.

// Slerp(Slerp(Q1, C, t), Slerp(A, B, t), 2t(1-t))

D3DXQUATERNION* WINAPI D3DXQuaternionSquad

( D3DXQUATERNION *pOut, CONST D3DXQUATERNION *pQ1,

CONST D3DXQUATERNION *pA, CONST D3DXQUATERNION *pB,

CONST D3DXQUATERNION *pC, FLOAT t );

 

// Setup control points for spherical quadrangle interpolation

// from Q1 to Q2. The control points are chosen in such a way

// to ensure the continuity of tangents with adjacent segments.

void WINAPI D3DXQuaternionSquadSetup

( D3DXQUATERNION *pAOut, D3DXQUATERNION *pBOut, D3DXQUATERNION *pCOut,

CONST D3DXQUATERNION *pQ0, CONST D3DXQUATERNION *pQ1,

CONST D3DXQUATERNION *pQ2, CONST D3DXQUATERNION *pQ3 );

 

// Barycentric interpolation.

// Slerp(Slerp(Q1, Q2, f+g), Slerp(Q1, Q3, f+g), g/(f+g))

D3DXQUATERNION* WINAPI D3DXQuaternionBaryCentric

( D3DXQUATERNION *pOut, CONST D3DXQUATERNION *pQ1,

CONST D3DXQUATERNION *pQ2, CONST D3DXQUATERNION *pQ3,

FLOAT f, FLOAT g );

 


반응형

+ Recent posts