CCPhysics3D.h 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. /****************************************************************************
  2. Copyright (c) 2015-2017 Chukong Technologies Inc.
  3. http://www.cocos2d-x.org
  4. Permission is hereby granted, free of charge, to any person obtaining a copy
  5. of this software and associated documentation files (the "Software"), to deal
  6. in the Software without restriction, including without limitation the rights
  7. to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  8. copies of the Software, and to permit persons to whom the Software is
  9. furnished to do so, subject to the following conditions:
  10. The above copyright notice and this permission notice shall be included in
  11. all copies or substantial portions of the Software.
  12. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  13. IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  14. FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  15. AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  16. LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  17. OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  18. THE SOFTWARE.
  19. ****************************************************************************/
  20. #ifndef __PHYSICS_3D_H__
  21. #define __PHYSICS_3D_H__
  22. #include "base/ccConfig.h"
  23. #include "math/CCMath.h"
  24. #if CC_USE_3D_PHYSICS
  25. #include "physics3d/CCPhysics3DShape.h"
  26. #include "physics3d/CCPhysicsSprite3D.h"
  27. #include "physics3d/CCPhysics3DWorld.h"
  28. #include "physics3d/CCPhysics3DDebugDrawer.h"
  29. #include "physics3d/CCPhysics3DObject.h"
  30. #include "physics3d/CCPhysics3DComponent.h"
  31. #include "physics3d/CCPhysics3DConstraint.h"
  32. NS_CC_BEGIN
  33. CC_DLL const char* physics3dVersion();
  34. NS_CC_END
  35. #if (CC_ENABLE_BULLET_INTEGRATION)
  36. //include bullet header files
  37. #include "bullet/LinearMath/btTransform.h"
  38. #include "bullet/LinearMath/btVector3.h"
  39. #include "bullet/LinearMath/btQuaternion.h"
  40. #include "bullet/btBulletCollisionCommon.h"
  41. #include "bullet/btBulletDynamicsCommon.h"
  42. #include "bullet/BulletCollision/CollisionDispatch/btGhostObject.h"
  43. //convert between cocos and bullet
  44. cocos2d::Vec3 convertbtVector3ToVec3(const btVector3 &btVec3);
  45. btVector3 convertVec3TobtVector3(const cocos2d::Vec3 &vec3);
  46. cocos2d::Mat4 convertbtTransformToMat4(const btTransform &btTrans);
  47. btTransform convertMat4TobtTransform(const cocos2d::Mat4 &mat4);
  48. cocos2d::Quaternion convertbtQuatToQuat(const btQuaternion &btQuat);
  49. btQuaternion convertQuatTobtQuat(const cocos2d::Quaternion &quat);
  50. #endif // CC_ENABLE_BULLET_INTEGRATION
  51. #endif //CC_USE_3D_PHYSICS
  52. #endif // __PHYSICS_3D_H__