private void CalculateBoundingBox(RenderPrimitive rprim) throws Exception
{
Primitive prim = rprim.getBasePrim();
// Calculate bounding volumes for each prim and adjust textures
rprim.BoundingVolume = new BoundingVolume();
for (int j = 0; j < rprim.Faces.size(); j++)
{
TextureEntryFace teFace = prim.Textures.GetFace(j);
if (teFace == null) continue;