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)
int getNumRigidBodies() const
btTransformFloatData m_worldTransform
const btTriangleInfoMap * getTriangleInfoMap() const
do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64 ...
btMeshPartData * m_meshPartsPtr
do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64 ...
void push_back(const T &_Val)
btCompoundShapeChildData * m_childShapePtr
btAlignedObjectArray< btTriangleIndexVertexArray * > m_allocatedTriangleIndexArrays
do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64 ...
btAlignedObjectArray< btCollisionShape * > m_allocatedCollisionShapes
virtual btOptimizedBvh * createOptimizedBvh()
acceleration and connectivity structures
The btIndexedMesh indexes a single vertex and index array.
btAlignedObjectArray< int * > m_indexArrays
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 void setLocalScaling(const btVector3 &scaling)
virtual btCollisionShape * createCylinderShapeZ(btScalar radius, btScalar height)
virtual btTriangleIndexVertexArray * createMeshInterface(btStridingMeshInterfaceData &meshData)
btAlignedObjectArray< btVector3DoubleData * > m_doubleVertexArrays
virtual btCollisionShape * createCylinderShapeX(btScalar radius, btScalar height)
char * duplicateName(const char *name)
const Value * find(const Key &key) const
virtual void addCollisionObject(btCollisionObject *collisionObject, int collisionFilterGroup=btBroadphaseProxy::DefaultFilter, int collisionFilterMask=btBroadphaseProxy::AllFilter)
virtual btTriangleInfoMap * createTriangleInfoMap()
btAlignedObjectArray< struct btQuantizedBvhFloatData * > m_bvhsFloat
btAlignedObjectArray< struct btQuantizedBvhDoubleData * > m_bvhsDouble
int m_localPositionArraySize
The btMultiSphereShape represents the convex hull of a collection of spheres.
btTriangleMeshShapeData m_trimeshShapeData
virtual btCollisionShape * createSphereShape(btScalar radius)
The btCapsuleShape represents a capsule around the Y axis, there is also the btCapsuleShapeX aligned ...
btVector3DoubleData * m_unscaledPointsDoublePtr
btAlignedObjectArray< btStridingMeshInterfaceData * > m_allocatedbtStridingMeshInterfaceDatas
int getNumTriangleInfoMaps() const
The btCollisionShape class provides an interface for collision shapes that can be shared among btColl...
btCollisionWorld * m_collisionWorld
btCapsuleShapeX represents a capsule around the Z axis the total height is height+2*radius, so the height is just the height between the center of each 'sphere' of the capsule caps.
btConeShape implements a Cone shape, around the X axis
const btScalar & getY() const
Return the y value.
virtual btCollisionShape * createCapsuleShapeX(btScalar radius, btScalar height)
The btSphereShape implements an implicit sphere, centered around a local origin with radius...
void setScaling(const btVector3 &scaling)
do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64 ...
ManifoldContactPoint collects and maintains persistent contactpoints.
btStridingMeshInterfaceData m_meshInterface
do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64 ...
virtual class btConvexHullShape * createConvexHullShape()
btVector3FloatData * m_vertices3f
void addChildShape(const btTransform &localTransform, btCollisionShape *shape)
This class manages a mesh supplied by the btStridingMeshInterface interface.
Used for GIMPACT Trimesh integration.
btTriangleInfoMapData * m_triangleInfoMap
virtual void setMargin(btScalar collisionMargin)
virtual btCollisionShape * createPlaneShape(const btVector3 &planeNormal, btScalar planeConstant)
shapes
virtual btBvhTriangleMeshShape * createBvhTriangleMeshShape(btStridingMeshInterface *trimesh, btOptimizedBvh *bvh)
void setRestitution(btScalar rest)
btAlignedObjectArray< char * > m_allocatedNames
int getNumCollisionShapes() const
PHY_ScalarType m_indexType
btShortIntIndexData * m_indices16
void clear()
clear the array, deallocated memory. Generally it is better to use array.resize(0), to reduce performance overhead of run-time memory (de)allocations.
btAlignedObjectArray< unsigned char * > m_charIndexArrays
const char * getNameForPointer(const void *ptr) const
btCharIndexTripletData * m_3indices8
virtual void setCollisionShape(btCollisionShape *collisionShape)
btCollisionObject * getRigidBodyByIndex(int index) const
const btScalar & getZ() const
Return the z value.
The btBvhTriangleMeshShape is a static-triangle mesh shape, it can only be used for fixed/non-moving ...
do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64 ...
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.
virtual class btCompoundShape * createCompoundShape()
The btTriangleIndexVertexArray allows to access multiple triangle meshes, by indexing into existing t...
virtual void setMargin(btScalar margin)
do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64 ...
virtual btCollisionShape * createCapsuleShapeZ(btScalar radius, btScalar height)
do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64 ...
btShortIntIndexTripletData * m_3indices16
void addIndexedMesh(const btIndexedMesh &mesh, PHY_ScalarType indexType=PHY_INTEGER)
int m_triangleIndexStride
btAlignedObjectArray< struct btCollisionObjectFloatData * > m_collisionObjectDataFloat
btOptimizedBvh * getBvhByIndex(int index) const
void setFriction(btScalar frict)
virtual class btScaledBvhTriangleMeshShape * createScaledTrangleMeshShape(btBvhTriangleMeshShape *meshShape, const btVector3 &localScalingbtBvhTriangleMeshShape)
do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64 ...
virtual void deSerializeDouble(struct btQuantizedBvhDoubleData &quantizedBvhDoubleData)
btAlignedObjectArray< struct btCollisionShapeData * > m_colShapeData
The btConeShape implements a cone shape primitive, centered around the origin and aligned with the Y ...
unsigned char m_values[3]
btPositionAndRadius * m_localPositionArrayPtr
btHashMap< btHashPtr, btOptimizedBvh * > m_bvhMap
btStridingMeshInterfaceData m_meshInterface
btTransformFloatData m_transform
#define btAlignedFree(ptr)
btCollisionShape * convertCollisionShape(btCollisionShapeData *shapeData)
btCollisionObject can be used to manage collision detection objects.
void setOptimizedBvh(btOptimizedBvh *bvh, const btVector3 &localScaling=btVector3(1, 1, 1))
btAlignedObjectArray< btVector3FloatData * > m_floatVertexArrays
void insert(const Key &key, const Value &value)
The btOptimizedBvh extends the btQuantizedBvh to create AABB tree for triangle meshes, through the btStridingMeshInterface.
btVector3FloatData m_localScaling
virtual void removeCollisionObject(btCollisionObject *collisionObject)
btVector3FloatData m_scaling
virtual void setMargin(btScalar margin)=0
const unsigned char * m_triangleIndexBase
btHashMap< btHashString, btCollisionObject * > m_nameColObjMap
void setWorldTransform(const btTransform &worldTrans)
btVector3FloatData m_implicitShapeDimensions
btVector3FloatData * m_unscaledPointsFloatPtr
btVector3FloatData m_localScaling
virtual void setLocalScaling(const btVector3 &scaling)=0
btQuantizedBvhDoubleData * m_quantizedDoubleBvh
int getCollisionFlags() const
btAlignedObjectArray< btCollisionObject * > m_allocatedRigidBodies
The btBoxShape is a box primitive around the origin, its sides axis aligned with length specified by ...
btHashMap< btHashPtr, btCollisionObject * > m_bodyMap
btVector3 can be used to represent 3D points and vectors.
bool(* ContactAddedCallback)(btManifoldPoint &cp, const btCollisionObjectWrapper *colObj0Wrap, int partId0, int index0, const btCollisionObjectWrapper *colObj1Wrap, int partId1, int index1)
int size() const
return the number of elements in the array
btAlignedObjectArray< btCollisionObject * > m_allocatedCollisionObjects
btAlignedObjectArray< struct btCollisionObjectDoubleData * > m_collisionObjectDataDouble
The btStridingMeshInterface is the interface class for high performance generic access to triangle me...
CollisionWorld is interface and container for the collision detection.
btConeShapeZ implements a Cone shape, around the Z axis
btCollisionShape * getCollisionShapeByIndex(int index)
void setCollisionFlags(int flags)
virtual btCollisionShape * createConeShapeY(btScalar radius, btScalar height)
virtual btStridingMeshInterfaceData * createStridingMeshInterfaceData(btStridingMeshInterfaceData *interfaceData)
btTransformDoubleData m_worldTransform
virtual void deSerializeFloat(struct btQuantizedBvhFloatData &quantizedBvhFloatData)
do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64 ...
virtual int getNumSubParts() const
getNumSubParts returns the number of seperate subparts each subpart has a continuous array of vertice...
btAlignedObjectArray< btTriangleInfoMap * > m_allocatedTriangleInfoMaps
bool convertAllObjects(btBulletSerializedArrays *arrays)
void resize(int newsize, const T &fillData=T())
do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64 ...
btHashMap< btHashString, btCollisionShape * > m_nameShapeMap
virtual class btMultiSphereShape * createMultiSphereShape(const btVector3 *positions, const btScalar *radi, int numSpheres)
virtual btCollisionShape * createBoxShape(const btVector3 &halfExtents)
virtual btCollisionShape * createCylinderShapeY(btScalar radius, btScalar height)
btHashMap< btHashPtr, const char * > m_objectNameMap
do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64 ...
void deSerialize(struct btTriangleInfoMapData &data)
fills the dataBuffer and returns the struct name (and 0 on failure)
btVector3FloatData m_localScaling
The btCylinderShape class implements a cylinder shape primitive, centered around the origin...
ContactAddedCallback gContactAddedCallback
This is to allow MaterialCombiner/Custom Friction/Restitution values.
virtual class btTriangleIndexVertexArray * createTriangleMeshContainer()
virtual btCollisionShape * createConeShapeZ(btScalar radius, btScalar height)
The btScaledBvhTriangleMeshShape allows to instance a scaled version of an existing btBvhTriangleMesh...
virtual void deleteAllData()
delete all memory collision shapes, rigid bodies, constraints etc.
#define btAlignedAlloc(size, alignment)
btCapsuleShapeZ represents a capsule around the Z axis the total height is height+2*radius, so the height is just the height between the center of each 'sphere' of the capsule caps.
btIntIndexData * m_indices32
void deSerializeFloat(struct btCapsuleShapeData *dataBuffer)
void setTriangleInfoMap(btTriangleInfoMap *triangleInfoMap)
btVector3FloatData m_planeNormal
void addPoint(const btVector3 &point, bool recalculateLocalAabb=true)
The btConvexHullShape implements an implicit convex hull of an array of vertices. ...
virtual btCollisionShape * createConeShapeX(btScalar radius, btScalar height)
The btTriangleInfoMap stores edge angle information for some triangles. You can compute this informat...
btQuantizedBvhFloatData * m_quantizedFloatBvh
The btCompoundShape allows to store multiple other btCollisionShapes This allows for moving concave c...
virtual ~btCollisionWorldImporter()
void updateBound()
performs refit operation
void deSerializeFloat(const struct btVector3FloatData &dataIn)
btCollisionShapeData * m_childShape
The btStaticPlaneShape simulates an infinite non-moving (static) collision plane. ...
btAlignedObjectArray< short int * > m_shortIndexArrays
virtual btCollisionShape * createCapsuleShapeY(btScalar radius, btScalar height)
btVector3FloatData m_localScaling
btCollisionObject * getCollisionObjectByName(const char *name)
btTriangleInfoMap * getTriangleInfoMapByIndex(int index) const
do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64 ...
btCollisionShape * getCollisionShapeByName(const char *name)
const btScalar & getX() const
Return the x value.
do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64 ...
float btScalar
The btScalar type abstracts floating point numbers, to easily switch between double and single floati...
PHY_ScalarType m_vertexType
virtual btCollisionShape * createConvexTriangleMeshShape(btStridingMeshInterface *trimesh)
const unsigned char * m_vertexBase
btCollisionWorldImporter(btCollisionWorld *world)
btAlignedObjectArray< btOptimizedBvh * > m_allocatedBvhs
btHashMap< btHashPtr, btCollisionShape * > m_shapeMap
virtual void setMargin(btScalar margin)
btVector3DoubleData * m_vertices3d