hkMath.h
上传用户:yisoukefu
上传日期:2020-08-09
资源大小:39506k
文件大小:5k
源码类别:

其他游戏

开发平台:

Visual C++

  1. /* 
  2.  * 
  3.  * Confidential Information of Telekinesys Research Limited (t/a Havok). Not for disclosure or distribution without Havok's
  4.  * prior written consent. This software contains code, techniques and know-how which is confidential and proprietary to Havok.
  5.  * Level 2 and Level 3 source code contains trade secrets of Havok. Havok Software (C) Copyright 1999-2009 Telekinesys Research Limited t/a Havok. All Rights Reserved. Use of this software is subject to the terms of an end user license agreement.
  6.  * 
  7.  */
  8. #ifndef HK_MATH_MATH_H
  9. #define HK_MATH_MATH_H
  10. #include <Common/Base/Types/hkBaseTypes.h>
  11. #include <Common/Base/Config/hkConfigSimd.h>
  12. // Temporarily disable the alignment warning for AMD64
  13. typedef float hkReal;
  14. #if HK_CONFIG_SIMD == HK_CONFIG_SIMD_ENABLED
  15. # if defined(HK_COMPILER_HAS_INTRINSICS_IA32)
  16. # include <Common/Base/Math/Types/Sse/hkSseMathTypes.inl>
  17. # elif defined(HK_ARCH_PS2) // ps2 intrinsics or asm blocks
  18. # define HK_PLATFORM_SUPPORTS_MANY_SIMD_REGISTERS
  19. # include <Common/Base/Math/Types/Ps2/hkPs2MathTypes.inl>
  20. # include <Common/Base/Math/Types/Ps2/hkPs2MathTypesCommon.inl>
  21. # elif defined(HK_PLATFORM_PSP )
  22. # define HK_PLATFORM_SUPPORTS_MANY_SIMD_REGISTERS
  23. # error simd should be disabled
  24. # elif defined(HK_PLATFORM_XBOX360)
  25. # include <Common/Base/Math/Types/Xbox360/hkXbox360MathTypes.inl>
  26. # elif defined(HK_ARCH_PS3) || defined(HK_ARCH_PS3SPU)
  27. # define HK_PLATFORM_SUPPORTS_MANY_SIMD_REGISTERS
  28. # include <Common/Base/Math/Types/Ps3/hkPs3MathTypes.inl>
  29. # else // simd
  30. # error Unknown platform for SIMD
  31. # endif
  32. #else // not simd
  33. # include <Common/Base/Math/Types/Fpu/hkFpuMathTypes.inl>
  34. # if defined(HK_ARCH_PS2)
  35. # include <Common/Base/Math/Types/Ps2/hkPs2MathTypesCommon.inl>
  36. # elif defined (HK_PLATFORM_GC) || defined(HK_PLATFORM_RVL)
  37. # include <Common/Base/Math/Functions/Gc/hkGcMathFuncs.inl> 
  38. # elif defined(HK_PLATFORM_PSP) && defined( HK_COMPILER_GCC )
  39. # include <Common/Base/Math/Types/Psp/hkPspGccMathTypes.inl>
  40. # endif
  41. #endif
  42. #include <Common/Base/Math/Functions/hkFpuMathFuncs.inl>
  43. extern const hkQuadReal hkQuadReal0000;
  44. extern const hkQuadReal hkQuadReal1111;
  45. extern const hkQuadReal hkQuadReal1000;
  46. extern const hkQuadReal hkQuadReal0100;
  47. extern const hkQuadReal hkQuadReal0010;
  48. extern const hkQuadReal hkQuadReal0001;
  49. extern const hkQuadReal hkQuadReal3333;
  50. extern const hkQuadReal hkQuadRealHalf;
  51. extern const hkQuadReal hkQuadRealMinusHalf;
  52. #if HK_CONFIG_SIMD == HK_CONFIG_SIMD_ENABLED
  53. # define hkSimdReal0 hkSimdReal(hkQuadReal0000)
  54. #else
  55. # define hkSimdReal0 0.0f
  56. #endif
  57. class hkVector4;
  58. class hkQuaternion;
  59. class hkMatrix3;
  60. class hkRotation;
  61. class hkTransform;
  62. class hkQsTransform;
  63. #include <Common/Base/Math/Vector/hkVector4.h>
  64. #include <Common/Base/Math/Quaternion/hkQuaternion.h>
  65. #include <Common/Base/Math/Matrix/hkMatrix3.h>
  66. #include <Common/Base/Math/Matrix/hkRotation.h>
  67. #include <Common/Base/Math/Matrix/hkTransform.h>
  68. #include <Common/Base/Math/SweptTransform/hkSweptTransform.h>
  69. #include <Common/Base/Math/QsTransform/hkQsTransform.h>
  70. #include <Common/Base/Math/Matrix/hkMatrix4.h>
  71. #if HK_CONFIG_SIMD == HK_CONFIG_SIMD_ENABLED
  72. # if defined(HK_COMPILER_HAS_INTRINSICS_IA32)
  73. # include <Common/Base/Math/Vector/Sse/hkSseVector4.inl>
  74. # elif defined(HK_COMPILER_HAS_INTRINSICS_PS2)
  75. # include <Common/Base/Math/Vector/Ps2/hkPs2Vector4.inl>
  76. # elif defined(HK_PS2)
  77. // to work around inlining issues, Ps2AsmVector4 is split into a and b parts
  78. # include <Common/Base/Math/Vector/Ps2/hkPs2AsmVector4a.inl>
  79. # elif defined( HK_PLATFORM_PSP )
  80. # error simd should be disabled
  81. # elif defined(HK_PLATFORM_XBOX360)
  82. # include <Common/Base/Math/Vector/Xbox360/hkXbox360Vector4.inl>
  83. # elif defined(HK_PLATFORM_PS3_PPU) || defined(HK_PLATFORM_PS3_SPU)
  84. # include <Common/Base/Math/Vector/Ps3/hkPs3Vector4.inl>
  85. # else
  86. # error Dont know how to do simd on this platform
  87. # endif
  88. #else // no SIMD
  89. # include <Common/Base/Math/Vector/Fpu/hkFpuVector4.inl>
  90. #endif // HK_CONFIG_SIMD
  91. // common implementations after inline definitions
  92. #include <Common/Base/Math/Vector/hkVector4.inl>
  93. #include <Common/Base/Math/Matrix/hkMatrix3.inl>
  94. #include <Common/Base/Math/Quaternion/hkQuaternion.inl>
  95. #include <Common/Base/Math/Matrix/hkTransform.inl>
  96. #include <Common/Base/Math/Matrix/hkMatrix4.inl>
  97. // to work around inlining issues, Ps2AsmVector4 is split
  98. #if HK_CONFIG_SIMD == HK_CONFIG_SIMD_ENABLED && !defined(HK_COMPILER_HAS_INTRINSICS_PS2) && defined(HK_PS2)
  99. # include <Common/Base/Math/Vector/Ps2/hkPs2AsmVector4b.inl> 
  100. #endif
  101. #include <Common/Base/Math/QsTransform/hkQsTransform.inl>
  102. #include <Common/Base/Math/SweptTransform/hkSweptTransform.inl>
  103. #endif // HK_MATH_MATH_H
  104. /*
  105. * Havok SDK - NO SOURCE PC DOWNLOAD, BUILD(#20090216)
  106. * Confidential Information of Havok.  (C) Copyright 1999-2009
  107. * Telekinesys Research Limited t/a Havok. All Rights Reserved. The Havok
  108. * Logo, and the Havok buzzsaw logo are trademarks of Havok.  Title, ownership
  109. * rights, and intellectual property rights in the Havok software remain in
  110. * Havok and/or its suppliers.
  111. * Use of this software for evaluation purposes is subject to and indicates
  112. * acceptance of the End User licence Agreement for this product. A copy of
  113. * the license is included with this software and is also available at www.havok.com/tryhavok.
  114. */