-
Notifications
You must be signed in to change notification settings - Fork 1
/
irr2bp.h
76 lines (74 loc) · 3.61 KB
/
irr2bp.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#ifndef IRR2BP_H_INCLUDED
#define IRR2BP_H_INCLUDED
#include "irrSimulation.h"
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
namespace irr
{
namespace physics
{
class irr2bp
{
public:
/** \brief Create Bullet TriangleMeshShape from Irrlicht Mesh and scaling vector.
*
* \param mesh Irrlicht mesh pointer.
* \param scale Scaling vector.
* \return Return a pointer to a new btTriangleMesh.
*
* Use this function to create static or kinematic bodies.
*/
static btTriangleMesh* createTriangleMesh(const IMesh* mesh,const vector3df& scale);
//static btTriangleMesh* createTriangleMeshEx(IMeshSceneNode* node);
/** \brief Create Bullet ConvexHullShape from Irrlicht Mesh and scaling vector.
*
* \param mesh Irrlicht mesh pointer.
* \param scale Scaling vector.
* \return Return a pointer to a new btConvexHullShape.
*
* For dynamic bodies.
*/
static btConvexHullShape* createConvexHullShape(const IMesh* mesh,const vector3df& scale);
//static btConvexHullShape* createConvexHullShapeEx(ISceneNode* node,IMesh* mesh);
/** \brief Create an optimized Bullet ConvexHullShape from Irrlicht Mesh and scaling vector.
*
* \param mesh Irrlicht mesh pointer.
* \param scale Scaling vector.
* \return Return a pointer to a new btConvexHullShape.
*
* It's optimized by using the triangle middle point(TM) or barycenter of each triangle.
*/
static btConvexHullShape* createConvexHullShapeTM(const IMesh* mesh,const vector3df& scale);
//transfBoundingBox = node->getTransformedBoundingBox()
/** \brief Create an optimized Bullet from Irrlicht Mesh and scaling vector.
*
* \param mesh Irrlicht mesh pointer.
* \param scale Scaling vector.
* \return Return a pointer to a new btConvexHullShape.
*
* It's optimized by using the bounding box of the mesh.
*/
static btConvexHullShape* createConvexHullShapeBB(const aabbox3df& transfBoundingBox,
const IMesh* mesh,const vector3df& scale);
//static btConvexHullShape* createConvexHullShapeMBBB(ISceneNode* node,IMesh* mesh);
/** \brief Create a Bullet Sphere shape from Irrlicht Mesh and scaling vector.
*
* \param mesh Irrlicht mesh pointer.
* \param scale Scaling vector.
* \return Return a pointer to a new btConvexHullShape.
*
* It's optimized by using the bounding sphere of the mesh. Nice for kinematic characters
* NB: TO BE IMPLEMENTED
*/
static btConvexHullShape* createSphereShapeBS(const aabbox3df& transfBoundingBox,
const IMesh* mesh,const vector3df& scale);
static btVector3 getBtVector(const vector3df& v);
static vector3df getIrrVector(const btVector3& v);
static btTransform getBtTransform(const vector3df& position,const vector3df& rotation);
static void getIrrTransform(vector3df& position,vector3df& rotation,const btTransform& trans);
};
}
}
#endif // IRR2BP_H_INCLUDED