You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

55 rivejä
1.9 KiB

  1. //
  2. // Lol Engine
  3. //
  4. // Copyright: (c) 2010-2013 Sam Hocevar <sam@hocevar.net>
  5. // (c) 2009-2013 Benjamin "Touky" Huet <huet.benjamin@gmail.com>
  6. // This program is free software; you can redistribute it and/or
  7. // modify it under the terms of the Do What The Fuck You Want To
  8. // Public License, Version 2, as published by Sam Hocevar. See
  9. // http://www.wtfpl.net/ for more details.
  10. //
  11. //
  12. // Bullet Physics integration in Lol
  13. // ------------------
  14. //
  15. #if !defined __LOLBTPHYSICSINTEGRATION_H__
  16. #define __LOLBTPHYSICSINTEGRATION_H__
  17. namespace lol
  18. {
  19. //Override Gamegroups names for Physic-useage
  20. //"_ENT_" means that this is a group for Entities that use EasyPhysic primitives.
  21. //"_EZP_" means that this is a group for EasyPhysic primitives.
  22. #define GAMEGROUP_ENT_INPUT GAMEGROUP_BEFORE
  23. #define GAMEGROUP_ENT_PLATFORM GAMEGROUP_DEFAULT
  24. #define GAMEGROUP_ENT_MAIN GAMEGROUP_AFTER
  25. #define GAMEGROUP_EZP_CHAR_CTRLR GAMEGROUP_AFTER_0
  26. #define GAMEGROUP_SIMULATION GAMEGROUP_AFTER_1
  27. #ifdef HAVE_PHYS_USE_BULLET
  28. #define LOL2BT_UNIT 1.0f
  29. #define BT2LOL_UNIT 1.0f
  30. #define LOL2BT_SIZE 0.5f
  31. #define BT2LOL_SIZE 2.0f
  32. #define LOL2BT_VEC3(ELEMENT) btVector3((ELEMENT).x, (ELEMENT).y, (ELEMENT).z)
  33. #define BT2LOL_VEC3(ELEMENT) (*(lol::vec3*)(&(ELEMENT)))
  34. //Same as above with Unit taken into account
  35. #define LOL2BTU_VEC3(ELEMENT) btVector3((ELEMENT).x * LOL2BT_UNIT, (ELEMENT).y * LOL2BT_UNIT, (ELEMENT).z * LOL2BT_UNIT)
  36. #define BT2LOLU_VEC3(ELEMENT) (*(lol::vec3*)(&(ELEMENT))) * BT2LOL_UNIT
  37. #define LOL2BT_QUAT(ELEMENT) btQuaternion((ELEMENT).x, (ELEMENT).y, (ELEMENT).z, (ELEMENT).w)
  38. #define BT2LOL_QUAT(ELEMENT) lol::quat((ELEMENT).getW(), BT2LOL_VEC3((ELEMENT).getAxis())
  39. #endif // HAVE_PHYS_USE_BULLET
  40. } /* namespace lol */
  41. #endif /* __LOLBTPHYSICSINTEGRATION_H__ */