Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.

lolbtphysicsintegration.h 1.8 KiB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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-usage
  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. #define LOL2BT_UNIT 1.0f
  28. #define BT2LOL_UNIT 1.0f
  29. #define LOL2BT_SIZE 0.5f
  30. #define BT2LOL_SIZE 2.0f
  31. #define LOL2BT_VEC3(ELEMENT) btVector3((ELEMENT).x, (ELEMENT).y, (ELEMENT).z)
  32. #define BT2LOL_VEC3(ELEMENT) (*(lol::vec3*)(&(ELEMENT)))
  33. //Same as above with Unit taken into account
  34. #define LOL2BTU_VEC3(ELEMENT) btVector3((ELEMENT).x * LOL2BT_UNIT, (ELEMENT).y * LOL2BT_UNIT, (ELEMENT).z * LOL2BT_UNIT)
  35. #define BT2LOLU_VEC3(ELEMENT) (*(lol::vec3*)(&(ELEMENT))) * BT2LOL_UNIT
  36. #define LOL2BT_QUAT(ELEMENT) btQuaternion((ELEMENT).x, (ELEMENT).y, (ELEMENT).z, (ELEMENT).w)
  37. #define BT2LOL_QUAT(ELEMENT) lol::quat((ELEMENT).getW(), BT2LOL_VEC3((ELEMENT).getAxis())
  38. } /* namespace lol */
  39. #endif /* __LOLBTPHYSICSINTEGRATION_H__ */