Ejemplo n.º 1
0
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;
}
Ejemplo n.º 2
0
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;
}
Ejemplo n.º 3
0
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;
}
Ejemplo n.º 4
0
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;
}
Ejemplo n.º 5
0
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;
}