From 949ae6136e24aee1cb8d06491fed75970cab38d2 Mon Sep 17 00:00:00 2001 From: Mike Mazur Date: Tue, 3 Feb 2009 08:31:08 +0000 Subject: Change access levels from private to protected to facilitate subclassing; also add new method signatures. Thanks tuco and mikkopa. Fix Mantis #3072. --- OpenSim/Region/Physics/OdePlugin/OdePlugin.cs | 200 +++++++++++++------------- 1 file changed, 100 insertions(+), 100 deletions(-) (limited to 'OpenSim/Region/Physics/OdePlugin/OdePlugin.cs') diff --git a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs index 3adabcf..9a1645d 100644 --- a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs +++ b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs @@ -52,10 +52,10 @@ namespace OpenSim.Region.Physics.OdePlugin /// public class OdePlugin : IPhysicsPlugin { - //private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); + //protected static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - private CollisionLocker ode; - private OdeScene _mScene; + protected CollisionLocker ode; + protected OdeScene _mScene; public OdePlugin() { @@ -124,62 +124,62 @@ namespace OpenSim.Region.Physics.OdePlugin public class OdeScene : PhysicsScene { - private ILog m_log; - // private Dictionary m_storedCollisions = new Dictionary(); + protected ILog m_log; + // protected Dictionary m_storedCollisions = new Dictionary(); - CollisionLocker ode; + protected CollisionLocker ode; protected Random fluidRandomizer = new Random(Environment.TickCount); - private const uint m_regionWidth = Constants.RegionSize; - private const uint m_regionHeight = Constants.RegionSize; + protected const uint m_regionWidth = Constants.RegionSize; + protected const uint m_regionHeight = Constants.RegionSize; - private float ODE_STEPSIZE = 0.020f; - private float metersInSpace = 29.9f; + protected float ODE_STEPSIZE = 0.020f; + protected float metersInSpace = 29.9f; public float gravityx = 0f; public float gravityy = 0f; public float gravityz = -9.8f; - private float contactsurfacelayer = 0.001f; + protected float contactsurfacelayer = 0.001f; - private int worldHashspaceLow = -4; - private int worldHashspaceHigh = 128; + protected int worldHashspaceLow = -4; + protected int worldHashspaceHigh = 128; - private int smallHashspaceLow = -4; - private int smallHashspaceHigh = 66; + protected int smallHashspaceLow = -4; + protected int smallHashspaceHigh = 66; - private float waterlevel = 0f; - private int framecount = 0; - //private int m_returncollisions = 10; + protected float waterlevel = 0f; + protected int framecount = 0; + //protected int m_returncollisions = 10; - private IntPtr contactgroup; - private IntPtr LandGeom; + protected IntPtr contactgroup; + protected IntPtr LandGeom; - private IntPtr WaterGeom; + protected IntPtr WaterGeom; - private float nmTerrainContactFriction = 255.0f; - private float nmTerrainContactBounce = 0.1f; - private float nmTerrainContactERP = 0.1025f; + protected float nmTerrainContactFriction = 255.0f; + protected float nmTerrainContactBounce = 0.1f; + protected float nmTerrainContactERP = 0.1025f; - private float mTerrainContactFriction = 75f; - private float mTerrainContactBounce = 0.1f; - private float mTerrainContactERP = 0.05025f; + protected float mTerrainContactFriction = 75f; + protected float mTerrainContactBounce = 0.1f; + protected float mTerrainContactERP = 0.05025f; - private float nmAvatarObjectContactFriction = 250f; - private float nmAvatarObjectContactBounce = 0.1f; + protected float nmAvatarObjectContactFriction = 250f; + protected float nmAvatarObjectContactBounce = 0.1f; - private float mAvatarObjectContactFriction = 75f; - private float mAvatarObjectContactBounce = 0.1f; + protected float mAvatarObjectContactFriction = 75f; + protected float mAvatarObjectContactBounce = 0.1f; - private float avPIDD = 3200f; - private float avPIDP = 1400f; - private float avCapRadius = 0.37f; - private float avStandupTensor = 2000000f; - private float avDensity = 80f; - private float avHeightFudgeFactor = 0.52f; - private float avMovementDivisorWalk = 1.3f; - private float avMovementDivisorRun = 0.8f; + protected float avPIDD = 3200f; + protected float avPIDP = 1400f; + protected float avCapRadius = 0.37f; + protected float avStandupTensor = 2000000f; + protected float avDensity = 80f; + protected float avHeightFudgeFactor = 0.52f; + protected float avMovementDivisorWalk = 1.3f; + protected float avMovementDivisorRun = 0.8f; public bool meshSculptedPrim = true; @@ -200,66 +200,66 @@ namespace OpenSim.Region.Physics.OdePlugin public int bodyFramesAutoDisable = 20; - private float[] _heightmap; + protected float[] _heightmap; - private float[] _watermap; - private bool m_filterCollisions = true; + protected float[] _watermap; + protected bool m_filterCollisions = true; - // private float[] _origheightmap; + // protected float[] _origheightmap; - private d.NearCallback nearCallback; + protected d.NearCallback nearCallback; public d.TriCallback triCallback; public d.TriArrayCallback triArrayCallback; - private List _characters = new List(); - private List _prims = new List(); - private List _activeprims = new List(); - private List _taintedPrim = new List(); - private List _taintedActors = new List(); - private List _perloopContact = new List(); - private List _collisionEventPrim = new List(); + protected List _characters = new List(); + protected List _prims = new List(); + protected List _activeprims = new List(); + protected List _taintedPrim = new List(); + protected List _taintedActors = new List(); + protected List _perloopContact = new List(); + protected List _collisionEventPrim = new List(); public Dictionary geom_name_map = new Dictionary(); public Dictionary actor_name_map = new Dictionary(); - private bool m_NINJA_physics_joints_enabled = false; - //private Dictionary jointpart_name_map = new Dictionary(); - private Dictionary> joints_connecting_actor = new Dictionary>(); - private d.ContactGeom[] contacts = new d.ContactGeom[80]; - private List requestedJointsToBeCreated = new List(); // lock only briefly. accessed by external code (to request new joints) and by OdeScene.Simulate() to move those joints into pending/active - private List pendingJoints = new List(); // can lock for longer. accessed only by OdeScene. - private List activeJoints = new List(); // can lock for longer. accessed only by OdeScene. - private List requestedJointsToBeDeleted = new List(); // lock only briefly. accessed by external code (to request deletion of joints) and by OdeScene.Simulate() to move those joints out of pending/active - private Object externalJointRequestsLock = new Object(); - private Dictionary SOPName_to_activeJoint = new Dictionary(); - private Dictionary SOPName_to_pendingJoint = new Dictionary(); - - private d.Contact contact; - private d.Contact TerrainContact; - private d.Contact AvatarMovementprimContact; - private d.Contact AvatarMovementTerrainContact; - private d.Contact WaterContact; + protected bool m_NINJA_physics_joints_enabled = false; + //protected Dictionary jointpart_name_map = new Dictionary(); + protected Dictionary> joints_connecting_actor = new Dictionary>(); + protected d.ContactGeom[] contacts = new d.ContactGeom[80]; + protected List requestedJointsToBeCreated = new List(); // lock only briefly. accessed by external code (to request new joints) and by OdeScene.Simulate() to move those joints into pending/active + protected List pendingJoints = new List(); // can lock for longer. accessed only by OdeScene. + protected List activeJoints = new List(); // can lock for longer. accessed only by OdeScene. + protected List requestedJointsToBeDeleted = new List(); // lock only briefly. accessed by external code (to request deletion of joints) and by OdeScene.Simulate() to move those joints out of pending/active + protected Object externalJointRequestsLock = new Object(); + protected Dictionary SOPName_to_activeJoint = new Dictionary(); + protected Dictionary SOPName_to_pendingJoint = new Dictionary(); + + protected d.Contact contact; + protected d.Contact TerrainContact; + protected d.Contact AvatarMovementprimContact; + protected d.Contact AvatarMovementTerrainContact; + protected d.Contact WaterContact; //Ckrinke: Comment out until used. We declare it, initialize it, but do not use it -//Ckrinke private int m_randomizeWater = 200; - private int m_physicsiterations = 10; - private float m_SkipFramesAtms = 0.40f; // Drop frames gracefully at a 400 ms lag - private PhysicsActor PANull = new NullPhysicsActor(); - private float step_time = 0.0f; +//Ckrinke protected int m_randomizeWater = 200; + protected int m_physicsiterations = 10; + protected float m_SkipFramesAtms = 0.40f; // Drop frames gracefully at a 400 ms lag + protected PhysicsActor PANull = new NullPhysicsActor(); + protected float step_time = 0.0f; //Ckrinke: Comment out until used. We declare it, initialize it, but do not use it -//Ckrinke private int ms = 0; +//Ckrinke protected int ms = 0; public IntPtr world; - //private bool returncollisions = false; - // private uint obj1LocalID = 0; - private uint obj2LocalID = 0; - //private int ctype = 0; - private OdeCharacter cc1; - private OdePrim cp1; - private OdeCharacter cc2; - private OdePrim cp2; - //private int cStartStop = 0; - //private string cDictKey = ""; + //protected bool returncollisions = false; + // protected uint obj1LocalID = 0; + protected uint obj2LocalID = 0; + //protected int ctype = 0; + protected OdeCharacter cc1; + protected OdePrim cp1; + protected OdeCharacter cc2; + protected OdePrim cp2; + //protected int cStartStop = 0; + //protected string cDictKey = ""; public IntPtr space; - //private IntPtr tmpSpace; + //protected IntPtr tmpSpace; // split static geometry collision handling into spaces of 30 meters public IntPtr[,] staticPrimspace; @@ -267,7 +267,7 @@ namespace OpenSim.Region.Physics.OdePlugin public IMesher mesher; - private IConfigSource m_config; + protected IConfigSource m_config; public bool physics_logging = false; public int physics_logging_interval = 0; @@ -493,7 +493,7 @@ namespace OpenSim.Region.Physics.OdePlugin } } - internal void waitForSpaceUnlock(IntPtr space) + public void waitForSpaceUnlock(IntPtr space) { //if (space != IntPtr.Zero) //while (d.SpaceLockQuery(space)) { } // Wait and do nothing @@ -517,7 +517,7 @@ namespace OpenSim.Region.Physics.OdePlugin /// The space that contains the geoms. Remember, spaces are also geoms /// a geometry or space /// another geometry or space - private void near(IntPtr space, IntPtr g1, IntPtr g2) + protected void near(IntPtr space, IntPtr g1, IntPtr g2) { // no lock here! It's invoked from within Simulate(), which is thread-locked @@ -912,7 +912,7 @@ namespace OpenSim.Region.Physics.OdePlugin } } - private bool checkDupe(d.ContactGeom contactGeom, int atype) + protected bool checkDupe(d.ContactGeom contactGeom, int atype) { bool result = false; //return result; @@ -982,7 +982,7 @@ namespace OpenSim.Region.Physics.OdePlugin return result; } - private void collision_accounting_events(PhysicsActor p1, PhysicsActor p2, float collisiondepth) + protected void collision_accounting_events(PhysicsActor p1, PhysicsActor p2, float collisiondepth) { // obj1LocalID = 0; //returncollisions = false; @@ -1160,7 +1160,7 @@ namespace OpenSim.Region.Physics.OdePlugin /// This is our collision testing routine in ODE /// /// - private void collision_optimized(float timeStep) + protected void collision_optimized(float timeStep) { _perloopContact.Clear(); @@ -1249,7 +1249,7 @@ namespace OpenSim.Region.Physics.OdePlugin #endregion // TODO: unused -// private float GetTerrainHeightAtXY(float x, float y) +// protected float GetTerrainHeightAtXY(float x, float y) // { // return (float)_origheightmap[(int)y * Constants.RegionSize + (int)x]; // } @@ -1295,7 +1295,7 @@ namespace OpenSim.Region.Physics.OdePlugin } } - private PhysicsActor AddPrim(String name, PhysicsVector position, PhysicsVector size, Quaternion rotation, + protected PhysicsActor AddPrim(String name, PhysicsVector position, PhysicsVector size, Quaternion rotation, IMesh mesh, PrimitiveBaseShape pbs, bool isphysical) { PhysicsVector pos = new PhysicsVector(position.X, position.Y, position.Z); @@ -1370,28 +1370,28 @@ namespace OpenSim.Region.Physics.OdePlugin } // internal utility function: must be called within a lock (OdeLock) - private void InternalAddActiveJoint(PhysicsJoint joint) + protected void InternalAddActiveJoint(PhysicsJoint joint) { activeJoints.Add(joint); SOPName_to_activeJoint.Add(joint.ObjectNameInScene, joint); } // internal utility function: must be called within a lock (OdeLock) - private void InternalAddPendingJoint(OdePhysicsJoint joint) + protected void InternalAddPendingJoint(OdePhysicsJoint joint) { pendingJoints.Add(joint); SOPName_to_pendingJoint.Add(joint.ObjectNameInScene, joint); } // internal utility function: must be called within a lock (OdeLock) - private void InternalRemovePendingJoint(PhysicsJoint joint) + protected void InternalRemovePendingJoint(PhysicsJoint joint) { pendingJoints.Remove(joint); SOPName_to_pendingJoint.Remove(joint.ObjectNameInScene); } // internal utility function: must be called within a lock (OdeLock) - private void InternalRemoveActiveJoint(PhysicsJoint joint) + protected void InternalRemoveActiveJoint(PhysicsJoint joint) { activeJoints.Remove(joint); SOPName_to_activeJoint.Remove(joint.ObjectNameInScene); @@ -1445,7 +1445,7 @@ namespace OpenSim.Region.Physics.OdePlugin } } - private void DeleteRequestedJoints() + protected void DeleteRequestedJoints() { List myRequestedJointsToBeDeleted; lock (externalJointRequestsLock) @@ -1525,7 +1525,7 @@ namespace OpenSim.Region.Physics.OdePlugin // for pending joints we don't know if their associated bodies exist yet or not. // the joint is actually created during processing of the taints - private void CreateRequestedJoints() + protected void CreateRequestedJoints() { List myRequestedJointsToBeCreated; lock (externalJointRequestsLock) @@ -1611,7 +1611,7 @@ namespace OpenSim.Region.Physics.OdePlugin return joint; } - private void RemoveAllJointsConnectedToActor(PhysicsActor actor) + protected void RemoveAllJointsConnectedToActor(PhysicsActor actor) { //m_log.Debug("RemoveAllJointsConnectedToActor: start"); if (actor.SOPName != null && joints_connecting_actor.ContainsKey(actor.SOPName) && joints_connecting_actor[actor.SOPName] != null) -- cgit v1.1