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 (16.0*FBXSDK_FLOAT_EPSILON)
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];
98 #define EFbxRotationOrder FbxEuler::EOrder
99 #define eEulerXYZ FbxEuler::eOrderXYZ
100 #define eEulerXZY FbxEuler::eOrderXZY
101 #define eEulerYZX FbxEuler::eOrderYZX
102 #define eEulerYXZ FbxEuler::eOrderYXZ
103 #define eEulerZXY FbxEuler::eOrderZXY
104 #define eEulerZYX FbxEuler::eOrderZYX
105 #define eSphericXYZ FbxEuler::eOrderSphericXYZ
125 return float(floor(x));
135 return float(ceil(x));
145 return (x < 0) ? T(-1) : T(1);
151 return (x - y < T(0.5)) ? y : y + T(1);
169 #ifndef FBXSDK_SYSTEM_IS_LP64
191 template<
class T>
inline T
FbxAbs(
const T x)
193 return (x >= 0) ? x : ((x >
FbxMin(x)) ? -x :
FbxMax(x));
196 template<
class T>
inline T
FbxClamp(
const T value,
const T min,
const T max)
198 return (value < min) ? min : ((value > max) ? max : value);
203 return FbxAbs(x - y) <= e;
291 y = (y + (x / y)) >> 1;
315 return float(log(x));
323 template<
class T>
inline T
FbxPow(
const T x,
const T y)
420 inline float FbxATan(
const float y,
const float x)
425 inline double FbxATan(
const double y,
const double x)
430 template<
class T>
inline T
FbxATand(
const T y,
const T x)
435 template<
class T>
inline T
FbxNorm(
const T x,
const T y)
440 template<
class T>
inline T
FbxNorm(
const T x,
const T y,
const T z)
442 return FbxSqrt(x * x + y * y + z * z);
445 template<
class T>
inline T
FbxNorm(
const T w,
const T x,
const T y,
const T z)
447 return FbxSqrt(w * w + x * x + y * y + z * z);
450 template<
class T>
inline T
FbxHypot(
const T x,
const T y)
455 template<
class T>
inline T
FbxHypot(
const T x,
const T y,
const T z)
457 return FbxSqrt(x * x + y * y + z * z);
460 template<
class T>
inline T
FbxHypot(
const T w,
const T x,
const T y,
const T z)
462 return FbxSqrt(w * w + x * x + y * y + z * z);
490 template<
class T>
inline T
FbxExp(
const T x);
491 template<
class T>
inline T
FbxLog(
const T x);
492 template<
class T>
inline T
FbxSin(
const T x);
493 template<
class T>
inline T
FbxCos(
const T x);
494 template<
class T>
inline T
FbxASin(
const T x);
495 template<
class T>
inline T
FbxACos(
const T x);
496 template<
class T>
inline T
FbxATan(
const T x);
497 template<
class T>
inline T
FbxATan(
const T y,
const T x);
float FbxCos(const float x)
bool FbxEqual(const T x, const T y, const T e=(T) FBXSDK_TOLERANCE)
#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
FBXSDK_DLL const FbxDouble FbxIdentityMatrix[4][4]
EFbxQuatInterpMode
Quaternion interpolation modes.
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)
FBXSDK_DLL const FbxVector4 FbxZeroVector4
A four double mathematic vector class.
FBX SDK affine matrix class.
const FbxChar FbxMax(const FbxChar)
T FbxNorm(const T x, const T y)
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.