void pfxGetShapeAabbLargeTriMesh(const PfxShape &shape,PfxVector3 &aabbMin,PfxVector3 &aabbMax) { const PfxLargeTriMesh *largemesh = shape.getLargeTriMesh(); PfxVector3 half = absPerElem(PfxMatrix3(shape.getOffsetOrientation())) * largemesh->m_half; aabbMin = shape.getOffsetPosition() - half; aabbMax = shape.getOffsetPosition() + half; }
void pfxGetShapeAabbConvexMesh(const PfxShape &shape,PfxVector3 &aabbMin,PfxVector3 &aabbMax) { const PfxConvexMesh *convex = shape.getConvexMesh(); PfxVector3 half = absPerElem(PfxMatrix3(shape.getOffsetOrientation())) * convex->m_half; aabbMin = shape.getOffsetPosition() - half; aabbMax = shape.getOffsetPosition() + half; }
void pfxGetShapeAabbCylinder(const PfxShape &shape,PfxVector3 &aabbMin,PfxVector3 &aabbMax) { PfxVector3 capSize = absPerElem(PfxMatrix3(shape.getOffsetOrientation())) * PfxVector3(shape.getCylinder().m_halfLen,shape.getCylinder().m_radius,shape.getCylinder().m_radius); aabbMin = shape.getOffsetPosition() - capSize; aabbMax = shape.getOffsetPosition() + capSize; }
void pfxGetShapeAabbCapsule(const PfxShape &shape,PfxVector3 &aabbMin,PfxVector3 &aabbMax) { PfxVector3 dir = rotate(shape.getOffsetOrientation(),PfxVector3(1.0f,0.0f,0.0f)); PfxVector3 capSize = absPerElem(dir) * shape.getCapsule().m_halfLen + PfxVector3(shape.getCapsule().m_radius); aabbMin = shape.getOffsetPosition() - capSize; aabbMax = shape.getOffsetPosition() + capSize; }
void pfxGetShapeAabbBox(const PfxShape &shape,PfxVector3 &aabbMin,PfxVector3 &aabbMax) { PfxVector3 boxSize = absPerElem(PfxMatrix3(shape.getOffsetOrientation())) * shape.getBox().m_half; aabbMin = shape.getOffsetPosition() - boxSize; aabbMax = shape.getOffsetPosition() + boxSize; }