Bullet Collision Detection & Physics Library
Public Member Functions | List of all members
btBulletWorldImporter Class Reference

The btBulletWorldImporter is a starting point to import .bullet files. More...

#include <btBulletWorldImporter.h>

Inheritance diagram for btBulletWorldImporter:
Inheritance graph
[legend]
Collaboration diagram for btBulletWorldImporter:
Collaboration graph
[legend]

Public Member Functions

 btBulletWorldImporter (btDynamicsWorld *world=0)
 
virtual ~btBulletWorldImporter ()
 
bool loadFile (const char *fileName, const char *preSwapFilenameOut=0)
 if you pass a valid preSwapFilenameOut, it will save a new file with a different endianness this pre-swapped file can be loaded without swapping on a target platform of different endianness More...
 
bool loadFileFromMemory (char *memoryBuffer, int len)
 the memoryBuffer might be modified (for example if endian swaps are necessary) More...
 
bool loadFileFromMemory (bParse::btBulletFile *file)
 
virtual bool convertAllObjects (bParse::btBulletFile *file)
 
- Public Member Functions inherited from btWorldImporter
 btWorldImporter (btDynamicsWorld *world)
 
virtual ~btWorldImporter ()
 
virtual void deleteAllData ()
 delete all memory collision shapes, rigid bodies, constraints etc. More...
 
void setVerboseMode (int verboseMode)
 
int getVerboseMode () const
 
void setImporterFlags (int importerFlags)
 
int getImporterFlags () const
 
int getNumCollisionShapes () const
 
btCollisionShapegetCollisionShapeByIndex (int index)
 
int getNumRigidBodies () const
 
btCollisionObjectgetRigidBodyByIndex (int index) const
 
int getNumConstraints () const
 
btTypedConstraintgetConstraintByIndex (int index) const
 
int getNumBvhs () const
 
btOptimizedBvhgetBvhByIndex (int index) const
 
int getNumTriangleInfoMaps () const
 
btTriangleInfoMapgetTriangleInfoMapByIndex (int index) const
 
btCollisionShapegetCollisionShapeByName (const char *name)
 
btRigidBodygetRigidBodyByName (const char *name)
 
btTypedConstraintgetConstraintByName (const char *name)
 
const char * getNameForPointer (const void *ptr) const
 
virtual void setDynamicsWorldInfo (const btVector3 &gravity, const btContactSolverInfo &solverInfo)
 those virtuals are called by load and can be overridden by the user More...
 
virtual btRigidBodycreateRigidBody (bool isDynamic, btScalar mass, const btTransform &startTransform, btCollisionShape *shape, const char *bodyName)
 
virtual btCollisionObjectcreateCollisionObject (const btTransform &startTransform, btCollisionShape *shape, const char *bodyName)
 
virtual btCollisionShapecreatePlaneShape (const btVector3 &planeNormal, btScalar planeConstant)
 shapes More...
 
virtual btCollisionShapecreateBoxShape (const btVector3 &halfExtents)
 
virtual btCollisionShapecreateSphereShape (btScalar radius)
 
virtual btCollisionShapecreateCapsuleShapeX (btScalar radius, btScalar height)
 
virtual btCollisionShapecreateCapsuleShapeY (btScalar radius, btScalar height)
 
virtual btCollisionShapecreateCapsuleShapeZ (btScalar radius, btScalar height)
 
virtual btCollisionShapecreateCylinderShapeX (btScalar radius, btScalar height)
 
virtual btCollisionShapecreateCylinderShapeY (btScalar radius, btScalar height)
 
virtual btCollisionShapecreateCylinderShapeZ (btScalar radius, btScalar height)
 
virtual btCollisionShapecreateConeShapeX (btScalar radius, btScalar height)
 
virtual btCollisionShapecreateConeShapeY (btScalar radius, btScalar height)
 
virtual btCollisionShapecreateConeShapeZ (btScalar radius, btScalar height)
 
virtual class btTriangleIndexVertexArraycreateTriangleMeshContainer ()
 
virtual btBvhTriangleMeshShapecreateBvhTriangleMeshShape (btStridingMeshInterface *trimesh, btOptimizedBvh *bvh)
 
virtual btCollisionShapecreateConvexTriangleMeshShape (btStridingMeshInterface *trimesh)
 
