20#ifdef SUPPORT_GIMPACT_SHAPE_IMPORT
25 : m_collisionWorld(world),
89#ifdef USE_INTERNAL_EDGE_UTILITY
93 if (
trimesh->getTriangleInfoMap())
103 printf(
"error: no shape found\n");
119#ifdef USE_INTERNAL_EDGE_UTILITY
123 if (
trimesh->getTriangleInfoMap())
133 printf(
"error: no shape found\n");
185 for (
int a = 0; a <
curData->m_numMeshParts; a++)
192 delete[]
curPart->m_vertices3d;
198 delete[]
curPart->m_3indices16;
206 delete[]
curData->m_meshPartsPtr;
272#ifdef SUPPORT_GIMPACT_SHAPE_IMPORT
291 printf(
"unsupported gimpact sub type\n");
321 printf(
"error: wrong up axis for btCapsuleShape\n");
343 btVector3 margin(
bsd->m_collisionMargin,
bsd->m_collisionMargin,
bsd->m_collisionMargin);
383 printf(
"unknown Cylinder up axis\n");
412 printf(
"unknown Cone up axis\n");
430 tmpPos[i].deSerializeFloat(
mss->m_localPositionArrayPtr[i].m_pos);
431 radii[i] =
mss->m_localPositionArrayPtr[i].m_radius;
449#ifdef BT_USE_DOUBLE_PRECISION
473 printf(
"error: cannot create shape type (%d)\n",
shapeData->m_shapeType);
503 if (
trimesh->m_quantizedFloatBvh)
513 bvh->deSerializeFloat(*
trimesh->m_quantizedFloatBvh);
516 if (
trimesh->m_quantizedDoubleBvh)
526 bvh->deSerializeDouble(*
trimesh->m_quantizedDoubleBvh);
535 if (
trimesh->m_triangleInfoMap)
538 map->deSerialize(*
trimesh->m_triangleInfoMap);
541#ifdef USE_INTERNAL_EDGE_UTILITY
557 for (
int i = 0; i <
compoundData->m_numChildShapes; i++)
573 printf(
"error: couldn't create childShape for compoundShape\n");
601 char*
newName =
new char[l + 1];
614 for (
int i = 0; i <
meshData.m_numMeshParts; i++)
620 if (
meshData.m_meshPartsPtr[i].m_indices32)
626 for (
int j = 0;
j < 3 *
meshPart.m_numTriangles;
j++)
634 if (
meshData.m_meshPartsPtr[i].m_3indices16)
637 meshPart.m_triangleIndexStride =
sizeof(
short int) * 3;
651 if (
meshData.m_meshPartsPtr[i].m_indices16)
654 meshPart.m_triangleIndexStride = 3 *
sizeof(
short int);
657 for (
int j = 0;
j < 3 *
meshPart.m_numTriangles;
j++)
665 if (
meshData.m_meshPartsPtr[i].m_3indices8)
668 meshPart.m_triangleIndexStride =
sizeof(
unsigned char) * 3;
684 if (
meshData.m_meshPartsPtr[i].m_vertices3f)
698 meshPart.m_vertexBase = (
const unsigned char*)vertices;
715 meshPart.m_vertexBase = (
const unsigned char*)vertices;
736 for (
int i = 0; i <
newData->m_numMeshParts; i++)
760 int numIndices =
curNewPart->m_numTriangles * 3;
806#ifdef USE_INTERNAL_EDGE_UTILITY
859 colObj->setCollisionShape(shape);
994#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 ...
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...
virtual void setMargin(btScalar margin)=0
virtual void setLocalScaling(const btVector3 &scaling)=0
btAlignedObjectArray< btOptimizedBvh * > m_allocatedBvhs
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)
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
virtual class btCompoundShape * createCompoundShape()
virtual class btMultiSphereShape * createMultiSphereShape(const btVector3 *positions, const btScalar *radi, int numSpheres)
btHashMap< btHashPtr, btCollisionShape * > m_shapeMap
virtual btCollisionShape * createConeShapeY(btScalar radius, btScalar height)
virtual btCollisionShape * createSphereShape(btScalar radius)
btCollisionShape * getCollisionShapeByIndex(int index)
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)
btHashMap< btHashString, btCollisionShape * > m_nameShapeMap
btCollisionObject * getCollisionObjectByName(const char *name)
btAlignedObjectArray< char * > m_allocatedNames
virtual btBvhTriangleMeshShape * createBvhTriangleMeshShape(btStridingMeshInterface *trimesh, btOptimizedBvh *bvh)
btAlignedObjectArray< short int * > m_shortIndexArrays
btAlignedObjectArray< btStridingMeshInterfaceData * > m_allocatedbtStridingMeshInterfaceDatas
btOptimizedBvh * getBvhByIndex(int index) const
btHashMap< btHashString, btCollisionObject * > m_nameColObjMap
btCollisionObject * getRigidBodyByIndex(int index) const
btHashMap< btHashPtr, btOptimizedBvh * > m_bvhMap
btHashMap< btHashPtr, const char * > m_objectNameMap
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< btHashPtr, btCollisionObject * > m_bodyMap
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