79 #define CALC_EXACT_INERTIA 1 85 #ifdef CALC_EXACT_INERTIA 94 m_childShapes[i]->calculateLocalInertia(shapemass,temp_inertia);
118 inertia = scaledmass * (
btVector3(y2+z2,x2+z2,x2+y2));
131 #ifdef CALC_EXACT_INERTIA 142 inertia+=pointintertia;
157 inertia = scaledmass * (
btVector3(y2+z2,x2+z2,x2+y2));
167 #ifdef CALC_EXACT_INERTIA 177 inertia+=partinertia;
192 inertia = scaledmass * (
btVector3(y2+z2,x2+z2,x2+y2));
210 if(collided.
size()==0)
218 int i = collided.
size();
237 if(collided.
size()==0)
245 int i = collided.
size();
260 m_mesh_parts[i]->processAllTriangles(callback,aabbMin,aabbMax);
269 m_mesh_parts[i]->processAllTrianglesRay(callback, rayFrom, rayTo);
289 return "btGImpactMeshShapeData";
int getMeshPartCount() const
void setValue(const btScalar &_x, const btScalar &_y, const btScalar &_z)
virtual void lockChildShapes() const
call when reading child shapes
virtual void processAllTriangles(btTriangleCallback *callback, const btVector3 &aabbMin, const btVector3 &aabbMax) const
Function for retrieve triangles.
bool rayQuery(const btVector3 &ray_dir, const btVector3 &ray_origin, btAlignedObjectArray< int > &collided_results) const
returns the indices of the primitives in the m_primitive_manager
btPrimitiveManagerBase * getPrimitiveManager() const
virtual int getNumChildShapes() const
Gets the number of children.
int getVertexCount() const
virtual void processTriangle(btVector3 *triangle, int partId, int triangleIndex)=0
virtual void processAllTrianglesRay(btTriangleCallback *callback, const btVector3 &rayFrom, const btVector3 &rayTo) const
Function for retrieve triangles.
btScalar m_collisionMargin
virtual bool childrenHasTransform() const
if true, then its children must get transforms.
void serializeFloat(struct btVector3FloatData &dataOut) const
RayResultCallback is used to report new raycast results.
virtual void processAllTriangles(btTriangleCallback *callback, const btVector3 &aabbMin, const btVector3 &aabbMax) const
Function for retrieve triangles.
virtual const char * serialize(void *dataBuffer, btSerializer *serializer) const
fills the dataBuffer and returns the struct name (and 0 on failure)
virtual void unlockChildShapes() const
btGImpactBoxSet m_box_set
btVector3 & normalize()
Normalize this vector x^2 + y^2 + z^2 = 1.
bool boxQuery(const btAABB &box, btAlignedObjectArray< int > &collided_results) const
returns the indices of the primitives in the m_primitive_manager
void getVertex(int vertex_index, btVector3 &vertex) const
btGImpactMeshShapePart * getMeshPart(int index)
virtual ~btGImpactMeshShapePart()
virtual void processAllTrianglesRay(btTriangleCallback *callback, const btVector3 &rayFrom, const btVector3 &rayTo) const
Function for retrieve triangles.
btAlignedObjectArray< btTransform > m_childTransforms
The btTriangleCallback provides a callback for each overlapping triangle when calling processAllTrian...
btVector3 gim_inertia_add_transformed(const btVector3 &source_inertia, const btVector3 &added_inertia, const btTransform &transform)
btStridingMeshInterfaceData m_meshInterface
TrimeshPrimitiveManager m_primitive_manager
void setPrimitiveManager(btPrimitiveManagerBase *primitive_manager)
virtual void calculateLocalInertia(btScalar mass, btVector3 &inertia) const
virtual const char * serialize(void *dataBuffer, btSerializer *serializer) const
fills the dataBuffer and returns the struct name (and 0 on failure)
Trimesh primitive manager.
virtual void rayTest(const btVector3 &rayFrom, const btVector3 &rayTo, btCollisionWorld::RayResultCallback &resultCallback) const
virtual method for ray collision
btCollisionShapeData m_collisionShapeData
virtual const char * serialize(void *dataBuffer, btSerializer *serializer) const
fills the dataBuffer and returns the struct name (and 0 on failure)
btVector3 can be used to represent 3D points and vectors.
int size() const
return the number of elements in the array
The btStridingMeshInterface is the interface class for high performance generic access to triangle me...
do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64
void getPrimitiveTriangle(int index, btPrimitiveTriangle &triangle) const
if this trimesh
virtual eGIMPACT_SHAPE_TYPE getGImpactShapeType() const
Subshape member functions.
btStridingMeshInterface * m_meshInterface
btVector3 gim_get_point_inertia(const btVector3 &point, btScalar mass)
virtual void unlockChildShapes() const
btAlignedObjectArray< btGImpactMeshShapePart * > m_mesh_parts
btVector3FloatData m_localScaling
btAlignedObjectArray< btCollisionShape * > m_childShapes
virtual void calculateLocalInertia(btScalar mass, btVector3 &inertia) const
float btScalar
The btScalar type abstracts floating point numbers, to easily switch between double and single floati...
virtual void lockChildShapes() const
call when reading child shapes
btStridingMeshInterface * m_meshInterface
virtual void calculateLocalInertia(btScalar mass, btVector3 &inertia) const
Calculates the exact inertia tensor for this shape.