source: trunk/test/Physics/LolBtPhysicsIntegration.h @ 1611

Last change on this file since 1611 was 1611, checked in by sam, 8 years ago

test: fix Bullet/Lol quaternion conversions, they use [x y z w] whereas we use
the mathematician-friendly [w x y z].

File size: 1.0 KB
Line 
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//
13// Bullet Physics integration in Lol
14// ------------------
15//
16
17#if !defined __LOLBTPHYSICSINTEGRATION_H__
18#define __LOLBTPHYSICSINTEGRATION_H__
19
20namespace lol
21{
22
23#define LOL2BT_UNIT                             1.0f
24#define BT2LOL_UNIT                             1.0f
25
26#define LOL2BT_SIZE                             0.5f
27#define BT2LOL_SIZE                             2.0f
28
29#define LOL2BT_VEC3(ELEMENT)    (*(btVector3*)(&(ELEMENT)))
30#define BT2LOL_VEC3(ELEMENT)    (*(lol::vec3*)(&(ELEMENT)))
31
32#define LOL2BT_QUAT(ELEMENT)    btQuaternion((ELEMENT).x, (ELEMENT).y, (ELEMENT).z, (ELEMENT).w)
33#define BT2LOL_QUAT(ELEMENT)    lol::quat((ELEMENT).getW(), BT2LOL_VEC3((ELEMENT).getAxis())
34
35} /* namespace lol */
36
37#endif /* __LOLBTPHYSICSINTEGRATION_H__ */
38
Note: See TracBrowser for help on using the repository browser.