20#ifdef SUPPORT_GIMPACT_SHAPE_IMPORT
25:m_collisionWorld(world),
76 if (shape&& shapeData->
m_name)
89 if (shapePtr && *shapePtr)
100#ifdef USE_INTERNAL_EDGE_UTILITY
113 printf(
"error: no shape found\n");
120 if (shapePtr && *shapePtr)
129#ifdef USE_INTERNAL_EDGE_UTILITY
142 printf(
"error: no shape found\n");
290#ifdef SUPPORT_GIMPACT_SHAPE_IMPORT
306 shape = gimpactShape;
309 printf(
"unsupported gimpact sub type\n");
340 printf(
"error: wrong up axis for btCapsuleShape\n");
384 btVector3 halfExtents = implicitShapeDimensions+margin;
404 printf(
"unknown Cylinder up axis\n");
416 btVector3 halfExtents = implicitShapeDimensions;
436 printf(
"unknown Cone up axis\n");
453 tmpPos.
resize(numSpheres);
455 for ( i=0;i<numSpheres;i++)
472 tmpPoints.
resize(numPoints);
474 for ( i=0;i<numPoints;i++)
476#ifdef BT_USE_DOUBLE_PRECISION
489 for (i=0;i<numPoints;i++)
500 printf(
"error: cannot create shape type (%d)\n",shapeData->
m_shapeType);
534 if (bvhPtr && *bvhPtr)
546 if (bvhPtr && *bvhPtr)
560 shape = trimeshShape;
568#ifdef USE_INTERNAL_EDGE_UTILITY
601 printf(
"error: couldn't create childShape for compoundShape\n");
606 shape = compoundShape;
617 printf(
"unsupported shape type (%d)\n",shapeData->
m_shapeType);
632 int l = (int)strlen(name);
633 char* newName =
new char[l+1];
634 memcpy(newName,name,l);
766 return meshInterface;
806 bool uninitialized3indices8Workaround =
false;
810 uninitialized3indices8Workaround=
true;
819 uninitialized3indices8Workaround=
true;
828 uninitialized3indices8Workaround=
true;
835 if(!uninitialized3indices8Workaround && curPart->
m_3indices8)
850#ifdef USE_INTERNAL_EDGE_UTILITY
894 if (bodyPtr && *bodyPtr)
1045#ifdef SUPPORT_GIMPACT_SHAPE_IMPORT
1100 if (shapePtr&& *shapePtr)
1111 if (namePtr && *namePtr)
#define btAlignedFree(ptr)
#define btAlignedAlloc(size, alignment)
@ COMPOUND_SHAPE_PROXYTYPE
@ GIMPACT_SHAPE_PROXYTYPE
Used for GIMPACT Trimesh integration.
@ SOFTBODY_SHAPE_PROXYTYPE
@ SCALED_TRIANGLE_MESH_SHAPE_PROXYTYPE
@ TRIANGLE_MESH_SHAPE_PROXYTYPE
@ MULTI_SPHERE_SHAPE_PROXYTYPE
@ CYLINDER_SHAPE_PROXYTYPE
@ CAPSULE_SHAPE_PROXYTYPE
@ CONVEX_HULL_SHAPE_PROXYTYPE
@ CONST_GIMPACT_TRIMESH_SHAPE
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.
ContactAddedCallback gContactAddedCallback
This is to allow MaterialCombiner/Custom Friction/Restitution values.
bool(* ContactAddedCallback)(btManifoldPoint &cp, const btCollisionObjectWrapper *colObj0Wrap, int partId0, int index0, const btCollisionObjectWrapper *colObj1Wrap, int partId1, int index1)
float btScalar
The btScalar type abstracts floating point numbers, to easily switch between double and single floati...
void resize(int newsize, const T &fillData=T())
The btBoxShape is a box primitive around the origin, its sides axis aligned with length specified by ...
The btBvhTriangleMeshShape is a static-triangle mesh shape, it can only be used for fixed/non-moving ...
void setOptimizedBvh(btOptimizedBvh *bvh, const btVector3 &localScaling=btVector3(1, 1, 1))
const btTriangleInfoMap * getTriangleInfoMap() const
void setTriangleInfoMap(btTriangleInfoMap *triangleInfoMap)
btCapsuleShapeX represents a capsule around the Z axis the total height is height+2*radius,...
btCapsuleShapeZ represents a capsule around the Z axis the total height is height+2*radius,...
The btCapsuleShape represents a capsule around the Y axis, there is also the btCapsuleShapeX aligned ...
void deSerializeFloat(struct btCapsuleShapeData *dataBuffer)
btCollisionObject can be used to manage collision detection objects.
@ CF_CUSTOM_MATERIAL_CALLBACK
void setRestitution(btScalar rest)
void setCollisionFlags(int flags)
virtual void setCollisionShape(btCollisionShape *collisionShape)
void setWorldTransform(const btTransform &worldTrans)
void setFriction(btScalar frict)
int getCollisionFlags() const
The btCollisionShape class provides an interface for collision shapes that can be shared among btColl...
virtual void setMargin(btScalar margin)=0
virtual void setLocalScaling(const btVector3 &scaling)=0
btAlignedObjectArray< btOptimizedBvh * > m_allocatedBvhs
btHashMap< btHashPtr, btCollisionShape * > m_shapeMap
virtual void deleteAllData()
delete all memory collision shapes, rigid bodies, constraints etc.
virtual ~btCollisionWorldImporter()
virtual btStridingMeshInterfaceData * createStridingMeshInterfaceData(btStridingMeshInterfaceData *interfaceData)
virtual btOptimizedBvh * createOptimizedBvh()
acceleration and connectivity structures
btAlignedObjectArray< btTriangleIndexVertexArray * > m_allocatedTriangleIndexArrays
virtual btCollisionShape * createCylinderShapeX(btScalar radius, btScalar height)
btHashMap< btHashPtr, btCollisionObject * > m_bodyMap
bool convertAllObjects(btBulletSerializedArrays *arrays)
int getNumTriangleInfoMaps() const
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)
virtual btCollisionShape * createConeShapeZ(btScalar radius, btScalar height)
btTriangleInfoMap * getTriangleInfoMapByIndex(int index) const
btAlignedObjectArray< btCollisionObject * > m_allocatedRigidBodies
btCollisionWorld * m_collisionWorld
btHashMap< btHashPtr, const char * > m_objectNameMap
virtual class btCompoundShape * createCompoundShape()
virtual class btMultiSphereShape * createMultiSphereShape(const btVector3 *positions, const btScalar *radi, int numSpheres)
virtual btCollisionShape * createConeShapeY(btScalar radius, btScalar height)
virtual btCollisionShape * createSphereShape(btScalar radius)
btCollisionShape * getCollisionShapeByIndex(int index)
btHashMap< btHashString, btCollisionObject * > m_nameColObjMap
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()
int getNumCollisionShapes() const
virtual btCollisionShape * createConeShapeX(btScalar radius, btScalar height)
btCollisionObject * getCollisionObjectByName(const char *name)
btAlignedObjectArray< char * > m_allocatedNames
btHashMap< btHashPtr, btOptimizedBvh * > m_bvhMap
virtual btBvhTriangleMeshShape * createBvhTriangleMeshShape(btStridingMeshInterface *trimesh, btOptimizedBvh *bvh)
btAlignedObjectArray< short int * > m_shortIndexArrays
btAlignedObjectArray< btStridingMeshInterfaceData * > m_allocatedbtStridingMeshInterfaceDatas
btOptimizedBvh * getBvhByIndex(int index) const
btCollisionObject * getRigidBodyByIndex(int index) const
int getNumRigidBodies() const
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< btHashString, btCollisionShape * > m_nameShapeMap
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.
virtual void removeCollisionObject(btCollisionObject *collisionObject)
virtual void addCollisionObject(btCollisionObject *collisionObject, int collisionFilterGroup=btBroadphaseProxy::DefaultFilter, int collisionFilterMask=btBroadphaseProxy::AllFilter)
The btCompoundShape allows to store multiple other btCollisionShapes This allows for moving concave c...
void addChildShape(const btTransform &localTransform, btCollisionShape *shape)
virtual void setMargin(btScalar collisionMargin)
btConeShape implements a Cone shape, around the X axis
btConeShapeZ implements a Cone shape, around the Z axis
The btConeShape implements a cone shape primitive, centered around the origin and aligned with the Y ...
The btConvexHullShape implements an implicit convex hull of an array of vertices.
void addPoint(const btVector3 &point, bool recalculateLocalAabb=true)
virtual void setMargin(btScalar margin)
The btCylinderShape class implements a cylinder shape primitive, centered around the origin....
This class manages a mesh supplied by the btStridingMeshInterface interface.
virtual void setMargin(btScalar margin)
virtual void setLocalScaling(const btVector3 &scaling)
void updateBound()
performs refit operation
ManifoldContactPoint collects and maintains persistent contactpoints.
The btMultiSphereShape represents the convex hull of a collection of spheres.
The btOptimizedBvh extends the btQuantizedBvh to create AABB tree for triangle meshes,...
virtual void deSerializeFloat(struct btQuantizedBvhFloatData &quantizedBvhFloatData)
virtual void deSerializeDouble(struct btQuantizedBvhDoubleData &quantizedBvhDoubleData)
The btScaledBvhTriangleMeshShape allows to instance a scaled version of an existing btBvhTriangleMesh...
The btSphereShape implements an implicit sphere, centered around a local origin with radius.
The btStaticPlaneShape simulates an infinite non-moving (static) collision plane.
The btStridingMeshInterface is the interface class for high performance generic access to triangle me...
void setScaling(const btVector3 &scaling)
The btTriangleIndexVertexArray allows to access multiple triangle meshes, by indexing into existing t...
void addIndexedMesh(const btIndexedMesh &mesh, PHY_ScalarType indexType=PHY_INTEGER)
virtual int getNumSubParts() const
getNumSubParts returns the number of seperate subparts each subpart has a continuous array of vertice...
btVector3 can be used to represent 3D points and vectors.
const btScalar & getZ() const
Return the z value.
void deSerializeFloat(const struct btVector3FloatData &dataIn)
const btScalar & getY() const
Return the y value.
const btScalar & getX() const
Return the x value.
btAlignedObjectArray< struct btQuantizedBvhDoubleData * > m_bvhsDouble
btAlignedObjectArray< struct btCollisionObjectFloatData * > m_collisionObjectDataFloat
btAlignedObjectArray< struct btCollisionObjectDoubleData * > m_collisionObjectDataDouble
btAlignedObjectArray< struct btCollisionShapeData * > m_colShapeData
btAlignedObjectArray< struct btQuantizedBvhFloatData * > m_bvhsFloat
do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64
unsigned char m_values[3]
do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64
btTransformDoubleData m_worldTransform
do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64
btTransformFloatData m_worldTransform
do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64
btTransformFloatData m_transform
btCollisionShapeData * m_childShape
do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64
btCompoundShapeChildData * m_childShapePtr
do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64
do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64
btVector3DoubleData * m_unscaledPointsDoublePtr
btVector3FloatData * m_unscaledPointsFloatPtr
do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64
btVector3FloatData m_implicitShapeDimensions
btVector3FloatData m_localScaling
do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64
do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64
btStridingMeshInterfaceData m_meshInterface
btVector3FloatData m_localScaling
The btIndexedMesh indexes a single vertex and index array.
PHY_ScalarType m_indexType
int m_triangleIndexStride
const unsigned char * m_vertexBase
const unsigned char * m_triangleIndexBase
PHY_ScalarType m_vertexType
do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64
btShortIntIndexData * m_indices16
btCharIndexTripletData * m_3indices8
btVector3FloatData * m_vertices3f
btShortIntIndexTripletData * m_3indices16
btIntIndexData * m_indices32
btVector3DoubleData * m_vertices3d
int m_localPositionArraySize
btPositionAndRadius * m_localPositionArrayPtr
do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64
btTriangleMeshShapeData m_trimeshShapeData
btVector3FloatData m_localScaling
do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64
btVector3FloatData m_localScaling
btVector3FloatData m_planeNormal
do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64
btMeshPartData * m_meshPartsPtr
btVector3FloatData m_scaling
The btTriangleInfoMap stores edge angle information for some triangles. You can compute this informat...
void deSerialize(struct btTriangleInfoMapData &data)
fills the dataBuffer and returns the struct name (and 0 on failure)
do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64
btStridingMeshInterfaceData m_meshInterface
btQuantizedBvhDoubleData * m_quantizedDoubleBvh
btQuantizedBvhFloatData * m_quantizedFloatBvh
btTriangleInfoMapData * m_triangleInfoMap