source: trunk/test/Physics/Include/LolBtPhysicsIntegration.h @ 1888

Last change on this file since 1888 was 1888, checked in by lolbot, 7 years ago

fixed 23 files out of 277:

  • fixed 1270 CR characters
  • fixed 56 trailing spaces
  • fixed 5085 tabs
File size: 1.9 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    //Override Gamegroups names for Physic-useage
23    //"_ENT_" means that this is a group for Entities that use EasyPhysic primitives.
24    //"_EZP_" means that this is a group for EasyPhysic primitives.
25#define GAMEGROUP_ENT_INPUT            GAMEGROUP_BEFORE
26#define GAMEGROUP_ENT_PLATFORM        GAMEGROUP_DEFAULT
27#define GAMEGROUP_ENT_MAIN            GAMEGROUP_AFTER
28#define GAMEGROUP_EZP_CHAR_CTRLR    GAMEGROUP_AFTER_0
29#define GAMEGROUP_SIMULATION        GAMEGROUP_AFTER_1
30
31#ifdef HAVE_PHYS_USE_BULLET
32
33#define LOL2BT_UNIT                1.0f
34#define BT2LOL_UNIT                1.0f
35
36#define LOL2BT_SIZE                0.5f
37#define BT2LOL_SIZE                2.0f
38
39#define LOL2BT_VEC3(ELEMENT)    btVector3((ELEMENT).x, (ELEMENT).y, (ELEMENT).z)
40#define BT2LOL_VEC3(ELEMENT)    (*(lol::vec3*)(&(ELEMENT)))
41
42//Same as above with Unit taken into account
43#define LOL2BTU_VEC3(ELEMENT)    btVector3((ELEMENT).x * LOL2BT_UNIT, (ELEMENT).y * LOL2BT_UNIT, (ELEMENT).z * LOL2BT_UNIT)
44#define BT2LOLU_VEC3(ELEMENT)    (*(lol::vec3*)(&(ELEMENT))) * BT2LOL_UNIT
45
46#define LOL2BT_QUAT(ELEMENT)    btQuaternion((ELEMENT).x, (ELEMENT).y, (ELEMENT).z, (ELEMENT).w)
47#define BT2LOL_QUAT(ELEMENT)    lol::quat((ELEMENT).getW(), BT2LOL_VEC3((ELEMENT).getAxis())
48
49#endif // HAVE_PHYS_USE_BULLET
50
51} /* namespace lol */
52
53#endif /* __LOLBTPHYSICSINTEGRATION_H__ */
54
Note: See TracBrowser for help on using the repository browser.