Strip path information from textures in model files, recenter meshes

about their bounding volume centers.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4061 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Andrzej Kapolka
2006-04-26 19:31:13 +00:00
parent 01caf5cca6
commit 762e85dd44
3 changed files with 37 additions and 1 deletions
@@ -176,6 +176,13 @@ public class ModelDef
offsetScale[2]);
}
// make sure texture is just a filename
int sidx = (texture == null) ? -1 :
Math.max(texture.lastIndexOf('/'), texture.lastIndexOf('\\'));
if (sidx != -1) {
texture = texture.substring(sidx + 1);
}
// configure using properties
_mesh.configure(solid, texture, transparent, props);
@@ -198,6 +205,9 @@ public class ModelDef
ibuf.put(indices.get(ii));
}
_mesh.reconstruct(vbbuf, nbbuf, null, tbbuf, ibbuf);
// set the mesh's origin to the center of its bounding box
_mesh.centerVertices();
}
/** The mesh that contains the actual geometry. */