13 #ifndef _FBXSDK_CORE_MATH_H_
14 #define _FBXSDK_CORE_MATH_H_
27 #define FBXSDK_PI 3.1415926535897932384626433832795028841971693993751
28 #define FBXSDK_PI_DIV_2 1.5707963267948966192313216916397514420985846996875
29 #define FBXSDK_PI_DIV_180 0.017453292519943295769236907684886127134428718885417
30 #define FBXSDK_180_DIV_PI 57.295779513082320876798154814105170332405472466565
31 #define FBXSDK_1_DIV_LN2 1.4426950408889634073599246810018921374266459541530
35 #define FBXSDK_DEG_TO_RAD FBXSDK_PI_DIV_180
36 #define FBXSDK_RAD_TO_DEG FBXSDK_180_DIV_PI
37 #define FBXSDK_IN_TO_CM 2.54
38 #define FBXSDK_MM_TO_CM 0.1
39 #define FBXSDK_CM_TO_IN 0.393700787
40 #define FBXSDK_IN_TO_MM 25.4
41 #define FBXSDK_MM_TO_IN 0.0393700787
42 #define FBXSDK_FT_TO_M 0.3048
43 #define FBXSDK_M_TO_FT 3.2808399
44 #define FBXSDK_YD_TO_FT 3
45 #define FBXSDK_FT_TO_YD 0.333333333
46 #define FBXSDK_KM_TO_MILE 0.621371192
47 #define FBXSDK_MILE_TO_KM 1.609344
48 #define FBXSDK_YD_TO_M 0.9144
49 #define FBXSDK_M_TO_YD 1.0936133
53 #define FBXSDK_EULER_DEGENERATE FbxEuler::DegenerateThreshold()
58 enum EAxis {eAxisX=0, eAxisY=1, eAxisZ=2};
71 static bool IsParityOdd(EOrder pOrder);
72 static bool IsRepeat(EOrder pOrder);
75 static const int AxisTable[][3];
86 static double mDegenerateThreshold;
94 #define EFbxRotationOrder FbxEuler::EOrder
95 #define eEulerXYZ FbxEuler::eOrderXYZ
96 #define eEulerXZY FbxEuler::eOrderXZY
97 #define eEulerYZX FbxEuler::eOrderYZX
98 #define eEulerYXZ FbxEuler::eOrderYXZ
99 #define eEulerZXY FbxEuler::eOrderZXY
100 #define eEulerZYX FbxEuler::eOrderZYX
101 #define eSphericXYZ FbxEuler::eOrderSphericXYZ
121 return float(floor(x));
131 return float(ceil(x));
141 return (x < 0) ? T(-1) : T(1);
147 return (x - y < T(0.5)) ? y : y + T(1);
165 #ifndef FBXSDK_SYSTEM_IS_LP64
187 template<
class T>
inline T
FbxAbs(
const T x)
189 return (x >= 0) ? x : ((x >
FbxMin(x)) ? -x :
FbxMax(x));
192 template<
class T>
inline T
FbxClamp(
const T value,
const T min,
const T max)
194 return (value < min) ? min : ((value > max) ? max : value);
199 return FbxAbs(x - y) <= e;
287 y = (y + (x / y)) >> 1;
311 return float(log(x));
319 template<
class T>
inline T
FbxPow(
const T x,
const T y)
416 inline float FbxATan(
const float y,
const float x)
421 inline double FbxATan(
const double y,
const double x)
426 template<
class T>
inline T
FbxATand(
const T y,
const T x)
431 template<
class T>
inline T
FbxNorm(
const T x,
const T y)
436 template<
class T>
inline T
FbxNorm(
const T x,
const T y,
const T z)
438 return FbxSqrt(x * x + y * y + z * z);
441 template<
class T>
inline T
FbxNorm(
const T w,
const T x,
const T y,
const T z)
443 return FbxSqrt(w * w + x * x + y * y + z * z);
446 template<
class T>
inline T
FbxHypot(
const T x,
const T y)
451 template<
class T>
inline T
FbxHypot(
const T x,
const T y,
const T z)
453 return FbxSqrt(x * x + y * y + z * z);
456 template<
class T>
inline T
FbxHypot(
const T w,
const T x,
const T y,
const T z)
458 return FbxSqrt(w * w + x * x + y * y + z * z);
486 template<
class T>
inline T
FbxExp(
const T x);
487 template<
class T>
inline T
FbxLog(
const T x);
488 template<
class T>
inline T
FbxSin(
const T x);
489 template<
class T>
inline T
FbxCos(
const T x);
490 template<
class T>
inline T
FbxASin(
const T x);
491 template<
class T>
inline T
FbxACos(
const T x);
492 template<
class T>
inline T
FbxATan(
const T x);
493 template<
class T>
inline T
FbxATan(
const T y,
const T x);
float FbxCos(const float x)
#define FBXSDK_1_DIV_LN2
1 divided by LogN2
FBX SDK environment definition.
float FbxLog(const float x)
Mix between Slerp and cubic interpolation, depending on the specified tangents for each key...
FbxDouble FbxMod(const FbxFloat x, FbxFloat &i)
int FbxBitCount(const T x)
#define FBXSDK_180_DIV_PI
180 divided by PI
EFbxQuatInterpMode
Quaternion interpolation modes.
const FbxDouble FbxIdentityMatrix[4][4]
T FbxClamp(const T value, const T min, const T max)
float FbxExp(const float x)
FbxVector4 FbxRejection(const FbxVector4 &a, const FbxVector4 &b)
void FbxFixInfinite(T &x)
Spherical linear interpolation.
double DotProduct(const FbxVector4 &pVector) const
Calculate the dot product of two vectors.
Do not evaluate using quaternion interpolation.
T FbxReciprocal(const T x)
T FbxPow(const T x, const T y)
float FbxFloor(const float x)
FbxUChar FbxAbs(const FbxUChar x)
T FbxSinCos(const T x, T *y)
double FbxSqrt(const double x)
float FbxATan(const float x)
Legacy quaternion interpolation mode.
float FbxACos(const float x)
T FbxSinCosd(const T x, T *y)
T FbxHypot(const T x, const T y)
FbxChar FbxMax(const FbxChar)
float FbxCeil(const float x)
Number of quaternion interpolation modes.
float FbxTan(const float x)
A four double mathematic vector class.
FBX SDK affine matrix class.
#define FBXSDK_FLOAT_EPSILON
const FbxVector4 FbxZeroVector4
static double DegenerateThreshold()
T FbxNorm(const T x, const T y)
FbxChar FbxMin(const FbxChar)
bool FbxEqual(const T x, const T y, const T e=(T)(1.0e-6))
float FbxSin(const float x)
A two double mathematic vector class.
static const int AxisTableSize
FBX SDK basic 4x4 double matrix class.
float FbxASin(const float x)
#define FBXSDK_PI_DIV_180
PI divived by 180.