When a mesh object is added to a scene, delay adding the physics actor until the sculpt data has been added to the shape (possibly via an async asset service request)
This prevents spurious 'no asset data' for meshes added on startup.bulletsim
parent
dbd954d701
commit
df0e5cc9fe
|
@ -1751,8 +1751,9 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
SceneObjectPart rootPart = group.GetChildPart(group.UUID);
|
||||
rootPart.Flags &= ~PrimFlags.Scripted;
|
||||
rootPart.TrimPermissions();
|
||||
group.CheckSculptAndLoad();
|
||||
//rootPart.DoPhysicsPropertyUpdate(UsePhysics, true);
|
||||
|
||||
// Don't do this here - it will get done later on when sculpt data is loaded.
|
||||
// group.CheckSculptAndLoad();
|
||||
}
|
||||
|
||||
m_log.Info("[SCENE]: Loaded " + PrimsFromDB.Count.ToString() + " SceneObject(s)");
|
||||
|
|
|
@ -1896,6 +1896,11 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
}
|
||||
}
|
||||
|
||||
// If this part is a sculpt then delay the physics update until we've asynchronously loaded the
|
||||
// mesh data.
|
||||
if (((OpenMetaverse.SculptType)Shape.SculptType) == SculptType.Mesh)
|
||||
CheckSculptAndLoad();
|
||||
else
|
||||
m_parentGroup.Scene.PhysicsScene.AddPhysicsActorTaint(PhysActor);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -660,10 +660,8 @@ namespace OpenSim.Region.Physics.OdePlugin
|
|||
if (taperY < 0.0f)
|
||||
taperY = -taperY;
|
||||
taperY1 = 1.0f - taperY;
|
||||
|
||||
}
|
||||
|
||||
|
||||
volume *= (taperX1 * taperY1 + 0.5f * (taperX1 * taperY + taperX * taperY1) + 0.3333333333f * taperX * taperY);
|
||||
|
||||
pathBegin = (float)_pbs.PathBegin * 2.0e-5f;
|
||||
|
@ -859,7 +857,9 @@ namespace OpenSim.Region.Physics.OdePlugin
|
|||
|
||||
public void ProcessTaints(float timestep)
|
||||
{
|
||||
//Console.WriteLine("ProcessTaints for " + Name);
|
||||
#if SPAM
|
||||
Console.WriteLine("ZProcessTaints for " + Name);
|
||||
#endif
|
||||
if (m_taintadd)
|
||||
{
|
||||
changeadd(timestep);
|
||||
|
@ -1323,7 +1323,9 @@ namespace OpenSim.Region.Physics.OdePlugin
|
|||
|
||||
public void CreateGeom(IntPtr m_targetSpace, IMesh _mesh)
|
||||
{
|
||||
//Console.WriteLine("CreateGeom:");
|
||||
#if SPAM
|
||||
Console.WriteLine("CreateGeom:");
|
||||
#endif
|
||||
if (_mesh != null)
|
||||
{
|
||||
setMesh(_parent_scene, _mesh);
|
||||
|
@ -1944,7 +1946,6 @@ Console.WriteLine(" JointCreateFixed");
|
|||
if (_parent_scene.needsMeshing(_pbs))
|
||||
mesh = _parent_scene.mesher.CreateMesh(oldname, _pbs, _size, meshlod, IsPhysical);
|
||||
|
||||
//IMesh mesh = _parent_scene.mesher.CreateMesh(oldname, _pbs, _size, meshlod, IsPhysical);
|
||||
#if SPAM
|
||||
Console.WriteLine("changesize 1");
|
||||
#endif
|
||||
|
@ -2056,8 +2057,8 @@ Console.WriteLine("changesize 2");
|
|||
if (IsPhysical)
|
||||
meshlod = _parent_scene.MeshSculptphysicalLOD;
|
||||
|
||||
IMesh mesh = _parent_scene.mesher.CreateMesh(oldname, _pbs, _size, meshlod, IsPhysical);
|
||||
// createmesh returns null when it doesn't mesh.
|
||||
IMesh mesh = _parent_scene.mesher.CreateMesh(oldname, _pbs, _size, meshlod, IsPhysical);
|
||||
#if SPAM
|
||||
Console.WriteLine("changeshape needed meshing");
|
||||
#endif
|
||||
|
|
|
@ -1723,20 +1723,21 @@ namespace OpenSim.Region.Physics.OdePlugin
|
|||
PhysicsActor result;
|
||||
IMesh mesh = null;
|
||||
|
||||
if (needsMeshing(pbs))
|
||||
{
|
||||
try
|
||||
{
|
||||
mesh = mesher.CreateMesh(primName, pbs, size, 32f, isPhysical);
|
||||
}
|
||||
catch(Exception e)
|
||||
{
|
||||
m_log.ErrorFormat("[PHYSICS]: Exception while meshing prim {0}.", primName);
|
||||
m_log.Debug(e.ToString());
|
||||
mesh = null;
|
||||
return null;
|
||||
}
|
||||
}
|
||||
// Don't create the mesh here - wait until the mesh data is loaded from the asset store.
|
||||
// if (needsMeshing(pbs))
|
||||
// {
|
||||
// try
|
||||
// {
|
||||
// mesh = mesher.CreateMesh(primName, pbs, size, 32f, isPhysical);
|
||||
// }
|
||||
// catch(Exception e)
|
||||
// {
|
||||
// m_log.ErrorFormat("[PHYSICS]: Exception while meshing prim {0}.", primName);
|
||||
// m_log.Debug(e.ToString());
|
||||
// mesh = null;
|
||||
// return null;
|
||||
// }
|
||||
// }
|
||||
|
||||
result = AddPrim(primName, position, size, rotation, mesh, pbs, isPhysical);
|
||||
|
||||
|
@ -2590,7 +2591,9 @@ namespace OpenSim.Region.Physics.OdePlugin
|
|||
{
|
||||
if (!(_taintedPrimH.Contains(taintedprim)))
|
||||
{
|
||||
//Console.WriteLine("AddPhysicsActorTaint to " + taintedprim.m_primName);
|
||||
#if SPAM
|
||||
Console.WriteLine("AddPhysicsActorTaint to " + taintedprim.Name);
|
||||
#endif
|
||||
_taintedPrimH.Add(taintedprim); // HashSet for searching
|
||||
_taintedPrimL.Add(taintedprim); // List for ordered readout
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue