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 170 int i = this->getMeshPartCount();
176 getMeshPart(i)->calculateLocalInertia(partmass,partinertia);
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();
257 int i = m_mesh_parts.size();
260 m_mesh_parts[i]->processAllTriangles(callback,aabbMin,aabbMax);
266 int i = m_mesh_parts.size();
269 m_mesh_parts[i]->processAllTrianglesRay(callback, rayFrom, rayTo);
289 return "btGImpactMeshShapeData";
virtual bool childrenHasTransform() const
if true, then its children must get transforms.
void setValue(const btScalar &_x, const btScalar &_y, const btScalar &_z)
virtual void rayTest(const btVector3 &rayFrom, const btVector3 &rayTo, btCollisionWorld::RayResultCallback &resultCallback) const
virtual method for ray collision
virtual void unlockChildShapes() const
void getVertex(int vertex_index, btVector3 &vertex) const
virtual void calculateLocalInertia(btScalar mass, btVector3 &inertia) const
virtual void processTriangle(btVector3 *triangle, int partId, int triangleIndex)=0
btScalar m_collisionMargin
RayResultCallback is used to report new raycast results.
virtual void calculateLocalInertia(btScalar mass, btVector3 &inertia) const
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
virtual eGIMPACT_SHAPE_TYPE getGImpactShapeType() const
Subshape member functions.
btGImpactBoxSet m_box_set
btVector3 & normalize()
Normalize this vector x^2 + y^2 + z^2 = 1.
virtual ~btGImpactMeshShapePart()
int size() const
return the number of elements in the array
The btTriangleCallback provides a callback for each overlapping triangle when calling processAllTrian...
virtual void processAllTrianglesRay(btTriangleCallback *callback, const btVector3 &rayFrom, const btVector3 &rayTo) const
Function for retrieve triangles.
virtual int getNumChildShapes() const
Gets the number of children.
virtual void processAllTriangles(btTriangleCallback *callback, const btVector3 &aabbMin, const btVector3 &aabbMax) const
Function for retrieve triangles.
btVector3 gim_inertia_add_transformed(const btVector3 &source_inertia, const btVector3 &added_inertia, const btTransform &transform)
virtual void processAllTriangles(btTriangleCallback *callback, const btVector3 &aabbMin, const btVector3 &aabbMax) const
Function for retrieve triangles.
btStridingMeshInterfaceData m_meshInterface
TrimeshPrimitiveManager m_primitive_manager
virtual const char * serialize(void *dataBuffer, btSerializer *serializer) const
fills the dataBuffer and returns the struct name (and 0 on failure)
void setPrimitiveManager(btPrimitiveManagerBase *primitive_manager)
void serializeFloat(struct btVector3FloatData &dataOut) const
Trimesh primitive manager.
btCollisionShapeData m_collisionShapeData
btPrimitiveManagerBase * getPrimitiveManager() const
btVector3 can be used to represent 3D points and vectors.
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 ...
btVector3 gim_get_point_inertia(const btVector3 &point, btScalar mass)
virtual void lockChildShapes() const
call when reading child shapes
virtual void calculateLocalInertia(btScalar mass, btVector3 &inertia) const
Calculates the exact inertia tensor for this shape.
bool boxQuery(const btAABB &box, btAlignedObjectArray< int > &collided_results) const
returns the indices of the primitives in the m_primitive_manager
void getPrimitiveTriangle(int index, btPrimitiveTriangle &triangle) const
if this trimesh
btVector3FloatData m_localScaling
virtual void processAllTrianglesRay(btTriangleCallback *callback, const btVector3 &rayFrom, const btVector3 &rayTo) const
Function for retrieve triangles.
float btScalar
The btScalar type abstracts floating point numbers, to easily switch between double and single floati...
btStridingMeshInterface * m_meshInterface
virtual const char * serialize(void *dataBuffer, btSerializer *serializer) const
fills the dataBuffer and returns the struct name (and 0 on failure)
int getVertexCount() const