virtual btGImpactMeshShapecreateGimpactShape (btStridingMeshInterface *trimesh)
 
virtual btStridingMeshInterfaceDatacreateStridingMeshInterfaceData (btStridingMeshInterfaceData *interfaceData)
 
virtual class btConvexHullShapecreateConvexHullShape ()
 
virtual class btCompoundShapecreateCompoundShape ()
 
virtual class btScaledBvhTriangleMeshShapecreateScaledTrangleMeshShape (btBvhTriangleMeshShape *meshShape, const btVector3 &localScalingbtBvhTriangleMeshShape)
 
virtual class btMultiSphereShapecreateMultiSphereShape (const btVector3 *positions, const btScalar *radi, int numSpheres)
 
virtual btTriangleIndexVertexArraycreateMeshInterface (btStridingMeshInterfaceData &meshData)
 
virtual class btHeightfieldTerrainShapecreateHeightfieldShape (int heightStickWidth, int heightStickLength, const void *heightfieldData, btScalar heightScale, btScalar minHeight, btScalar maxHeight, int upAxis, int heightDataType, bool flipQuadEdges)
 
virtual btOptimizedBvhcreateOptimizedBvh ()
 acceleration and connectivity structures More...
 
virtual btTriangleInfoMapcreateTriangleInfoMap ()
 
virtual btPoint2PointConstraintcreatePoint2PointConstraint (btRigidBody &rbA, btRigidBody &rbB, const btVector3 &pivotInA, const btVector3 &pivotInB)
 constraints More...
 
virtual btPoint2PointConstraintcreatePoint2PointConstraint (btRigidBody &rbA, const btVector3 &pivotInA)
 
virtual btHingeConstraintcreateHingeConstraint (btRigidBody &rbA, btRigidBody &rbB, const btTransform &rbAFrame, const btTransform &rbBFrame, bool useReferenceFrameA=false)
 
virtual btHingeConstraintcreateHingeConstraint (btRigidBody &rbA, const btTransform &rbAFrame, bool useReferenceFrameA=false)
 
virtual btConeTwistConstraintcreateConeTwistConstraint (btRigidBody &rbA, btRigidBody &rbB, const btTransform &rbAFrame, const btTransform &rbBFrame)
 
virtual btConeTwistConstraintcreateConeTwistConstraint (btRigidBody &rbA, const btTransform &rbAFrame)
 
virtual btGeneric6DofConstraintcreateGeneric6DofConstraint (btRigidBody &rbA, btRigidBody &rbB, const btTransform &frameInA, const btTransform &frameInB, bool useLinearReferenceFrameA)
 
virtual btGeneric6DofConstraintcreateGeneric6DofConstraint (btRigidBody &rbB, const btTransform &frameInB, bool useLinearReferenceFrameB)
 
virtual btGeneric6DofSpringConstraintcreateGeneric6DofSpringConstraint (btRigidBody &rbA, btRigidBody &rbB, const btTransform &frameInA, const btTransform &frameInB, bool useLinearReferenceFrameA)
 
virtual btGeneric6DofSpring2ConstraintcreateGeneric6DofSpring2Constraint (btRigidBody &rbA, btRigidBody &rbB, const btTransform &frameInA, const btTransform &frameInB, int rotateOrder)
 
virtual btSliderConstraintcreateSliderConstraint (btRigidBody &rbA, btRigidBody &rbB, const btTransform &frameInA, const btTransform &frameInB, bool useLinearReferenceFrameA)
 
virtual btSliderConstraintcreateSliderConstraint (btRigidBody &rbB, const btTransform &frameInB, bool useLinearReferenceFrameA)
 
virtual btGearConstraintcreateGearConstraint (btRigidBody &rbA, btRigidBody &rbB, const btVector3 &axisInA, const btVector3 &axisInB, btScalar ratio)
 

Additional Inherited Members

- Protected Member Functions inherited from btWorldImporter
char * duplicateName (const char *name)
 
btCollisionShapeconvertCollisionShape (btCollisionShapeData *shapeData)
 
void convertConstraintBackwardsCompatible281 (btTypedConstraintData *constraintData, btRigidBody *rbA, btRigidBody *rbB, int fileVersion)
 
void convertConstraintFloat (btTypedConstraintFloatData *constraintData, btRigidBody *rbA, btRigidBody *rbB, int fileVersion)
 
