re-enabled some ODE internal proxies for some simple prim types to try to save some more memory
parent
468b7426c3
commit
e6afb28355
|
@ -2022,6 +2022,10 @@ namespace OpenSim.Region.Physics.Meshing
|
|||
{
|
||||
Mesh mesh = null;
|
||||
|
||||
#if SPAM
|
||||
reportPrimParams(primName, primShape);
|
||||
#endif
|
||||
|
||||
if (primShape.SculptEntry && primShape.SculptType != (byte)0 && primShape.SculptData.Length > 0)
|
||||
{
|
||||
SculptMesh smesh = CreateSculptMesh(primName, primShape, size, lod);
|
||||
|
|
|
@ -1332,7 +1332,13 @@ namespace OpenSim.Region.Physics.OdePlugin
|
|||
if (IsPhysical)
|
||||
meshlod = _parent_scene.MeshSculptphysicalLOD;
|
||||
// Don't need to re-enable body.. it's done in SetMesh
|
||||
IMesh mesh = _parent_scene.mesher.CreateMesh(oldname, _pbs, _size, meshlod, IsPhysical);
|
||||
|
||||
IMesh mesh = null;
|
||||
|
||||
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 (mesh != null)
|
||||
{
|
||||
|
@ -1691,55 +1697,56 @@ namespace OpenSim.Region.Physics.OdePlugin
|
|||
d.GeomSetQuaternion(prim_geom, ref myrot);
|
||||
}
|
||||
}
|
||||
//else
|
||||
//{
|
||||
// if (_pbs.ProfileShape == ProfileShape.HalfCircle && _pbs.PathCurve == (byte)Extrusion.Curve1)
|
||||
// {
|
||||
// if (_size.X == _size.Y && _size.Y == _size.Z && _size.X == _size.Z)
|
||||
// {
|
||||
// _parent_scene.waitForSpaceUnlock(m_targetSpace);
|
||||
// SetGeom(d.CreateSphere(m_targetSpace, _size.X / 2));
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// _parent_scene.waitForSpaceUnlock(m_targetSpace);
|
||||
// SetGeom(d.CreateBox(m_targetSpace, _size.X, _size.Y, _size.Z));
|
||||
// }
|
||||
// }
|
||||
// //else if (_pbs.ProfileShape == ProfileShape.Circle && _pbs.PathCurve == (byte)Extrusion.Straight)
|
||||
// //{
|
||||
// //Cyllinder
|
||||
// //if (_size.X == _size.Y)
|
||||
// //{
|
||||
// //prim_geom = d.CreateCylinder(m_targetSpace, _size.X / 2, _size.Z);
|
||||
// //}
|
||||
// //else
|
||||
// //{
|
||||
// //prim_geom = d.CreateBox(m_targetSpace, _size.X, _size.Y, _size.Z);
|
||||
// //}
|
||||
// //}
|
||||
// else
|
||||
// {
|
||||
// _parent_scene.waitForSpaceUnlock(m_targetSpace);
|
||||
// SetGeom(d.CreateBox(m_targetSpace, _size.X, _size.Y, _size.Z));
|
||||
// }
|
||||
// d.GeomSetPosition(prim_geom, _position.X, _position.Y, _position.Z);
|
||||
// d.Quaternion myrot = new d.Quaternion();
|
||||
// myrot.W = _orientation.w;
|
||||
// myrot.X = _orientation.X;
|
||||
// myrot.Y = _orientation.Y;
|
||||
// myrot.Z = _orientation.Z;
|
||||
// d.GeomSetQuaternion(prim_geom, ref myrot);
|
||||
else
|
||||
{
|
||||
if (_pbs.ProfileShape == ProfileShape.HalfCircle && _pbs.PathCurve == (byte)Extrusion.Curve1)
|
||||
{
|
||||
if (_size.X == _size.Y && _size.Y == _size.Z && _size.X == _size.Z)
|
||||
{
|
||||
_parent_scene.waitForSpaceUnlock(m_targetSpace);
|
||||
SetGeom(d.CreateSphere(m_targetSpace, _size.X / 2));
|
||||
}
|
||||
else
|
||||
{
|
||||
_parent_scene.waitForSpaceUnlock(m_targetSpace);
|
||||
SetGeom(d.CreateBox(m_targetSpace, _size.X, _size.Y, _size.Z));
|
||||
}
|
||||
}
|
||||
//else if (_pbs.ProfileShape == ProfileShape.Circle && _pbs.PathCurve == (byte)Extrusion.Straight)
|
||||
//{
|
||||
//Cyllinder
|
||||
//if (_size.X == _size.Y)
|
||||
//{
|
||||
//prim_geom = d.CreateCylinder(m_targetSpace, _size.X / 2, _size.Z);
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
//prim_geom = d.CreateBox(m_targetSpace, _size.X, _size.Y, _size.Z);
|
||||
//}
|
||||
//}
|
||||
else
|
||||
{
|
||||
_parent_scene.waitForSpaceUnlock(m_targetSpace);
|
||||
SetGeom(d.CreateBox(m_targetSpace, _size.X, _size.Y, _size.Z));
|
||||
}
|
||||
d.GeomSetPosition(prim_geom, _position.X, _position.Y, _position.Z);
|
||||
d.Quaternion myrot = new d.Quaternion();
|
||||
//myrot.W = _orientation.w;
|
||||
myrot.W = _orientation.W;
|
||||
myrot.X = _orientation.X;
|
||||
myrot.Y = _orientation.Y;
|
||||
myrot.Z = _orientation.Z;
|
||||
d.GeomSetQuaternion(prim_geom, ref myrot);
|
||||
|
||||
// //d.GeomBoxSetLengths(prim_geom, _size.X, _size.Y, _size.Z);
|
||||
// if (IsPhysical && Body == (IntPtr)0)
|
||||
// {
|
||||
// // Re creates body on size.
|
||||
// // EnableBody also does setMass()
|
||||
// enableBody();
|
||||
// d.BodyEnable(Body);
|
||||
// }
|
||||
//}
|
||||
//d.GeomBoxSetLengths(prim_geom, _size.X, _size.Y, _size.Z);
|
||||
if (IsPhysical && Body == (IntPtr)0)
|
||||
{
|
||||
// Re creates body on size.
|
||||
// EnableBody also does setMass()
|
||||
enableBody();
|
||||
d.BodyEnable(Body);
|
||||
}
|
||||
}
|
||||
|
||||
_parent_scene.geom_name_map[prim_geom] = oldname;
|
||||
|
||||
|
|
|
@ -1526,6 +1526,19 @@ namespace OpenSim.Region.Physics.OdePlugin
|
|||
return false;
|
||||
}
|
||||
|
||||
// if it's a standard box or sphere with no cuts or hollows or twist, return false since ODE can use an internal representation for the prim
|
||||
if ((pbs.ProfileShape == ProfileShape.HalfCircle && pbs.PathCurve == (byte)Extrusion.Curve1)
|
||||
|| (pbs.ProfileShape == ProfileShape.Square && pbs.PathCurve == (byte)Extrusion.Straight))
|
||||
{
|
||||
if (pbs.ProfileBegin == 0 && pbs.ProfileEnd == 0
|
||||
&& pbs.ProfileHollow == 0
|
||||
&& pbs.PathTwist == 0 && pbs.PathTwistBegin == 0
|
||||
&& pbs.PathBegin == 0 && pbs.PathEnd == 0
|
||||
//&& pbs.PathTaperX == 0 && pbs.PathTaperY == 0
|
||||
&& pbs.PathScaleX == 100 && pbs.PathScaleY == 100)
|
||||
return false;
|
||||
}
|
||||
|
||||
// if (pbs.ProfileHollow != 0)
|
||||
// return true;
|
||||
|
||||
|
|
Loading…
Reference in New Issue