20 :m_localScaling(localScaling),m_bvhTriMeshShape(childShape)
62 scaledAabbMin[0] =
m_localScaling.
getX() >= 0. ? aabbMin[0] * invLocalScaling[0] : aabbMax[0] * invLocalScaling[0];
63 scaledAabbMin[1] =
m_localScaling.
getY() >= 0. ? aabbMin[1] * invLocalScaling[1] : aabbMax[1] * invLocalScaling[1];
64 scaledAabbMin[2] =
m_localScaling.
getZ() >= 0. ? aabbMin[2] * invLocalScaling[2] : aabbMax[2] * invLocalScaling[2];
65 scaledAabbMin[3] = 0.f;
67 scaledAabbMax[0] =
m_localScaling.
getX() <= 0. ? aabbMin[0] * invLocalScaling[0] : aabbMax[0] * invLocalScaling[0];
68 scaledAabbMax[1] =
m_localScaling.
getY() <= 0. ? aabbMin[1] * invLocalScaling[1] : aabbMax[1] * invLocalScaling[1];
69 scaledAabbMax[2] =
m_localScaling.
getZ() <= 0. ? aabbMin[2] * invLocalScaling[2] : aabbMax[2] * invLocalScaling[2];
70 scaledAabbMax[3] = 0.f;
85 localAabbMin[0] = (m_localScaling.getX() >= 0.) ? tmpLocalAabbMin[0] : tmpLocalAabbMax[0];
86 localAabbMin[1] = (m_localScaling.getY() >= 0.) ? tmpLocalAabbMin[1] : tmpLocalAabbMax[1];
87 localAabbMin[2] = (m_localScaling.getZ() >= 0.) ? tmpLocalAabbMin[2] : tmpLocalAabbMax[2];
88 localAabbMax[0] = (m_localScaling.getX() <= 0.) ? tmpLocalAabbMin[0] : tmpLocalAabbMax[0];
89 localAabbMax[1] = (m_localScaling.getY() <= 0.) ? tmpLocalAabbMin[1] : tmpLocalAabbMax[1];
90 localAabbMax[2] = (m_localScaling.getZ() <= 0.) ? tmpLocalAabbMin[2] : tmpLocalAabbMax[2];
94 localHalfExtents +=
btVector3(margin,margin,margin);
101 btVector3 extent = localHalfExtents.
dot3(abs_b[0], abs_b[1], abs_b[2]);
102 aabbMin = center - extent;
103 aabbMax = center + extent;
virtual const btVector3 & getLocalScaling() const
virtual ~btScaledBvhTriangleMeshShape()
virtual void processAllTriangles(btTriangleCallback *callback, const btVector3 &aabbMin, const btVector3 &aabbMax) const
virtual void processTriangle(btVector3 *triangle, int partId, int triangleIndex)=0
virtual void processAllTriangles(btTriangleCallback *callback, const btVector3 &aabbMin, const btVector3 &aabbMax) const
btTriangleCallback * m_originalCallback
const btScalar & getZ() const
Return the z value.
virtual void calculateLocalInertia(btScalar mass, btVector3 &inertia) const
const btVector3 & getLocalAabbMin() const
The btBvhTriangleMeshShape is a static-triangle mesh shape, it can only be used for fixed/non-moving ...
btMatrix3x3 absolute() const
Return the matrix with all values non negative.
The btTriangleCallback provides a callback for each overlapping triangle when calling processAllTrian...
virtual void setLocalScaling(const btVector3 &scaling)
btScaledTriangleCallback(btTriangleCallback *originalCallback, const btVector3 &localScaling)
btScaledBvhTriangleMeshShape(btBvhTriangleMeshShape *childShape, const btVector3 &localScaling)
virtual void getAabb(const btTransform &t, btVector3 &aabbMin, btVector3 &aabbMax) const
getAabb returns the axis aligned bounding box in the coordinate frame of the given transform t...
const btScalar & getY() const
Return the y value.
const btScalar & getX() const
Return the x value.
btVector3 can be used to represent 3D points and vectors.
btBvhTriangleMeshShape * m_bvhTriMeshShape
btVector3 dot3(const btVector3 &v0, const btVector3 &v1, const btVector3 &v2) const
The btMatrix3x3 class implements a 3x3 rotation matrix, to perform linear algebra in combination with...
virtual btScalar getMargin() const
const btVector3 & getLocalAabbMax() const
virtual void processTriangle(btVector3 *triangle, int partId, int triangleIndex)
float btScalar
The btScalar type abstracts floating point numbers, to easily switch between double and single floati...