Bullet Collision Detection & Physics Library
|
Go to the documentation of this file.
20 #ifdef SUPPORT_GIMPACT_SHAPE_IMPORT
22 #endif //SUPPORT_GIMPACT_SHAPE_IMPORT
25 : m_collisionWorld(world),
66 if (shape && shapeData->
m_name)
78 if (shapePtr && *shapePtr)
89 #ifdef USE_INTERNAL_EDGE_UTILITY
98 #endif //USE_INTERNAL_EDGE_UTILITY
103 printf(
"error: no shape found\n");
110 if (shapePtr && *shapePtr)
119 #ifdef USE_INTERNAL_EDGE_UTILITY
128 #endif //USE_INTERNAL_EDGE_UTILITY
133 printf(
"error: no shape found\n");
272 #ifdef SUPPORT_GIMPACT_SHAPE_IMPORT
287 shape = gimpactShape;
291 printf(
"unsupported gimpact sub type\n");
295 #endif //SUPPORT_GIMPACT_SHAPE_IMPORT \
296 //The btCapsuleShape* API has issue passing the margin/scaling/halfextents unmodified through the API \
321 printf(
"error: wrong up axis for btCapsuleShape\n");
363 btVector3 halfExtents = implicitShapeDimensions + margin;
383 printf(
"unknown Cylinder up axis\n");
392 btVector3 halfExtents = implicitShapeDimensions;
412 printf(
"unknown Cone up axis\n");
426 tmpPos.
resize(numSpheres);
428 for (i = 0; i < numSpheres; i++)
445 tmpPoints.
resize(numPoints);
447 for (i = 0; i < numPoints; i++)
449 #ifdef BT_USE_DOUBLE_PRECISION
459 #endif //BT_USE_DOUBLE_PRECISION
462 for (i = 0; i < numPoints; i++)
473 printf(
"error: cannot create shape type (%d)\n", shapeData->
m_shapeType);
506 if (bvhPtr && *bvhPtr)
519 if (bvhPtr && *bvhPtr)
533 shape = trimeshShape;
541 #ifdef USE_INTERNAL_EDGE_UTILITY
543 #endif //USE_INTERNAL_EDGE_UTILITY
573 printf(
"error: couldn't create childShape for compoundShape\n");
577 shape = compoundShape;
588 printf(
"unsupported shape type (%d)\n", shapeData->
m_shapeType);
600 int l = (int)strlen(name);
601 char* newName =
new char[l + 1];
602 memcpy(newName, name, l);
724 return meshInterface;
763 bool uninitialized3indices8Workaround =
false;
767 uninitialized3indices8Workaround =
true;
776 uninitialized3indices8Workaround =
true;
785 uninitialized3indices8Workaround =
true;
792 if (!uninitialized3indices8Workaround && curPart->
m_3indices8)
806 #ifdef USE_INTERNAL_EDGE_UTILITY
816 #endif //USE_INTERNAL_EDGE_UTILITY
848 if (bodyPtr && *bodyPtr)
994 #ifdef SUPPORT_GIMPACT_SHAPE_IMPORT
1001 #endif //SUPPORT_GIMPACT_SHAPE_IMPORT
1045 if (shapePtr && *shapePtr)
1055 if (namePtr && *namePtr)
char * duplicateName(const char *name)
do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64
btAlignedObjectArray< struct btQuantizedBvhDoubleData * > m_bvhsDouble
btShortIntIndexTripletData * m_3indices16
btCollisionObject can be used to manage collision detection objects.
btHashMap< btHashString, btCollisionObject * > m_nameColObjMap
btOptimizedBvh * getBvhByIndex(int index) const
virtual void deleteAllData()
delete all memory collision shapes, rigid bodies, constraints etc.
btCollisionShapeData * m_childShape
btCollisionShape * getCollisionShapeByIndex(int index)
#define btAlignedFree(ptr)
virtual btBvhTriangleMeshShape * createBvhTriangleMeshShape(btStridingMeshInterface *trimesh, btOptimizedBvh *bvh)
virtual class btMultiSphereShape * createMultiSphereShape(const btVector3 *positions, const btScalar *radi, int numSpheres)
The btOptimizedBvh extends the btQuantizedBvh to create AABB tree for triangle meshes,...
virtual btCollisionShape * createCylinderShapeZ(btScalar radius, btScalar height)
float btScalar
The btScalar type abstracts floating point numbers, to easily switch between double and single floati...
The btBoxShape is a box primitive around the origin, its sides axis aligned with length specified by ...
btVector3FloatData * m_unscaledPointsFloatPtr
btVector3FloatData * m_vertices3f
do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64
btCollisionShape * getCollisionShapeByName(const char *name)
btHashMap< btHashPtr, btOptimizedBvh * > m_bvhMap
do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64
void btAdjustInternalEdgeContacts(btManifoldPoint &cp, const btCollisionObjectWrapper *colObj0Wrap, const btCollisionObjectWrapper *colObj1Wrap, int partId0, int index0, int normalAdjustFlags)
Changes a btManifoldPoint collision normal to the normal from the mesh.
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 btBvhTriangleMeshShape is a static-triangle mesh shape, it can only be used for fixed/non-moving ...
btTransformFloatData m_transform
btTriangleInfoMap * getTriangleInfoMapByIndex(int index) const
virtual btCollisionShape * createCylinderShapeX(btScalar radius, btScalar height)
PHY_ScalarType m_vertexType
btAlignedObjectArray< struct btQuantizedBvhFloatData * > m_bvhsFloat
void setScaling(const btVector3 &scaling)
do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64
void clear()
clear the array, deallocated memory. Generally it is better to use array.resize(0),...
btShortIntIndexData * m_indices16
ContactAddedCallback gContactAddedCallback
This is to allow MaterialCombiner/Custom Friction/Restitution values.
virtual class btTriangleIndexVertexArray * createTriangleMeshContainer()
btHashMap< btHashPtr, btCollisionShape * > m_shapeMap
bool convertAllObjects(btBulletSerializedArrays *arrays)
virtual btTriangleInfoMap * createTriangleInfoMap()
#define btAlignedAlloc(size, alignment)
btAlignedObjectArray< btCollisionObject * > m_allocatedRigidBodies
btTransformDoubleData m_worldTransform
btAlignedObjectArray< int * > m_indexArrays
virtual btOptimizedBvh * createOptimizedBvh()
acceleration and connectivity structures
btHashMap< btHashString, btCollisionShape * > m_nameShapeMap
virtual void setLocalScaling(const btVector3 &scaling)
virtual btCollisionShape * createSphereShape(btScalar radius)
This class manages a mesh supplied by the btStridingMeshInterface interface.
void deSerialize(struct btTriangleInfoMapData &data)
fills the dataBuffer and returns the struct name (and 0 on failure)
const unsigned char * m_triangleIndexBase
do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64
virtual class btConvexHullShape * createConvexHullShape()
btHashMap< btHashPtr, btCollisionObject * > m_bodyMap
int m_localPositionArraySize
btAlignedObjectArray< btStridingMeshInterfaceData * > m_allocatedbtStridingMeshInterfaceDatas
btStridingMeshInterfaceData m_meshInterface
virtual btCollisionShape * createConeShapeZ(btScalar radius, btScalar height)
btAlignedObjectArray< struct btCollisionShapeData * > m_colShapeData
virtual btTriangleIndexVertexArray * createMeshInterface(btStridingMeshInterfaceData &meshData)
Used for GIMPACT Trimesh integration.
do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64
The btStridingMeshInterface is the interface class for high performance generic access to triangle me...
const btScalar & getX() const
Return the x value.
void setOptimizedBvh(btOptimizedBvh *bvh, const btVector3 &localScaling=btVector3(1, 1, 1))
btTriangleInfoMapData * m_triangleInfoMap
The btCollisionShape class provides an interface for collision shapes that can be shared among btColl...
btAlignedObjectArray< btOptimizedBvh * > m_allocatedBvhs
btVector3FloatData m_localScaling
btCapsuleShapeX represents a capsule around the Z axis the total height is height+2*radius,...
void setRestitution(btScalar rest)
virtual void setMargin(btScalar collisionMargin)
virtual void setCollisionShape(btCollisionShape *collisionShape)
ManifoldContactPoint collects and maintains persistent contactpoints.
btPositionAndRadius * m_localPositionArrayPtr
The btMultiSphereShape represents the convex hull of a collection of spheres.
btCollisionWorld * m_collisionWorld
virtual ~btCollisionWorldImporter()
btStridingMeshInterfaceData m_meshInterface
btCollisionObject * getCollisionObjectByName(const char *name)
void resize(int newsize, const T &fillData=T())
btAlignedObjectArray< btVector3DoubleData * > m_doubleVertexArrays
The btTriangleInfoMap stores edge angle information for some triangles. You can compute this informat...
virtual btCollisionShape * createConvexTriangleMeshShape(btStridingMeshInterface *trimesh)
virtual void setMargin(btScalar margin)
virtual btCollisionShape * createCylinderShapeY(btScalar radius, btScalar height)
btTransformFloatData m_worldTransform
btAlignedObjectArray< struct btCollisionObjectFloatData * > m_collisionObjectDataFloat
btCompoundShapeChildData * m_childShapePtr
void setFriction(btScalar frict)
virtual void deSerializeDouble(struct btQuantizedBvhDoubleData &quantizedBvhDoubleData)
btAlignedObjectArray< struct btCollisionObjectDoubleData * > m_collisionObjectDataDouble
void setWorldTransform(const btTransform &worldTrans)
btQuantizedBvhDoubleData * m_quantizedDoubleBvh
int getCollisionFlags() const
virtual btCollisionShape * createConeShapeY(btScalar radius, btScalar height)
bool(* ContactAddedCallback)(btManifoldPoint &cp, const btCollisionObjectWrapper *colObj0Wrap, int partId0, int index0, const btCollisionObjectWrapper *colObj1Wrap, int partId1, int index1)
The btIndexedMesh indexes a single vertex and index array.
btConeShapeZ implements a Cone shape, around the Z axis
The btCapsuleShape represents a capsule around the Y axis, there is also the btCapsuleShapeX aligned ...
virtual btCollisionShape * createCapsuleShapeZ(btScalar radius, btScalar height)
The btSphereShape implements an implicit sphere, centered around a local origin with radius.
btVector3 can be used to represent 3D points and vectors.
virtual btCollisionShape * createPlaneShape(const btVector3 &planeNormal, btScalar planeConstant)
shapes
do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64
int m_triangleIndexStride
btVector3DoubleData * m_vertices3d
btAlignedObjectArray< unsigned char * > m_charIndexArrays
const char * getNameForPointer(const void *ptr) const
do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64
virtual void deSerializeFloat(struct btQuantizedBvhFloatData &quantizedBvhFloatData)
unsigned char m_values[3]
virtual btCollisionShape * createConeShapeX(btScalar radius, btScalar height)
do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64
void setTriangleInfoMap(btTriangleInfoMap *triangleInfoMap)
const btScalar & getZ() const
Return the z value.
btIntIndexData * m_indices32
btAlignedObjectArray< btTriangleIndexVertexArray * > m_allocatedTriangleIndexArrays
virtual btCollisionShape * createCapsuleShapeY(btScalar radius, btScalar height)
const btScalar & getY() const
Return the y value.
int getNumCollisionShapes() const
const Value * find(const Key &key) const
btAlignedObjectArray< char * > m_allocatedNames
btQuantizedBvhFloatData * m_quantizedFloatBvh
The btCompoundShape allows to store multiple other btCollisionShapes This allows for moving concave c...
The btConvexHullShape implements an implicit convex hull of an array of vertices.
virtual void removeCollisionObject(btCollisionObject *collisionObject)
virtual void setMargin(btScalar margin)=0
int getNumTriangleInfoMaps() const
void setCollisionFlags(int flags)
btVector3FloatData m_localScaling
void addChildShape(const btTransform &localTransform, btCollisionShape *shape)
btVector3FloatData m_planeNormal
btVector3DoubleData * m_unscaledPointsDoublePtr
void insert(const Key &key, const Value &value)
btVector3FloatData m_localScaling
The btStaticPlaneShape simulates an infinite non-moving (static) collision plane.
virtual int getNumSubParts() const
getNumSubParts returns the number of seperate subparts each subpart has a continuous array of vertice...
btMeshPartData * m_meshPartsPtr
void addIndexedMesh(const btIndexedMesh &mesh, PHY_ScalarType indexType=PHY_INTEGER)
The btConeShape implements a cone shape primitive, centered around the origin and aligned with the Y ...
btAlignedObjectArray< btTriangleInfoMap * > m_allocatedTriangleInfoMaps
btCollisionObject * getRigidBodyByIndex(int index) const
void deSerializeFloat(struct btCapsuleShapeData *dataBuffer)
virtual btCollisionShape * createCapsuleShapeX(btScalar radius, btScalar height)
virtual btStridingMeshInterfaceData * createStridingMeshInterfaceData(btStridingMeshInterfaceData *interfaceData)
btHashMap< btHashPtr, const char * > m_objectNameMap
virtual void setMargin(btScalar margin)
btVector3FloatData m_scaling
The btCylinderShape class implements a cylinder shape primitive, centered around the origin....
virtual btCollisionShape * createBoxShape(const btVector3 &halfExtents)
CollisionWorld is interface and container for the collision detection.
virtual class btCompoundShape * createCompoundShape()
btVector3FloatData m_localScaling
virtual void setLocalScaling(const btVector3 &scaling)=0
void deSerializeFloat(const struct btVector3FloatData &dataIn)
btAlignedObjectArray< short int * > m_shortIndexArrays
int getNumRigidBodies() const
void addPoint(const btVector3 &point, bool recalculateLocalAabb=true)
const btTriangleInfoMap * getTriangleInfoMap() const
do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64
The btTriangleIndexVertexArray allows to access multiple triangle meshes, by indexing into existing t...
do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64
virtual void addCollisionObject(btCollisionObject *collisionObject, int collisionFilterGroup=btBroadphaseProxy::DefaultFilter, int collisionFilterMask=btBroadphaseProxy::AllFilter)
btAlignedObjectArray< btCollisionObject * > m_allocatedCollisionObjects
void push_back(const T &_Val)
do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64
void updateBound()
performs refit operation
const unsigned char * m_vertexBase
btCollisionShape * convertCollisionShape(btCollisionShapeData *shapeData)
btCollisionWorldImporter(btCollisionWorld *world)
btAlignedObjectArray< btVector3FloatData * > m_floatVertexArrays
do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64
The btScaledBvhTriangleMeshShape allows to instance a scaled version of an existing btBvhTriangleMesh...
virtual btCollisionObject * createCollisionObject(const btTransform &startTransform, btCollisionShape *shape, const char *bodyName)
those virtuals are called by load and can be overridden by the user
btCapsuleShapeZ represents a capsule around the Z axis the total height is height+2*radius,...
PHY_ScalarType m_indexType
btTriangleMeshShapeData m_trimeshShapeData
btVector3FloatData m_implicitShapeDimensions
btConeShape implements a Cone shape, around the X axis
int size() const
return the number of elements in the array
btCharIndexTripletData * m_3indices8
virtual class btScaledBvhTriangleMeshShape * createScaledTrangleMeshShape(btBvhTriangleMeshShape *meshShape, const btVector3 &localScalingbtBvhTriangleMeshShape)
btAlignedObjectArray< btCollisionShape * > m_allocatedCollisionShapes