00001 #ifndef __FBMATH_H__
00002 #define __FBMATH_H__
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00043 #include <kaydaradef.h>
00044 #ifndef FBSDK_DLL
00045
00048 #define FBSDK_DLL K_DLLIMPORT
00049 #endif
00050
00051 #include <fbsdk/fbtypes.h>
00052
00053 #ifdef FBSDKUseNamespace
00054 namespace FBSDKNamespace {
00055 #endif
00056
00058 enum FBRotationOrder {
00059 kFBXYZ,
00060 kFBXZY,
00061 kFBYXZ,
00062 kFBYZX,
00063 kFBZXY,
00064 kFBZYX,
00065 };
00066
00067 FB_DEFINE_ENUM( FBSDK_DLL, RotationOrder );
00068
00070
00072
00076 FBSDK_DLL void FBMatrixInverse (FBMatrix &pMatrix,FBMatrix &pSrc);
00077
00082 FBSDK_DLL void FBMatrixTranspose (FBMatrix &pMatrix,FBMatrix &pSrc);
00083
00089 FBSDK_DLL void FBMatrixMult (FBMatrix &pMatrix,FBMatrix &pA,FBMatrix &pB);
00090
00096 FBSDK_DLL void FBVertexMatrixMult( FBVertex &pOutVertex, FBMatrix &pMatrix, FBVertex &pVertex );
00097
00103 FBSDK_DLL void FBVectorMatrixMult( FBVector4d &pOutVector, FBMatrix &pMatrix, FBVector4d &pVector );
00104
00106
00108
00113 FBSDK_DLL void FBTranslationToMatrix (FBMatrix &pMatrix, FBTVector pVector);
00114
00120 FBSDK_DLL void FBRotationToMatrix (FBMatrix &pMatrix, FBRVector pVector, FBRotationOrder pRotationOrder = kFBXYZ);
00121
00126 FBSDK_DLL void FBScalingToMatrix (FBMatrix &pMatrix, FBSVector pVector);
00127
00135 FBSDK_DLL void FBTRSToMatrix (FBMatrix &pMatrix, FBTVector pTVector, FBRVector pRVector, FBSVector pSVector);
00136
00138
00140
00145 FBSDK_DLL void FBMatrixToTranslation (FBTVector &pVector, FBMatrix pMatrix);
00146
00153 FBSDK_DLL void FBMatrixToRotation (FBRVector &pVector, FBMatrix pMatrix, FBRotationOrder pRotationOrder = kFBXYZ);
00154
00159 FBSDK_DLL void FBMatrixToScaling (FBSVector &pVector, FBMatrix pMatrix);
00160
00168 FBSDK_DLL void FBMatrixToTRS (FBTVector &pTVector, FBRVector &pRVector, FBSVector &pSVector,FBMatrix pMatrix);
00169
00171
00173
00178 FBSDK_DLL void FBRotationToQuaternion (FBQuaternion &pQuaternion, FBRVector pVector, FBRotationOrder pRotationOrder = kFBXYZ);
00179
00186 FBSDK_DLL void FBQuaternionToRotation (FBRVector &pVector, FBQuaternion pQuaternion, FBRotationOrder pRotationOrder = kFBXYZ);
00187
00188
00190
00192
00199 FBSDK_DLL void FBGetLocalMatrix (FBMatrix &pMatrix, FBMatrix pMatrixParent, FBMatrix pMatrixChild);
00200
00208 FBSDK_DLL void FBGetGlobalMatrix (FBMatrix &pMatrix, FBMatrix pMatrixParent, FBMatrix pLocalMatrix);
00209
00210
00217 FBSDK_DLL void FBMatrixOrthogonalize (FBMatrix &pMatrix);
00218
00220
00222
00227 FBSDK_DLL void FBAdd (FBTVector &pResult, FBTVector &pV1, FBTVector &pV2);
00228
00234 FBSDK_DLL void FBSub (FBTVector &pResult, FBTVector &pV1, FBTVector &pV2);
00235
00241 FBSDK_DLL void FBMult (FBTVector &pResult, FBTVector &pV1, double pV2);
00242
00248 FBSDK_DLL void FBMult (FBTVector &pResult, FBTVector &pV1, FBTVector &pV2);
00249
00255 FBSDK_DLL void FBMult (FBMatrix &pResult, FBMatrix &pM, FBSVector &pV);
00256
00262 FBSDK_DLL double FBDot (FBTVector &pV1, FBTVector &pV2);
00263
00268 FBSDK_DLL double FBLength (FBTVector &pV);
00269
00271
00273
00278 FBSDK_DLL void FBQAdd (FBQuaternion &pResult, const FBQuaternion &pQ1, const FBQuaternion &pQ2);
00279
00285 FBSDK_DLL void FBQSub (FBQuaternion &pResult, const FBQuaternion &pQ1, const FBQuaternion &pQ2);
00286
00292 FBSDK_DLL void FBQMult (FBQuaternion &pResult, const FBQuaternion &pQ1, double pQ2);
00293
00299 FBSDK_DLL void FBQMult (FBQuaternion &pResult, const FBQuaternion &pQ1, const FBQuaternion &pQ2);
00300
00306 FBSDK_DLL double FBQDot (const FBQuaternion &pQ1, const FBQuaternion &pQ2);
00307
00312 FBSDK_DLL double FBQLength (const FBQuaternion &pQ);
00313
00315
00317
00321 FBSDK_DLL double FBLength (FBVertex &pV);
00322
00324
00326
00332 FBSDK_DLL void FBInterpolateRotation( FBRVector &pROut, const FBRVector &pR0, const FBRVector &pR1, double pU );
00333
00340 FBSDK_DLL void FBInterpolateRotation( FBQuaternion &pQOut, const FBQuaternion &pQ0, const FBQuaternion &pQ1, double pU );
00341
00348 FBSDK_DLL void FBGetContinuousRotation ( FBRVector &pROut, FBRVector &pR0, FBRVector &pR1 );
00349
00351
00353
00359 FBSDK_DLL double FBClamp (double pV, double pL, double pH);
00360
00364 FBSDK_DLL void FBBigEndianToNative (unsigned short &pV);
00365
00369 FBSDK_DLL void FBLittleEndianToNative (unsigned short &pV);
00370
00371
00372 #ifdef FBSDKUseNamespace
00373 }
00374 #endif
00375 #endif