20#ifdef SUPPORT_GIMPACT_SHAPE_IMPORT
25:m_collisionWorld(world),
100#ifdef USE_INTERNAL_EDGE_UTILITY
104 if (
trimesh->getTriangleInfoMap())
113 printf(
"error: no shape found\n");
129#ifdef USE_INTERNAL_EDGE_UTILITY
133 if (
trimesh->getTriangleInfoMap())
142 printf(
"error: no shape found\n");
198 for(
int a = 0;a <
curData->m_numMeshParts;a++)
205 delete []
curPart->m_vertices3d;
208 delete []
curPart->m_indices32;
211 delete []
curPart->m_3indices16;
214 delete []
curPart->m_indices16;
217 delete []
curPart->m_3indices8;
220 delete []
curData->m_meshPartsPtr;
273 shape->setLocalScaling(localScaling);
290#ifdef SUPPORT_GIMPACT_SHAPE_IMPORT
309 printf(
"unsupported gimpact sub type\n");
340 printf(
"error: wrong up axis for btCapsuleShape\n");
364 btVector3 margin(
bsd->m_collisionMargin,
bsd->m_collisionMargin,
bsd->m_collisionMargin);
404 printf(
"unknown Cylinder up axis\n");
436 printf(
"unknown Cone up axis\n");
457 tmpPos[i].deSerializeFloat(
mss->m_localPositionArrayPtr[i].m_pos);
458 radii[i] =
mss->m_localPositionArrayPtr[i].m_radius;
476#ifdef BT_USE_DOUBLE_PRECISION
500 printf(
"error: cannot create shape type (%d)\n",
shapeData->m_shapeType);
506 shape->setMargin(
bsd->m_collisionMargin);
510 shape->setLocalScaling(localScaling);
531 if (
trimesh->m_quantizedFloatBvh)
540 bvh->deSerializeFloat(*
trimesh->m_quantizedFloatBvh);
543 if (
trimesh->m_quantizedDoubleBvh)
552 bvh->deSerializeDouble(*
trimesh->m_quantizedDoubleBvh);
562 if (
trimesh->m_triangleInfoMap)
565 map->deSerialize(*
trimesh->m_triangleInfoMap);
568#ifdef USE_INTERNAL_EDGE_UTILITY
601 printf(
"error: couldn't create childShape for compoundShape\n");
656 for (
int i=0;i<
meshData.m_numMeshParts;i++)
663 if (
meshData.m_meshPartsPtr[i].m_indices32)
676 if (
meshData.m_meshPartsPtr[i].m_3indices16)
679 meshPart.m_triangleIndexStride =
sizeof(
short int)*3;
693 if (
meshData.m_meshPartsPtr[i].m_indices16)
696 meshPart.m_triangleIndexStride = 3*
sizeof(
short int);
707 if (
meshData.m_meshPartsPtr[i].m_3indices8)
710 meshPart.m_triangleIndexStride =
sizeof(
unsigned char)*3;
726 if (
meshData.m_meshPartsPtr[i].m_vertices3f)
740 meshPart.m_vertexBase = (
const unsigned char*)vertices;
757 meshPart.m_vertexBase = (
const unsigned char*)vertices;
779 for(
int i = 0;i <
newData->m_numMeshParts;i++)
803 int numIndices =
curNewPart->m_numTriangles * 3;
850#ifdef USE_INTERNAL_EDGE_UTILITY
1045#ifdef SUPPORT_GIMPACT_SHAPE_IMPORT
#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)
const T & btMax(const T &a, const T &b)
float btScalar
The btScalar type abstracts floating point numbers, to easily switch between double and single floati...
The btAlignedObjectArray template class uses a subset of the stl::vector interface for its methods It...
int size() const
return the number of elements in the array
void resize(int newsize, const T &fillData=T())
void clear()
clear the array, deallocated memory. Generally it is better to use array.resize(0),...
void push_back(const T &_Val)
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 ...
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)
void setFriction(btScalar frict)
int getCollisionFlags() const
The btCollisionShape class provides an interface for collision shapes that can be shared among btColl...
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...
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.
The btCylinderShape class implements a cylinder shape primitive, centered around the origin....
This class manages a mesh supplied by the btStridingMeshInterface interface.
void insert(const Key &key, const Value &value)
const Value * find(const Key &key) const
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,...
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...
The btTriangleIndexVertexArray allows to access multiple triangle meshes, by indexing into existing t...
btVector3 can be used to represent 3D points and vectors.
void deSerializeFloat(const struct btVector3FloatData &dataIn)
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
do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64
do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64
do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64
do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64
do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64
do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64
do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64
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 btIndexedMesh indexes a single vertex and index array.
do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64
btVector3FloatData * m_vertices3f
int m_localPositionArraySize
do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64
do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64
do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64
btVector3FloatData m_scaling
The btTriangleInfoMap stores edge angle information for some triangles. You can compute this informat...
do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64