Blender  V3.3
btCollisionWorldImporter.h
Go to the documentation of this file.
1 /*
2 Bullet Continuous Collision Detection and Physics Library
3 Copyright (c) 2003-2014 Erwin Coumans http://bulletphysics.org
4 
5 This software is provided 'as-is', without any express or implied warranty.
6 In no event will the authors be held liable for any damages arising from the use of this software.
7 Permission is granted to anyone to use this software for any purpose,
8 including commercial applications, and to alter it and redistribute it freely,
9 subject to the following restrictions:
10 
11 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
12 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
13 3. This notice may not be removed or altered from any source distribution.
14 */
15 
16 #ifndef BT_COLLISION_WORLD_IMPORTER_H
17 #define BT_COLLISION_WORLD_IMPORTER_H
18 
19 #include "LinearMath/btTransform.h"
20 #include "LinearMath/btVector3.h"
22 #include "LinearMath/btHashMap.h"
23 
24 class btCollisionShape;
25 class btCollisionObject;
27 
28 struct ConstraintInput;
29 class btCollisionWorld;
34 class btGImpactMeshShape;
35 class btOptimizedBvh;
36 struct btTriangleInfoMap;
39 class btHingeConstraint;
43 class btSliderConstraint;
44 class btGearConstraint;
45 struct btContactSolverInfo;
46 
48 {
49 protected:
51 
53 
56 
62 
64 
68 
71 
74 
77 
79 
82 
83  //methods
84 
85  char* duplicateName(const char* name);
86 
88 
89 public:
91 
92  virtual ~btCollisionWorldImporter();
93 
95 
98  virtual void deleteAllData();
99 
100  void setVerboseMode(int verboseMode)
101  {
102  m_verboseMode = verboseMode;
103  }
104 
105  int getVerboseMode() const
106  {
107  return m_verboseMode;
108  }
109 
110  // query for data
111  int getNumCollisionShapes() const;
113  int getNumRigidBodies() const;
114  btCollisionObject* getRigidBodyByIndex(int index) const;
115 
116  int getNumBvhs() const;
117  btOptimizedBvh* getBvhByIndex(int index) const;
118  int getNumTriangleInfoMaps() const;
120 
121  // queris involving named objects
122  btCollisionShape* getCollisionShapeByName(const char* name);
123  btCollisionObject* getCollisionObjectByName(const char* name);
124 
125  const char* getNameForPointer(const void* ptr) const;
126 
128 
129  //bodies
130 
131  virtual btCollisionObject* createCollisionObject(const btTransform& startTransform, btCollisionShape* shape, const char* bodyName);
132 
134 
135  virtual btCollisionShape* createPlaneShape(const btVector3& planeNormal, btScalar planeConstant);
136  virtual btCollisionShape* createBoxShape(const btVector3& halfExtents);
141 
151 #ifdef SUPPORT_GIMPACT_SHAPE_IMPORT
152  virtual btGImpactMeshShape* createGimpactShape(btStridingMeshInterface* trimesh);
153 #endif //SUPPORT_GIMPACT_SHAPE_IMPORT
155 
156  virtual class btConvexHullShape* createConvexHullShape();
157  virtual class btCompoundShape* createCompoundShape();
158  virtual class btScaledBvhTriangleMeshShape* createScaledTrangleMeshShape(btBvhTriangleMeshShape* meshShape, const btVector3& localScalingbtBvhTriangleMeshShape);
159 
160  virtual class btMultiSphereShape* createMultiSphereShape(const btVector3* positions, const btScalar* radi, int numSpheres);
161 
163 
167 };
168 
169 #endif //BT_WORLD_IMPORTER_H
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei height
btBvhTriangleMeshShape(btStridingMeshInterface *meshInterface, bool useQuantizedAabbCompression, bool buildBvh=true)
btCollisionObject
btCollisionShape
The btCollisionShape class provides an interface for collision shapes that can be shared among btColl...
btCompoundShape(bool enableDynamicAabbTree=true, const int initialChildCapacity=0)
btConeTwistConstraint(btRigidBody &rbA, btRigidBody &rbB, const btTransform &rbAFrame, const btTransform &rbBFrame)
btConvexHullShape(const btScalar *points=0, int numPoints=0, int stride=sizeof(btVector3))
btGeneric6DofConstraint(btRigidBody &rbA, btRigidBody &rbB, const btTransform &frameInA, const btTransform &frameInB, bool useLinearReferenceFrameA)
btGeneric6DofSpringConstraint(btRigidBody &rbA, btRigidBody &rbB, const btTransform &frameInA, const btTransform &frameInB, bool useLinearReferenceFrameA)
btHingeConstraint(btRigidBody &rbA, btRigidBody &rbB, const btVector3 &pivotInA, const btVector3 &pivotInB, const btVector3 &axisInA, const btVector3 &axisInB, bool useReferenceFrameA=false)
btMultiSphereShape(const btVector3 *positions, const btScalar *radi, int numSpheres)
btOptimizedBvh()
btPoint2PointConstraint(btRigidBody &rbA, btRigidBody &rbB, const btVector3 &pivotInA, const btVector3 &pivotInB)
float btScalar
The btScalar type abstracts floating point numbers, to easily switch between double and single floati...
Definition: btScalar.h:314
btScaledBvhTriangleMeshShape(btBvhTriangleMeshShape *childShape, const btVector3 &localScaling)
btSliderConstraint(btRigidBody &rbA, btRigidBody &rbB, const btTransform &frameInA, const btTransform &frameInB, bool useLinearReferenceFrameA)
btStridingMeshInterface
btTransform
The btTransform class supports rigid transforms with only translation and rotation and no scaling/she...
Definition: btTransform.h:30
btTriangleIndexVertexArray()
btVector3
btVector3 can be used to represent 3D points and vectors. It has an un-used w component to suit 16-by...
Definition: btVector3.h:82
btAlignedObjectArray< btOptimizedBvh * > m_allocatedBvhs
virtual btStridingMeshInterfaceData * createStridingMeshInterfaceData(btStridingMeshInterfaceData *interfaceData)
virtual btOptimizedBvh * createOptimizedBvh()
acceleration and connectivity structures
btAlignedObjectArray< btTriangleIndexVertexArray * > m_allocatedTriangleIndexArrays
virtual btCollisionShape * createCylinderShapeX(btScalar radius, btScalar height)
bool convertAllObjects(btBulletSerializedArrays *arrays)
btCollisionShape * getCollisionShapeByName(const char *name)
virtual btCollisionShape * createPlaneShape(const btVector3 &planeNormal, btScalar planeConstant)
shapes
char * duplicateName(const char *name)
virtual class btTriangleIndexVertexArray * createTriangleMeshContainer()
btCollisionShape * convertCollisionShape(btCollisionShapeData *shapeData)
void setVerboseMode(int verboseMode)
virtual btCollisionShape * createConeShapeZ(btScalar radius, btScalar height)
btTriangleInfoMap * getTriangleInfoMapByIndex(int index) const
btAlignedObjectArray< btCollisionObject * > m_allocatedRigidBodies
virtual class btCompoundShape * createCompoundShape()
virtual class btMultiSphereShape * createMultiSphereShape(const btVector3 *positions, const btScalar *radi, int numSpheres)
btHashMap< btHashPtr, btCollisionShape * > m_shapeMap
virtual btCollisionShape * createConeShapeY(btScalar radius, btScalar height)
virtual btCollisionShape * createSphereShape(btScalar radius)
btHashMap< btHashPtr, btTriangleInfoMap * > m_timMap
btCollisionShape * getCollisionShapeByIndex(int index)
virtual btCollisionShape * createBoxShape(const btVector3 &halfExtents)
btAlignedObjectArray< btVector3DoubleData * > m_doubleVertexArrays
virtual btCollisionShape * createCylinderShapeZ(btScalar radius, btScalar height)
virtual class btConvexHullShape * createConvexHullShape()
btAlignedObjectArray< int * > m_indexArrays
const char * getNameForPointer(const void *ptr) const
virtual btTriangleInfoMap * createTriangleInfoMap()
virtual btCollisionShape * createConeShapeX(btScalar radius, btScalar height)
btHashMap< btHashString, btCollisionShape * > m_nameShapeMap
btCollisionObject * getCollisionObjectByName(const char *name)
btAlignedObjectArray< char * > m_allocatedNames
virtual btBvhTriangleMeshShape * createBvhTriangleMeshShape(btStridingMeshInterface *trimesh, btOptimizedBvh *bvh)
btAlignedObjectArray< short int * > m_shortIndexArrays
btAlignedObjectArray< btStridingMeshInterfaceData * > m_allocatedbtStridingMeshInterfaceDatas
btOptimizedBvh * getBvhByIndex(int index) const
btHashMap< btHashString, btCollisionObject * > m_nameColObjMap
btCollisionObject * getRigidBodyByIndex(int index) const
btHashMap< btHashPtr, btOptimizedBvh * > m_bvhMap
btHashMap< btHashPtr, const char * > m_objectNameMap
btAlignedObjectArray< btCollisionObject * > m_allocatedCollisionObjects
virtual btCollisionShape * createConvexTriangleMeshShape(btStridingMeshInterface *trimesh)
virtual class btScaledBvhTriangleMeshShape * createScaledTrangleMeshShape(btBvhTriangleMeshShape *meshShape, const btVector3 &localScalingbtBvhTriangleMeshShape)
virtual btCollisionShape * createCylinderShapeY(btScalar radius, btScalar height)
virtual btCollisionShape * createCapsuleShapeY(btScalar radius, btScalar height)
virtual btCollisionShape * createCapsuleShapeZ(btScalar radius, btScalar height)
btAlignedObjectArray< btVector3FloatData * > m_floatVertexArrays
btAlignedObjectArray< btTriangleInfoMap * > m_allocatedTriangleInfoMaps
virtual btCollisionObject * createCollisionObject(const btTransform &startTransform, btCollisionShape *shape, const char *bodyName)
those virtuals are called by load and can be overridden by the user
virtual btTriangleIndexVertexArray * createMeshInterface(btStridingMeshInterfaceData &meshData)
btHashMap< btHashPtr, btCollisionObject * > m_bodyMap
btCollisionWorldImporter(btCollisionWorld *world)
btAlignedObjectArray< unsigned char * > m_charIndexArrays
btAlignedObjectArray< btCollisionShape * > m_allocatedCollisionShapes
virtual btCollisionShape * createCapsuleShapeX(btScalar radius, btScalar height)
CollisionWorld is interface and container for the collision detection.
This class manages a mesh supplied by the btStridingMeshInterface interface.
World world
static RawVector< RawArray< int64_t, 0 > > arrays
MutableSpan< float3 > positions
do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64
do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64
The btTriangleInfoMap stores edge angle information for some triangles. You can compute this informat...
PointerRNA * ptr
Definition: wm_files.c:3480