13 #ifndef _FBXSDK_CORE_MATH_H_
14 #define _FBXSDK_CORE_MATH_H_
24 #if defined(FBXSDK_ENV_MAC)
26 extern "C" int isnan (
double);
31 #if defined(FBXSDK_ENV_WIN)
36 #define finite _finite
42 #define FBXSDK_PI 3.1415926535897932384626433832795028841971693993751
43 #define FBXSDK_PI_DIV_2 1.5707963267948966192313216916397514420985846996875
44 #define FBXSDK_PI_DIV_180 0.017453292519943295769236907684886127134428718885417
45 #define FBXSDK_180_DIV_PI 57.295779513082320876798154814105170332405472466565
46 #define FBXSDK_1_DIV_LN2 1.4426950408889634073599246810018921374266459541530
50 #define FBXSDK_DEG_TO_RAD FBXSDK_PI_DIV_180
51 #define FBXSDK_RAD_TO_DEG FBXSDK_180_DIV_PI
52 #define FBXSDK_IN_TO_CM 2.54
53 #define FBXSDK_MM_TO_CM 0.1
54 #define FBXSDK_CM_TO_IN 0.393700787
55 #define FBXSDK_IN_TO_MM 25.4
56 #define FBXSDK_MM_TO_IN 0.0393700787
57 #define FBXSDK_FT_TO_M 0.3048
58 #define FBXSDK_M_TO_FT 3.2808399
59 #define FBXSDK_YD_TO_FT 3
60 #define FBXSDK_FT_TO_YD 0.333333333
61 #define FBXSDK_KM_TO_MILE 0.621371192
62 #define FBXSDK_MILE_TO_KM 1.609344
63 #define FBXSDK_YD_TO_M 0.9144
64 #define FBXSDK_M_TO_YD 1.0936133
68 #define FBXSDK_EULER_DEGENERATE FbxEuler::DegenerateThreshold()
73 enum EAxis {eAxisX=0, eAxisY=1, eAxisZ=2};
86 static bool IsParityOdd(EOrder pOrder);
87 static bool IsRepeat(EOrder pOrder);
90 static const int AxisTable[][3];
101 static double mDegenerateThreshold;
109 #define EFbxRotationOrder FbxEuler::EOrder
110 #define eEulerXYZ FbxEuler::eOrderXYZ
111 #define eEulerXZY FbxEuler::eOrderXZY
112 #define eEulerYZX FbxEuler::eOrderYZX
113 #define eEulerYXZ FbxEuler::eOrderYXZ
114 #define eEulerZXY FbxEuler::eOrderZXY
115 #define eEulerZYX FbxEuler::eOrderZYX
116 #define eSphericXYZ FbxEuler::eOrderSphericXYZ
136 return float(floor(x));
146 return float(ceil(x));
156 return (x < 0) ? T(-1) : T(1);
162 return (x - y < T(0.5)) ? y : y + T(1);
180 #ifndef FBXSDK_SYSTEM_IS_LP64
202 template<
class T>
inline T
FbxAbs(
const T x)
204 return (x >= 0) ? x : ((x >
FbxMin(x)) ? -x :
FbxMax(x));
207 template<
class T>
inline T
FbxClamp(
const T value,
const T min,
const T max)
209 return (value < min) ? min : ((value > max) ? max : value);
214 return FbxAbs(x - y) <= e;
302 y = (y + (x / y)) >> 1;
326 return float(log(x));
334 template<
class T>
inline T
FbxPow(
const T x,
const T y)
431 inline float FbxATan(
const float y,
const float x)
436 inline double FbxATan(
const double y,
const double x)
441 template<
class T>
inline T
FbxATand(
const T y,
const T x)
446 template<
class T>
inline T
FbxNorm(
const T x,
const T y)
451 template<
class T>
inline T
FbxNorm(
const T x,
const T y,
const T z)
453 return FbxSqrt(x * x + y * y + z * z);
456 template<
class T>
inline T
FbxNorm(
const T w,
const T x,
const T y,
const T z)
458 return FbxSqrt(w * w + x * x + y * y + z * z);
461 template<
class T>
inline T
FbxHypot(
const T x,
const T y)
466 template<
class T>
inline T
FbxHypot(
const T x,
const T y,
const T z)
468 return FbxSqrt(x * x + y * y + z * z);
471 template<
class T>
inline T
FbxHypot(
const T w,
const T x,
const T y,
const T z)
473 return FbxSqrt(w * w + x * x + y * y + z * z);
501 template<
class T>
inline T
FbxExp(
const T x);
502 template<
class T>
inline T
FbxLog(
const T x);
503 template<
class T>
inline T
FbxSin(
const T x);
504 template<
class T>
inline T
FbxCos(
const T x);
505 template<
class T>
inline T
FbxASin(
const T x);
506 template<
class T>
inline T
FbxACos(
const T x);
507 template<
class T>
inline T
FbxATan(
const T x);
508 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.
const FbxChar FbxMin(const FbxChar)
float FbxACos(const float x)
T FbxSinCosd(const T x, T *y)
T FbxHypot(const T x, const T y)
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.
const FbxChar FbxMax(const FbxChar)
#define FBXSDK_FLOAT_EPSILON
const FbxVector4 FbxZeroVector4
static double DegenerateThreshold()
T FbxNorm(const T x, const T y)
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.