* SimulationObject.GetWorldMesh() now has an option to force rebuild
* RayTriangleIntersection returns the actual collision point
* PhysicsSimple regenerates meshes when objects are moved or edited

git-svn-id: http://libopenmetaverse.googlecode.com/svn/libopenmetaverse/trunk@2476 52acb1d6-8a22-11de-b505-999d5b087335
This commit is contained in:
John Hurliman
2009-03-09 03:01:34 +00:00
parent 4973542628
commit 7e0529d58d
2 changed files with 56 additions and 28 deletions

View File

@@ -189,13 +189,14 @@ namespace Simian
}
}
public SimpleMesh GetWorldMesh(DetailLevel lod, SimulationObject parent)
public SimpleMesh GetWorldMesh(DetailLevel lod, bool forceRebuild)
{
int i = (int)lod;
if (WorldTransformedMeshes == null) WorldTransformedMeshes = new SimpleMesh[4];
if (WorldTransformedMeshes == null)
WorldTransformedMeshes = new SimpleMesh[4];
if (WorldTransformedMeshes[i] != null)
if (!forceRebuild && WorldTransformedMeshes[i] != null)
{
return WorldTransformedMeshes[i];
}
@@ -207,7 +208,8 @@ namespace Simian
// Construct a matrix to transform to world space
Matrix4 transform = Matrix4.Identity;
if (parent != null)
SimulationObject parent = GetLinksetParent();
if (parent != this)
{
// Apply parent rotation and translation first
transform *= Matrix4.CreateFromQuaternion(parent.Prim.Rotation);