void convertConstraintDouble (btTypedConstraintDoubleData *constraintData, btRigidBody *rbA, btRigidBody *rbB, int fileVersion)
 
void convertRigidBodyFloat (btRigidBodyFloatData *colObjData)
 
void convertRigidBodyDouble (btRigidBodyDoubleData *colObjData)
 
- Static Protected Member Functions inherited from btWorldImporter
static btRigidBodygetFixedBody ()
 
- Protected Attributes inherited from btWorldImporter
btDynamicsWorldm_dynamicsWorld
 
int m_verboseMode
 
int m_importerFlags
 
btAlignedObjectArray< btCollisionShape * > m_allocatedCollisionShapes
 
btAlignedObjectArray< btCollisionObject * > m_allocatedRigidBodies
 
btAlignedObjectArray< btTypedConstraint * > m_allocatedConstraints
 
btAlignedObjectArray< btOptimizedBvh * > m_allocatedBvhs
 
btAlignedObjectArray< btTriangleInfoMap * > m_allocatedTriangleInfoMaps
 
btAlignedObjectArray< btTriangleIndexVertexArray * > m_allocatedTriangleIndexArrays
 
btAlignedObjectArray< btStridingMeshInterfaceData * > m_allocatedbtStridingMeshInterfaceDatas
 
btAlignedObjectArray< char * > m_allocatedNames
 
btAlignedObjectArray< int * > m_indexArrays
 
btAlignedObjectArray< short int * > m_shortIndexArrays
 
btAlignedObjectArray< unsigned char * > m_charIndexArrays
 
btAlignedObjectArray< btVector3FloatData * > m_floatVertexArrays
 
btAlignedObjectArray< btVector3DoubleData * > m_doubleVertexArrays
 
btHashMap< btHashPtr, btOptimizedBvh * > m_bvhMap
 
btHashMap< btHashPtr, btTriangleInfoMap * > m_timMap
 
btHashMap< btHashString, btCollisionShape * > m_nameShapeMap
 
btHashMap< btHashString, btRigidBody * > m_nameBodyMap
 
btHashMap< btHashString, btTypedConstraint * > m_nameConstraintMap
 
btHashMap< btHashPtr, const char * > m_objectNameMap
 
btHashMap< btHashPtr, btCollisionShape * > m_shapeMap
 
btHashMap< btHashPtr, btCollisionObject * > m_bodyMap
 

Detailed Description

The btBulletWorldImporter is a starting point to import .bullet files.

note that not all data is converted yet. You are expected to override or modify this class. See Bullet/Demos/SerializeDemo for a derived class that extract btSoftBody objects too.

Definition at line 32 of file btBulletWorldImporter.h.

Constructor & Destructor Documentation

◆ btBulletWorldImporter()

btBulletWorldImporter::btBulletWorldImporter ( btDynamicsWorld world = 0)

Definition at line 29 of file btBulletWorldImporter.cpp.

◆ ~btBulletWorldImporter()

btBulletWorldImporter::~btBulletWorldImporter ( )
virtual

Definition at line 34 of file btBulletWorldImporter.cpp.

Member Function Documentation

◆ convertAllObjects()

bool btBulletWorldImporter::convertAllObjects ( bParse::btBulletFile file)
virtual

Reimplemented in btMultiBodyWorldImporter.

Definition at line 86 of file btBulletWorldImporter.cpp.

◆ loadFile()

bool btBulletWorldImporter::loadFile ( const char *  fileName,
const char *  preSwapFilenameOut = 0 
)

if you pass a valid preSwapFilenameOut, it will save a new file with a different endianness this pre-swapped file can be loaded without swapping on a target platform of different endianness

Definition at line 38 of file btBulletWorldImporter.cpp.

◆ loadFileFromMemory() [1/2]

bool btBulletWorldImporter::loadFileFromMemory ( bParse::btBulletFile file)

Definition at line 69 of file btBulletWorldImporter.cpp.

◆ loadFileFromMemory() [2/2]

bool btBulletWorldImporter::loadFileFromMemory ( char *  memoryBuffer,
int  len 
)

the memoryBuffer might be modified (for example if endian swaps are necessary)

Definition at line 58 of file btBulletWorldImporter.cpp.


The documentation for this class was generated from the following files: