Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.

LolBtPhysicsIntegration.h 1.1 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. //
  2. // Lol Engine
  3. //
  4. // Copyright: (c) 2010-2012 Sam Hocevar <sam@hocevar.net>
  5. // (c) 2009-2012 Benjamin 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://sam.zoy.org/projects/COPYING.WTFPL 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. #ifdef HAVE_PHYS_USE_BULLET
  20. #define LOL2BT_UNIT 1.0f
  21. #define BT2LOL_UNIT 1.0f
  22. #define LOL2BT_SIZE 0.5f
  23. #define BT2LOL_SIZE 2.0f
  24. #define LOL2BT_VEC3(ELEMENT) btVector3((ELEMENT).x, (ELEMENT).y, (ELEMENT).z)
  25. #define BT2LOL_VEC3(ELEMENT) (*(lol::vec3*)(&(ELEMENT)))
  26. #define LOL2BT_QUAT(ELEMENT) btQuaternion((ELEMENT).x, (ELEMENT).y, (ELEMENT).z, (ELEMENT).w)
  27. #define BT2LOL_QUAT(ELEMENT) lol::quat((ELEMENT).getW(), BT2LOL_VEC3((ELEMENT).getAxis())
  28. #endif // HAVE_PHYS_USE_BULLET
  29. } /* namespace lol */
  30. #endif /* __LOLBTPHYSICSINTEGRATION_H__ */