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

Last change on this file since 1768 was 1768, checked in by touky, 8 years ago

Added Attachment/base logic with working attachment with EasyCharacterController.
Added RayCastResult & a naïve integration for EasyCharacterController.
Enjoy !

File size: 1.7 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_PLATFORM          GAMEGROUP_BEFORE
26#define GAMEGROUP_ENT_MAIN                      GAMEGROUP_DEFAULT
27#define GAMEGROUP_EZP_CHAR_CTRLR        GAMEGROUP_AFTER
28#define GAMEGROUP_SIMULATION            GAMEGROUP_AFTER_POST
29
30#ifdef HAVE_PHYS_USE_BULLET
31
32#define LOL2BT_UNIT                             1.0f
33#define BT2LOL_UNIT                             1.0f
34
35#define LOL2BT_SIZE                             0.5f
36#define BT2LOL_SIZE                             2.0f
37
38#define LOL2BT_VEC3(ELEMENT)    btVector3((ELEMENT).x, (ELEMENT).y, (ELEMENT).z)
39#define BT2LOL_VEC3(ELEMENT)    (*(lol::vec3*)(&(ELEMENT)))
40
41//Same as above with Unit taken into account
42#define LOL2BTU_VEC3(ELEMENT)   btVector3((ELEMENT).x * LOL2BT_UNIT, (ELEMENT).y * LOL2BT_UNIT, (ELEMENT).z * LOL2BT_UNIT)
43#define BT2LOLU_VEC3(ELEMENT)   (*(lol::vec3*)(&(ELEMENT))) * BT2LOL_UNIT
44
45#define LOL2BT_QUAT(ELEMENT)    btQuaternion((ELEMENT).x, (ELEMENT).y, (ELEMENT).z, (ELEMENT).w)
46#define BT2LOL_QUAT(ELEMENT)    lol::quat((ELEMENT).getW(), BT2LOL_VEC3((ELEMENT).getAxis())
47
48#endif // HAVE_PHYS_USE_BULLET
49
50} /* namespace lol */
51
52#endif /* __LOLBTPHYSICSINTEGRATION_H__ */
53
Note: See TracBrowser for help on using the repository browser.