20 #ifdef SUPPORT_GIMPACT_SHAPE_IMPORT 22 #endif //SUPPORT_GIMPACT_SHAPE_IMPORT 25 :m_collisionWorld(world),
76 if (shape&& shapeData->
m_name)
89 if (shapePtr && *shapePtr)
100 #ifdef USE_INTERNAL_EDGE_UTILITY 109 #endif //USE_INTERNAL_EDGE_UTILITY 113 printf(
"error: no shape found\n");
120 if (shapePtr && *shapePtr)
129 #ifdef USE_INTERNAL_EDGE_UTILITY 138 #endif //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");
313 #endif //SUPPORT_GIMPACT_SHAPE_IMPORT 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 486 #endif //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 570 #endif //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 861 #endif //USE_INTERNAL_EDGE_UTILITY 894 if (bodyPtr && *bodyPtr)
1045 #ifdef SUPPORT_GIMPACT_SHAPE_IMPORT 1053 #endif //SUPPORT_GIMPACT_SHAPE_IMPORT 1100 if (shapePtr&& *shapePtr)
1111 if (namePtr && *namePtr)
btTransformFloatData m_worldTransform
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
int getNumRigidBodies() const
virtual btOptimizedBvh * createOptimizedBvh()
acceleration and connectivity structures
btCollisionObject * getRigidBodyByIndex(int index) const
const btTriangleInfoMap * getTriangleInfoMap() const
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)
int getNumTriangleInfoMaps() const
btAlignedObjectArray< btVector3DoubleData * > m_doubleVertexArrays
virtual btCollisionShape * createCylinderShapeX(btScalar radius, btScalar height)
char * duplicateName(const char *name)
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
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
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.
int getCollisionFlags() const
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.
const char * getNameForPointer(const void *ptr) const
btTriangleInfoMapData * m_triangleInfoMap
virtual void setMargin(btScalar collisionMargin)
virtual btCollisionShape * createPlaneShape(const btVector3 &planeNormal, btScalar planeConstant)
shapes
btHashMap< btHashString, btCollisionObject * > m_nameColObjMap
virtual btBvhTriangleMeshShape * createBvhTriangleMeshShape(btStridingMeshInterface *trimesh, btOptimizedBvh *bvh)
btHashMap< btHashPtr, btCollisionObject * > m_bodyMap
void setRestitution(btScalar rest)
btAlignedObjectArray< char * > m_allocatedNames
PHY_ScalarType m_indexType
const btScalar & getZ() const
Return the z value.
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.
btTriangleInfoMap * getTriangleInfoMapByIndex(int index) const
btAlignedObjectArray< unsigned char * > m_charIndexArrays
btCharIndexTripletData * m_3indices8
virtual void setCollisionShape(btCollisionShape *collisionShape)
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)
int size() const
return the number of elements in the array
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
void setFriction(btScalar frict)
int getNumCollisionShapes() const
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
btStridingMeshInterfaceData m_meshInterface
btTransformFloatData m_transform
const btScalar & getY() const
Return the y value.
#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
const btScalar & getX() const
Return the x value.
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
void setWorldTransform(const btTransform &worldTrans)
btVector3FloatData m_implicitShapeDimensions
btVector3FloatData * m_unscaledPointsFloatPtr
btVector3FloatData m_localScaling
virtual void setLocalScaling(const btVector3 &scaling)=0
btQuantizedBvhDoubleData * m_quantizedDoubleBvh
btAlignedObjectArray< btCollisionObject * > m_allocatedRigidBodies
btHashMap< btHashPtr, btCollisionShape * > m_shapeMap
The btBoxShape is a box primitive around the origin, its sides axis aligned with length specified by ...
btVector3 can be used to represent 3D points and vectors.
const Value * find(const Key &key) const
bool(* ContactAddedCallback)(btManifoldPoint &cp, const btCollisionObjectWrapper *colObj0Wrap, int partId0, int index0, const btCollisionObjectWrapper *colObj1Wrap, int partId1, int index1)
btHashMap< btHashString, btCollisionShape * > m_nameShapeMap
btAlignedObjectArray< btCollisionObject * > m_allocatedCollisionObjects
btHashMap< btHashPtr, const char * > m_objectNameMap
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 ...
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 ...
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)
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...
virtual int getNumSubParts() const
getNumSubParts returns the number of seperate subparts each subpart has a continuous array of vertice...
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)
btHashMap< btHashPtr, btOptimizedBvh * > m_bvhMap
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
btOptimizedBvh * getBvhByIndex(int index) const
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)
do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64 ...
btCollisionShape * getCollisionShapeByName(const char *name)
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
virtual void setMargin(btScalar margin)
btVector3DoubleData * m_vertices3d