1#ifndef BT_COMPOUND_FROM_GIMPACT
2#define BT_COMPOUND_FROM_GIMPACT
17 for (
int i = 0; i < m_children.size(); i++)
19 delete m_children[i].m_childShape;
29 MyCallback(
const btVector3& from,
const btVector3& to,
int ignorePart,
int ignoreTriangleIndex)
62 btVector3 v0 = triangle[0] * scale;
63 btVector3 v1 = triangle[1] * scale;
64 btVector3
v2 = triangle[2] * scale;
66 btVector3 centroid = (v0 + v1 +
v2) / 3;
67 btVector3 normal = (v1 - v0).
cross(
v2 - v0);
69 btVector3 rayFrom = centroid;
70 btVector3 rayTo = centroid - normal *
m_depth;
72 MyCallback cb(rayFrom, rayTo, partId, triangleIndex);
98 btVector3 aabbMin, aabbMax;
99 gimpactMesh->
getAabb(tr, aabbMin, aabbMax);
100 gimpactMesh->
getMeshInterface()->InternalProcessAllTriangles(&cb, aabbMin, aabbMax);
ATTR_WARN_UNUSED_RESULT const BMVert * v2
btCompoundShape * btCreateCompoundFromGimpactShape(const btGImpactMeshShape *gimpactMesh, btScalar depth)
virtual ~btCompoundFromGimpactShape()
btCompoundShape(bool enableDynamicAabbTree=true, const int initialChildCapacity=0)
#define BT_DECLARE_ALIGNED_ALLOCATOR()
float btScalar
The btScalar type abstracts floating point numbers, to easily switch between double and single floati...
#define ATTRIBUTE_ALIGNED16(a)
This class manages a mesh supplied by the btStridingMeshInterface interface.
virtual void processAllTrianglesRay(btTriangleCallback *callback, const btVector3 &rayFrom, const btVector3 &rayTo) const
Function for retrieve triangles.
btStridingMeshInterface * getMeshInterface()
void getAabb(const btTransform &t, btVector3 &aabbMin, btVector3 &aabbMax) const
If the Bounding box is not updated, then this class attemps to calculate it.
virtual const btVector3 & getLocalScaling() const
ccl_device_inline float cross(const float2 a, const float2 b)
int m_ignoreTriangleIndex
virtual btScalar reportHit(const btVector3 &hitNormalLocal, btScalar hitFraction, int partId, int triangleIndex)
MyCallback(const btVector3 &from, const btVector3 &to, int ignorePart, int ignoreTriangleIndex)
const btGImpactMeshShape * m_gimpactShape
MyInternalTriangleIndexCallback(btCompoundShape *colShape, const btGImpactMeshShape *meshShape, btScalar depth)
virtual void internalProcessTriangleIndex(btVector3 *triangle, int partId, int triangleIndex)
btCompoundShape * m_colShape