From 3035f5cb642cbda6a332d64c673782a85e91bb0c Mon Sep 17 00:00:00 2001
From: Dahlia Trimble
Date: Fri, 25 Jul 2008 20:29:37 +0000
Subject: Re-enables testing for config option mesh_sculpted_prim which was
inadvertently disabled in a prior modification (oops) :)
---
OpenSim/Region/Physics/OdePlugin/ODEPrim.cs | 28 ++++++++++-----------
OpenSim/Region/Physics/OdePlugin/OdePlugin.cs | 35 ++++++++++++++++-----------
2 files changed, 35 insertions(+), 28 deletions(-)
(limited to 'OpenSim/Region/Physics')
diff --git a/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs b/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs
index c1e54da..c01626a 100644
--- a/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs
+++ b/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs
@@ -759,7 +759,7 @@ namespace OpenSim.Region.Physics.OdePlugin
if (m_taintselected != m_isSelected)
changeSelectedStatus(timestep);
- if (!m_taintVelocity.IsIdentical(PhysicsVector.Zero,0))
+ if (!m_taintVelocity.IsIdentical(PhysicsVector.Zero, 0.001f))
changevelocity(timestep);
if (m_taintparent != _parent)
@@ -918,18 +918,18 @@ namespace OpenSim.Region.Physics.OdePlugin
m_targetSpace = targetspace;
- //if (_mesh == null)
- //{
- // if (_parent_scene.needsMeshing(_pbs))
- // {
- // // Don't need to re-enable body.. it's done in SetMesh
- // _mesh = _parent_scene.mesher.CreateMesh(m_primName, _pbs, _size, _parent_scene.meshSculptLOD, IsPhysical);
- // // createmesh returns null when it's a shape that isn't a cube.
- // }
- //}
+ if (_mesh == null)
+ {
+ if (_parent_scene.needsMeshing(_pbs))
+ {
+ // Don't need to re-enable body.. it's done in SetMesh
+ _mesh = _parent_scene.mesher.CreateMesh(m_primName, _pbs, _size, _parent_scene.meshSculptLOD, IsPhysical);
+ // createmesh returns null when it's a shape that isn't a cube.
+ }
+ }
- if (_mesh == null )
- _mesh = _parent_scene.mesher.CreateMesh(m_primName, _pbs, _size, _parent_scene.meshSculptLOD, IsPhysical);
+ //if (_mesh == null )
+ // _mesh = _parent_scene.mesher.CreateMesh(m_primName, _pbs, _size, _parent_scene.meshSculptLOD, IsPhysical);
lock (OdeScene.OdeLock)
@@ -1323,7 +1323,7 @@ namespace OpenSim.Region.Physics.OdePlugin
// we don't need to do space calculation because the client sends a position update also.
// Construction of new prim
- //if (_parent_scene.needsMeshing(_pbs))
+ if (_parent_scene.needsMeshing(_pbs))
{
float meshlod = _parent_scene.meshSculptLOD;
@@ -1609,7 +1609,7 @@ namespace OpenSim.Region.Physics.OdePlugin
if (_size.Z <= 0) _size.Z = 0.01f;
// Construction of new prim
- //if (_parent_scene.needsMeshing(_pbs))
+ if (_parent_scene.needsMeshing(_pbs))
{
// Don't need to re-enable body.. it's done in SetMesh
float meshlod = _parent_scene.meshSculptLOD;
diff --git a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs
index ec0e0ff..3f8aa26 100644
--- a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs
+++ b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs
@@ -1174,16 +1174,17 @@ namespace OpenSim.Region.Physics.OdePlugin
//switch (pbs.ProfileShape)
//{
// case ProfileShape.Square:
- /// support simple box & hollow box now; later, more shapes
- //if (needsMeshing(pbs))
- //{
- // mesh = mesher.CreateMesh(primName, pbs, size, 32f, isPhysical);
- //}
+ // //support simple box & hollow box now; later, more shapes
+ // if (needsMeshing(pbs))
+ // {
+ // mesh = mesher.CreateMesh(primName, pbs, size, 32f, isPhysical);
+ // }
// break;
//}
- mesh = mesher.CreateMesh(primName, pbs, size, 32f, isPhysical);
+ if (needsMeshing(pbs))
+ mesh = mesher.CreateMesh(primName, pbs, size, 32f, isPhysical);
result = AddPrim(primName, position, size, rotation, mesh, pbs, isPhysical);
@@ -1523,14 +1524,18 @@ namespace OpenSim.Region.Physics.OdePlugin
///
///
///
- //public bool needsMeshing(PrimitiveBaseShape pbs)
- //{
+ public bool needsMeshing(PrimitiveBaseShape pbs)
+ {
+ // most of this is redundant now as the mesher will return null if it cant mesh a prim
+ // but we still need to check for sculptie meshing being enabled so this is the most
+ // convenient place to do it for now...
+
// //if (pbs.PathCurve == (byte)LLObject.PathCurve.Circle && pbs.ProfileCurve == (byte)LLObject.ProfileCurve.Circle && pbs.PathScaleY <= 0.75f)
// //Console.WriteLine("needsMeshing: " + " pathCurve: " + pbs.PathCurve.ToString() + " profileCurve: " + pbs.ProfileCurve.ToString() + " pathScaleY: " + LLObject.UnpackPathScale(pbs.PathScaleY).ToString());
- // if (pbs.SculptEntry && !meshSculptedPrim)
- // {
- // return false;
- // }
+ if (pbs.SculptEntry && !meshSculptedPrim)
+ {
+ return false;
+ }
// if (pbs.ProfileHollow != 0)
// return true;
@@ -1577,7 +1582,9 @@ namespace OpenSim.Region.Physics.OdePlugin
// return false;
- //}
+
+ return true; // assume the mesher will return a default shape or null and later code can deal with this
+ }
///
/// Called after our prim properties are set Scale, position etc.
@@ -1763,7 +1770,7 @@ namespace OpenSim.Region.Physics.OdePlugin
lock (_activeprims)
{
- if (timeStep < 0.2f)
+ //if (timeStep < 0.2f)
{
foreach (OdePrim actor in _activeprims)
{
--
cgit v1.1