From 7d55dfba8addd5c580e6c7bcf4449315428b84ed Mon Sep 17 00:00:00 2001 From: Dr Scofield Date: Fri, 27 Jun 2008 17:25:03 +0000 Subject: [PATCH] dr scofield's warnings safari: * commenting out unused variables --- .../Physics/BulletXPlugin/BulletXPlugin.cs | 13 ++- OpenSim/Region/Physics/Meshing/Extruder.cs | 12 +-- OpenSim/Region/Physics/Meshing/HelperTypes.cs | 3 + OpenSim/Region/Physics/Meshing/Meshmerizer.cs | 96 +++++++++---------- OpenSim/Region/Physics/Meshing/SculptMesh.cs | 2 +- .../Region/Physics/OdePlugin/ODECharacter.cs | 17 ++-- OpenSim/Region/Physics/OdePlugin/ODEPrim.cs | 10 +- OpenSim/Region/Physics/OdePlugin/OdePlugin.cs | 16 ++-- 8 files changed, 88 insertions(+), 81 deletions(-) diff --git a/OpenSim/Region/Physics/BulletXPlugin/BulletXPlugin.cs b/OpenSim/Region/Physics/BulletXPlugin/BulletXPlugin.cs index 1fa759cf72..144ad536f3 100644 --- a/OpenSim/Region/Physics/BulletXPlugin/BulletXPlugin.cs +++ b/OpenSim/Region/Physics/BulletXPlugin/BulletXPlugin.cs @@ -319,7 +319,10 @@ namespace OpenSim.Region.Physics.BulletXPlugin { int[] indexBase; Vector3[] vertexBase; - Vector3 vNormal, vP1, vP2, vP3; + Vector3 vNormal; + // Vector3 vP1; + // Vector3 vP2; + // Vector3 vP3; IMesh mesh = primB.GetMesh(); float fdistance; @@ -484,7 +487,7 @@ namespace OpenSim.Region.Physics.BulletXPlugin internal Dictionary _prims = new Dictionary(); public IMesher mesher; - private IConfigSource m_config; + // private IConfigSource m_config; public static float Gravity @@ -541,7 +544,7 @@ namespace OpenSim.Region.Physics.BulletXPlugin public override void Initialise(IMesher meshmerizer, IConfigSource config) { mesher = meshmerizer; - m_config = config; + // m_config = config; } public override void Dispose() @@ -1685,7 +1688,7 @@ namespace OpenSim.Region.Physics.BulletXPlugin // private PhysicsVector _staticVelocity; // private AxiomQuaternion _staticOrientation; private float _mass; - private BulletXScene _parentscene; + // private BulletXScene _parentscene; internal float[] _heightField; private RigidBody _flatPlanet; @@ -1700,7 +1703,7 @@ namespace OpenSim.Region.Physics.BulletXPlugin // _staticVelocity = new PhysicsVector(); // _staticOrientation = AxiomQuaternion.Identity; _mass = 0; //No active - _parentscene = parent_scene; + // _parentscene = parent_scene; _heightField = heightField; float _linearDamping = 0.0f; diff --git a/OpenSim/Region/Physics/Meshing/Extruder.cs b/OpenSim/Region/Physics/Meshing/Extruder.cs index baa2d9bf34..ac8d81c4e3 100644 --- a/OpenSim/Region/Physics/Meshing/Extruder.cs +++ b/OpenSim/Region/Physics/Meshing/Extruder.cs @@ -259,8 +259,8 @@ namespace OpenSim.Region.Physics.Meshing { Mesh result = new Mesh(); - Quaternion tt = new Quaternion(); - Vertex v2 = new Vertex(0, 0, 0); + // Quaternion tt = new Quaternion(); + // Vertex v2 = new Vertex(0, 0, 0); Mesh newLayer; Mesh lastLayer = null; @@ -441,8 +441,8 @@ namespace OpenSim.Region.Physics.Meshing { Mesh result = new Mesh(); - Quaternion tt = new Quaternion(); - Vertex v2 = new Vertex(0, 0, 0); + // Quaternion tt = new Quaternion(); + // Vertex v2 = new Vertex(0, 0, 0); Mesh newLayer; Mesh lastLayer = null; @@ -457,8 +457,8 @@ namespace OpenSim.Region.Physics.Meshing if (System.Math.Abs(twistTotal) > (float)System.Math.PI * 1.5f) steps *= 2; if (System.Math.Abs(twistTotal) > (float)System.Math.PI * 3.0f) steps *= 2; - double percentOfPathMultiplier = 1.0 / steps; - double angleStepMultiplier = System.Math.PI * 2.0 / steps; + // double percentOfPathMultiplier = 1.0 / steps; + // double angleStepMultiplier = System.Math.PI * 2.0 / steps; float yPathScale = pathScaleY * 0.5f; float pathLength = pathCutEnd - pathCutBegin; diff --git a/OpenSim/Region/Physics/Meshing/HelperTypes.cs b/OpenSim/Region/Physics/Meshing/HelperTypes.cs index f031fb6451..aed6c459aa 100644 --- a/OpenSim/Region/Physics/Meshing/HelperTypes.cs +++ b/OpenSim/Region/Physics/Meshing/HelperTypes.cs @@ -221,6 +221,7 @@ public class Vertex : PhysicsVector, IComparable v1.Z += am; return v1; } + public static Vertex operator -(Vertex v1, float am) { v1.X -= am; @@ -228,6 +229,7 @@ public class Vertex : PhysicsVector, IComparable v1.Z -= am; return v1; } + public static Vertex operator *(Vertex v1, float am) { v1.X *= am; @@ -235,6 +237,7 @@ public class Vertex : PhysicsVector, IComparable v1.Z *= am; return v1; } + public static Vertex operator /(Vertex v1, float am) { if (am == 0f) diff --git a/OpenSim/Region/Physics/Meshing/Meshmerizer.cs b/OpenSim/Region/Physics/Meshing/Meshmerizer.cs index 5a04a8eace..879129a064 100644 --- a/OpenSim/Region/Physics/Meshing/Meshmerizer.cs +++ b/OpenSim/Region/Physics/Meshing/Meshmerizer.cs @@ -432,8 +432,8 @@ namespace OpenSim.Region.Physics.Meshing UInt16 taperY = primShape.PathScaleY; UInt16 pathShearX = primShape.PathShearX; UInt16 pathShearY = primShape.PathShearY; - Int16 twistTop = primShape.PathTwistBegin; - Int16 twistBot = primShape.PathTwist; + // Int16 twistTop = primShape.PathTwistBegin; + // Int16 twistBot = primShape.PathTwist; #if SPAM reportPrimParams("[BOX] " + primName, primShape); @@ -690,8 +690,8 @@ namespace OpenSim.Region.Physics.Meshing UInt16 taperY = primShape.PathScaleY; UInt16 pathShearX = primShape.PathShearX; UInt16 pathShearY = primShape.PathShearY; - Int16 twistBot = primShape.PathTwist; - Int16 twistTop = primShape.PathTwistBegin; + // Int16 twistBot = primShape.PathTwist; + // Int16 twistTop = primShape.PathTwistBegin; #if SPAM reportPrimParams("[CYLINDER] " + primName, primShape); @@ -1043,8 +1043,8 @@ namespace OpenSim.Region.Physics.Meshing UInt16 pathShearX = primShape.PathShearX; UInt16 pathShearY = primShape.PathShearY; - Int16 twistTop = primShape.PathTwistBegin; - Int16 twistBot = primShape.PathTwist; + // Int16 twistTop = primShape.PathTwistBegin; + // Int16 twistBot = primShape.PathTwist; #if SPAM reportPrimParams("[PRISM] " + primName, primShape); @@ -1295,13 +1295,13 @@ namespace OpenSim.Region.Physics.Meshing // Still have more to do here. - UInt16 hollowFactor = primShape.ProfileHollow; - UInt16 profileBegin = primShape.ProfileBegin; - UInt16 profileEnd = primShape.ProfileEnd; - UInt16 taperX = primShape.PathScaleX; - UInt16 taperY = primShape.PathScaleY; - UInt16 pathShearX = primShape.PathShearX; - UInt16 pathShearY = primShape.PathShearY; + // UInt16 hollowFactor = primShape.ProfileHollow; + // UInt16 profileBegin = primShape.ProfileBegin; + // UInt16 profileEnd = primShape.ProfileEnd; + // UInt16 taperX = primShape.PathScaleX; + // UInt16 taperY = primShape.PathScaleY; + // UInt16 pathShearX = primShape.PathShearX; + // UInt16 pathShearY = primShape.PathShearY; Mesh m = new Mesh(); #if SPAM @@ -1424,12 +1424,12 @@ namespace OpenSim.Region.Physics.Meshing UInt16 hollowFactor = primShape.ProfileHollow; UInt16 profileBegin = primShape.ProfileBegin; UInt16 profileEnd = primShape.ProfileEnd; - UInt16 taperX = primShape.PathScaleX; - UInt16 taperY = primShape.PathScaleY; + // UInt16 taperX = primShape.PathScaleX; + // UInt16 taperY = primShape.PathScaleY; UInt16 pathShearX = primShape.PathShearX; UInt16 pathShearY = primShape.PathShearY; - Int16 twistBot = primShape.PathTwist; - Int16 twistTop = primShape.PathTwistBegin; + // Int16 twistBot = primShape.PathTwist; + // Int16 twistTop = primShape.PathTwistBegin; HollowShape hollowShape = primShape.HollowShape; #if SPAM @@ -1706,7 +1706,7 @@ namespace OpenSim.Region.Physics.Meshing foreach (Triangle t in m.triangles) t.invertNormal(); - Vertex vTemp = new Vertex(0.0f, 0.0f, 0.0f); + // Vertex vTemp = new Vertex(0.0f, 0.0f, 0.0f); float skew = primShape.PathSkew * 0.01f; @@ -2038,36 +2038,36 @@ namespace OpenSim.Region.Physics.Meshing return mesh; } - private static void reportPrimParams(string name, PrimitiveBaseShape primShape) - { -#if SPAM - float pathShearX = primShape.PathShearX < 128 ? (float)primShape.PathShearX * 0.01f : (float)(primShape.PathShearX - 256) * 0.01f; - float pathShearY = primShape.PathShearY < 128 ? (float)primShape.PathShearY * 0.01f : (float)(primShape.PathShearY - 256) * 0.01f; +// private static void reportPrimParams(string name, PrimitiveBaseShape primShape) +// { +// #if SPAM +// float pathShearX = primShape.PathShearX < 128 ? (float)primShape.PathShearX * 0.01f : (float)(primShape.PathShearX - 256) * 0.01f; +// float pathShearY = primShape.PathShearY < 128 ? (float)primShape.PathShearY * 0.01f : (float)(primShape.PathShearY - 256) * 0.01f; - Console.WriteLine("********************* PrimitiveBaseShape Parameters *******************\n" - + "Name.............: " + name.ToString() + "\n" - + "HollowShape......: " + primShape.HollowShape.ToString() + "\n" - + "PathBegin........: " + primShape.PathBegin.ToString() + "\n" - + "PathCurve........: " + primShape.PathCurve.ToString() + "\n" - + "PathEnd..........: " + primShape.PathEnd.ToString() + "\n" - + "PathRadiusOffset.: " + primShape.PathRadiusOffset.ToString() + "\n" - + "PathRevolutions..: " + primShape.PathRevolutions.ToString() + "\n" - + "PathScaleX.......: " + primShape.PathScaleX.ToString() + "\n" - + "PathScaleY.......: " + primShape.PathScaleY.ToString() + "\n" - + "PathShearX.......: " + primShape.PathShearX.ToString() + " (" + pathShearX.ToString() + ")\n" - + "PathShearY.......: " + primShape.PathShearY.ToString() + " (" + pathShearY.ToString() + ")\n" - + "PathSkew.........: " + primShape.PathSkew.ToString() + "\n" - + "PathTaperX.......: " + primShape.PathTaperX.ToString() + "\n" - + "PathTaperY.......: " + primShape.PathTaperY.ToString() + "\n" - + "PathTwist........: " + primShape.PathTwist.ToString() + "\n" - + "PathTwistBegin...: " + primShape.PathTwistBegin.ToString() + "\n" - + "ProfileBegin.....: " + primShape.ProfileBegin.ToString() + "\n" - + "ProfileCurve.....: " + primShape.ProfileCurve.ToString() + "\n" - + "ProfileEnd.......: " + primShape.ProfileEnd.ToString() + "\n" - + "ProfileHollow....: " + primShape.ProfileHollow.ToString() + "\n" - + "ProfileShape.....: " + primShape.ProfileShape.ToString() + "\n" - ); -#endif - } +// Console.WriteLine("********************* PrimitiveBaseShape Parameters *******************\n" +// + "Name.............: " + name.ToString() + "\n" +// + "HollowShape......: " + primShape.HollowShape.ToString() + "\n" +// + "PathBegin........: " + primShape.PathBegin.ToString() + "\n" +// + "PathCurve........: " + primShape.PathCurve.ToString() + "\n" +// + "PathEnd..........: " + primShape.PathEnd.ToString() + "\n" +// + "PathRadiusOffset.: " + primShape.PathRadiusOffset.ToString() + "\n" +// + "PathRevolutions..: " + primShape.PathRevolutions.ToString() + "\n" +// + "PathScaleX.......: " + primShape.PathScaleX.ToString() + "\n" +// + "PathScaleY.......: " + primShape.PathScaleY.ToString() + "\n" +// + "PathShearX.......: " + primShape.PathShearX.ToString() + " (" + pathShearX.ToString() + ")\n" +// + "PathShearY.......: " + primShape.PathShearY.ToString() + " (" + pathShearY.ToString() + ")\n" +// + "PathSkew.........: " + primShape.PathSkew.ToString() + "\n" +// + "PathTaperX.......: " + primShape.PathTaperX.ToString() + "\n" +// + "PathTaperY.......: " + primShape.PathTaperY.ToString() + "\n" +// + "PathTwist........: " + primShape.PathTwist.ToString() + "\n" +// + "PathTwistBegin...: " + primShape.PathTwistBegin.ToString() + "\n" +// + "ProfileBegin.....: " + primShape.ProfileBegin.ToString() + "\n" +// + "ProfileCurve.....: " + primShape.ProfileCurve.ToString() + "\n" +// + "ProfileEnd.......: " + primShape.ProfileEnd.ToString() + "\n" +// + "ProfileHollow....: " + primShape.ProfileHollow.ToString() + "\n" +// + "ProfileShape.....: " + primShape.ProfileShape.ToString() + "\n" +// ); +// #endif +// } } } diff --git a/OpenSim/Region/Physics/Meshing/SculptMesh.cs b/OpenSim/Region/Physics/Meshing/SculptMesh.cs index c9933fe66d..95a244d5f1 100644 --- a/OpenSim/Region/Physics/Meshing/SculptMesh.cs +++ b/OpenSim/Region/Physics/Meshing/SculptMesh.cs @@ -223,7 +223,7 @@ namespace OpenSim.Region.Physics.Meshing Vertex v1 = new Vertex(0,0,0); // Create a vertex position from the RGB channels in the current pixel - int ypos = y * bLOD.Width; + // int ypos = y * bLOD.Width; if (y == 0) diff --git a/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs b/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs index 89162a08f0..7f08cb4706 100644 --- a/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs +++ b/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs @@ -59,7 +59,7 @@ namespace OpenSim.Region.Physics.OdePlugin private PhysicsVector _position; private d.Vector3 _zeroPosition; - private d.Matrix3 m_StandUpRotation; + // private d.Matrix3 m_StandUpRotation; private bool _zeroFlag = false; private bool m_lastUpdateSent = false; private PhysicsVector _velocity; @@ -92,7 +92,7 @@ namespace OpenSim.Region.Physics.OdePlugin private float m_buoyancy = 0f; - private CollisionLocker ode; + // private CollisionLocker ode; private string m_name = String.Empty; @@ -120,7 +120,7 @@ namespace OpenSim.Region.Physics.OdePlugin public OdeCharacter(String avName, OdeScene parent_scene, PhysicsVector pos, CollisionLocker dode, PhysicsVector size, float pid_d, float pid_p, float capsule_radius, float tensor, float density, float height_fudge_factor, float walk_divisor, float rundivisor) { - ode = dode; + // ode = dode; _velocity = new PhysicsVector(); _target_velocity = new PhysicsVector(); _position = pos; @@ -137,9 +137,9 @@ namespace OpenSim.Region.Physics.OdePlugin runDivisor = rundivisor; - m_StandUpRotation = - new d.Matrix3(0.5f, 0.7071068f, 0.5f, -0.7071068f, 0f, 0.7071068f, 0.5f, -0.7071068f, - 0.5f); + // m_StandUpRotation = + // new d.Matrix3(0.5f, 0.7071068f, 0.5f, -0.7071068f, 0f, 0.7071068f, 0.5f, -0.7071068f, + // 0.5f); for (int i = 0; i < 11; i++) { @@ -392,7 +392,7 @@ namespace OpenSim.Region.Physics.OdePlugin PhysicsVector SetSize = value; float prevCapsule = CAPSULE_LENGTH; - float capsuleradius = CAPSULE_RADIUS; + // float capsuleradius = CAPSULE_RADIUS; //capsuleradius = 0.2f; CAPSULE_LENGTH = (SetSize.Z - ((SetSize.Z * heightFudgeFactor))); // subtract 43% of the size @@ -747,7 +747,8 @@ namespace OpenSim.Region.Physics.OdePlugin { // we're not colliding and we're not flying so that means we're falling! // m_iscolliding includes collisions with the ground. - d.Vector3 pos = d.BodyGetPosition(Body); + + // d.Vector3 pos = d.BodyGetPosition(Body); if (_target_velocity.X > 0) { vec.X = ((_target_velocity.X - vel.X)/1.2f)*PID_D; diff --git a/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs b/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs index 507030b005..defc0ca43c 100644 --- a/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs +++ b/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs @@ -53,7 +53,7 @@ namespace OpenSim.Region.Physics.OdePlugin private PhysicsVector m_rotationalVelocity; private PhysicsVector _size; private PhysicsVector _acceleration; - private d.Vector3 _zeroPosition = new d.Vector3(0.0f, 0.0f, 0.0f); + // private d.Vector3 _zeroPosition = new d.Vector3(0.0f, 0.0f, 0.0f); private Quaternion _orientation; private PhysicsVector m_taintposition; private PhysicsVector m_taintsize; @@ -1067,8 +1067,8 @@ namespace OpenSim.Region.Physics.OdePlugin } else { - string primScenAvatarIn = _parent_scene.whichspaceamIin(_position); - int[] arrayitem = _parent_scene.calculateSpaceArrayItemFromPos(_position); + // string primScenAvatarIn = _parent_scene.whichspaceamIin(_position); + // int[] arrayitem = _parent_scene.calculateSpaceArrayItemFromPos(_position); _parent_scene.waitForSpaceUnlock(m_targetSpace); IntPtr tempspace = _parent_scene.recalculateSpaceForGeom(prim_geom, _position, m_targetSpace); @@ -1141,7 +1141,7 @@ namespace OpenSim.Region.Physics.OdePlugin } //PidStatus = true; - PhysicsVector vec = new PhysicsVector(); + // PhysicsVector vec = new PhysicsVector(); d.Vector3 vel = d.BodyGetLinearVel(Body); d.Vector3 pos = d.BodyGetPosition(Body); @@ -1201,7 +1201,7 @@ namespace OpenSim.Region.Physics.OdePlugin } else { - _zeroPosition = d.BodyGetPosition(Body); + // _zeroPosition = d.BodyGetPosition(Body); return; } } diff --git a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs index 876629e8d9..3dd80ea975 100644 --- a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs +++ b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs @@ -117,7 +117,7 @@ namespace OpenSim.Region.Physics.OdePlugin public class OdeScene : PhysicsScene { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); - private Dictionary m_storedCollisions = new Dictionary(); + // private Dictionary m_storedCollisions = new Dictionary(); CollisionLocker ode; @@ -196,7 +196,7 @@ namespace OpenSim.Region.Physics.OdePlugin private float[] _watermap; - private float[] _origheightmap; + // private float[] _origheightmap; private d.NearCallback nearCallback; public d.TriCallback triCallback; @@ -226,7 +226,7 @@ namespace OpenSim.Region.Physics.OdePlugin //Ckrinke private int ms = 0; public IntPtr world; //private bool returncollisions = false; - private uint obj1LocalID = 0; + // private uint obj1LocalID = 0; private uint obj2LocalID = 0; //private int ctype = 0; private OdeCharacter cc1; @@ -501,7 +501,7 @@ namespace OpenSim.Region.Physics.OdePlugin IntPtr b1 = d.GeomGetBody(g1); IntPtr b2 = d.GeomGetBody(g2); - d.GeomClassID id = d.GeomGetClass(g1); + // d.GeomClassID id = d.GeomGetClass(g1); String name1 = null; String name2 = null; @@ -837,7 +837,7 @@ namespace OpenSim.Region.Physics.OdePlugin private void collision_accounting_events(PhysicsActor p1, PhysicsActor p2, float collisiondepth) { - obj1LocalID = 0; + // obj1LocalID = 0; //returncollisions = false; obj2LocalID = 0; //ctype = 0; @@ -850,7 +850,7 @@ namespace OpenSim.Region.Physics.OdePlugin case ActorTypes.Agent: cc2 = (OdeCharacter)p2; - obj1LocalID = cc2.m_localID; + // obj1LocalID = cc2.m_localID; switch ((ActorTypes)p1.PhysicsActorType) { case ActorTypes.Agent: @@ -893,7 +893,7 @@ namespace OpenSim.Region.Physics.OdePlugin case ActorTypes.Prim: cp2 = (OdePrim)p2; - obj1LocalID = cp2.m_localID; + // obj1LocalID = cp2.m_localID; switch ((ActorTypes)p1.PhysicsActorType) { case ActorTypes.Agent: @@ -2084,7 +2084,7 @@ namespace OpenSim.Region.Physics.OdePlugin { // this._heightmap[i] = (double)heightMap[i]; // dbm (danx0r) -- creating a buffer zone of one extra sample all around - _origheightmap = heightMap; + // _origheightmap = heightMap; const uint heightmapWidth = m_regionWidth + 2; const uint heightmapHeight = m_regionHeight + 2; const uint heightmapWidthSamples = 2*m_regionWidth + 2;