Reverts patch from tuco/mikkopa/sempuki mantis #3072

0.6.3-post-fixes
Teravus Ovares 2009-02-08 17:25:02 +00:00
parent 8cc327cfa3
commit 26ca3e26bf
7 changed files with 210 additions and 219 deletions

View File

@ -213,9 +213,6 @@ namespace OpenSim.Region.Physics.Manager
public abstract void SubscribeEvents(int ms);
public abstract void UnSubscribeEvents();
public abstract bool SubscribedEvents();
public virtual void SetCollisionMesh(byte[] meshdata, string meshname, bool scalemesh) { }
public virtual void SetBoundsScaling(bool scalemesh) { }
}
public class NullPhysicsActor : PhysicsActor

View File

@ -152,12 +152,6 @@ namespace OpenSim.Region.Physics.Manager
public abstract bool IsThreaded { get; }
public virtual uint Raycast(PhysicsVector pos, PhysicsVector dir, float rayLength, uint ignoreId)
{ return 0; }
public virtual void SetMaxFlightHeight(float maxheight) { }
private class NullPhysicsScene : PhysicsScene
{
private static int m_workIndicator;

View File

@ -57,73 +57,73 @@ namespace OpenSim.Region.Physics.OdePlugin
}
public class OdeCharacter : PhysicsActor
{
protected static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
protected PhysicsVector _position;
protected d.Vector3 _zeroPosition;
// protected d.Matrix3 m_StandUpRotation;
protected bool _zeroFlag = false;
protected bool m_lastUpdateSent = false;
protected PhysicsVector _velocity;
protected PhysicsVector _target_velocity;
protected PhysicsVector _acceleration;
protected PhysicsVector m_rotationalVelocity;
protected float m_mass = 80f;
private PhysicsVector _position;
private d.Vector3 _zeroPosition;
// private d.Matrix3 m_StandUpRotation;
private bool _zeroFlag = false;
private bool m_lastUpdateSent = false;
private PhysicsVector _velocity;
private PhysicsVector _target_velocity;
private PhysicsVector _acceleration;
private PhysicsVector m_rotationalVelocity;
private float m_mass = 80f;
public float m_density = 60f;
protected bool m_pidControllerActive = true;
private bool m_pidControllerActive = true;
public float PID_D = 800.0f;
public float PID_P = 900.0f;
//protected static float POSTURE_SERVO = 10000.0f;
//private static float POSTURE_SERVO = 10000.0f;
public float CAPSULE_RADIUS = 0.37f;
public float CAPSULE_LENGTH = 2.140599f;
public float m_tensor = 3800000f;
public float heightFudgeFactor = 0.52f;
public float walkDivisor = 1.3f;
public float runDivisor = 0.8f;
protected bool flying = false;
protected bool m_iscolliding = false;
protected bool m_iscollidingGround = false;
protected bool m_wascolliding = false;
protected bool m_wascollidingGround = false;
protected bool m_iscollidingObj = false;
protected bool m_alwaysRun = false;
protected bool m_hackSentFall = false;
protected bool m_hackSentFly = false;
protected PhysicsVector m_taintPosition = new PhysicsVector(0, 0, 0);
private bool flying = false;
private bool m_iscolliding = false;
private bool m_iscollidingGround = false;
private bool m_wascolliding = false;
private bool m_wascollidingGround = false;
private bool m_iscollidingObj = false;
private bool m_alwaysRun = false;
private bool m_hackSentFall = false;
private bool m_hackSentFly = false;
private PhysicsVector m_taintPosition = new PhysicsVector(0, 0, 0);
public uint m_localID = 0;
public bool m_returnCollisions = false;
// taints and their non-tainted counterparts
public bool m_isPhysical = false; // the current physical status
public bool m_tainted_isPhysical = false; // set when the physical status is tainted (false=not existing in physics engine, true=existing)
protected float m_tainted_CAPSULE_LENGTH; // set when the capsule length changes.
private float m_tainted_CAPSULE_LENGTH; // set when the capsule length changes.
protected float m_buoyancy = 0f;
private float m_buoyancy = 0f;
// protected CollisionLocker ode;
// private CollisionLocker ode;
protected string m_name = String.Empty;
private string m_name = String.Empty;
protected bool[] m_colliderarr = new bool[11];
protected bool[] m_colliderGroundarr = new bool[11];
private bool[] m_colliderarr = new bool[11];
private bool[] m_colliderGroundarr = new bool[11];
// Default we're a Character
protected CollisionCategories m_collisionCategories = (CollisionCategories.Character);
private CollisionCategories m_collisionCategories = (CollisionCategories.Character);
// Default, Collide with Other Geometries, spaces, bodies and characters.
protected CollisionCategories m_collisionFlags = (CollisionCategories.Geom
private CollisionCategories m_collisionFlags = (CollisionCategories.Geom
| CollisionCategories.Space
| CollisionCategories.Body
| CollisionCategories.Character
| CollisionCategories.Land);
public IntPtr Body = IntPtr.Zero;
protected OdeScene _parent_scene;
private OdeScene _parent_scene;
public IntPtr Shell = IntPtr.Zero;
public IntPtr Amotor = IntPtr.Zero;
public d.Mass ShellMass;
public bool collidelock = false;
public int m_eventsubscription = 0;
protected CollisionEventUpdate CollisionEventsThisFrame = new CollisionEventUpdate();
private CollisionEventUpdate CollisionEventsThisFrame = new CollisionEventUpdate();
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)
{
@ -421,7 +421,7 @@ namespace OpenSim.Region.Physics.OdePlugin
// WARNING: This MUST NOT be called outside of ProcessTaints, else we can have unsynchronized access
// to ODE internals. ProcessTaints is called from within thread-locked Simulate(), so it is the only
// place that is safe to call this routine AvatarGeomAndBodyCreation.
protected void AvatarGeomAndBodyCreation(float npositionX, float npositionY, float npositionZ, float tensor)
private void AvatarGeomAndBodyCreation(float npositionX, float npositionY, float npositionZ, float tensor)
{
//CAPSULE_LENGTH = -5;
//CAPSULE_RADIUS = -5;
@ -535,7 +535,7 @@ namespace OpenSim.Region.Physics.OdePlugin
// This code is very useful. Written by DanX0r. We're just not using it right now.
// Commented out to prevent a warning.
//
// protected void standupStraight()
// private void standupStraight()
// {
// // The purpose of this routine here is to quickly stabilize the Body while it's popped up in the air.
// // The amotor needs a few seconds to stabilize so without it, the avatar shoots up sky high when you
@ -714,7 +714,7 @@ namespace OpenSim.Region.Physics.OdePlugin
/// This is the avatar's movement control + PID Controller
/// </summary>
/// <param name="timeStep"></param>
public virtual void Move(float timeStep)
public void Move(float timeStep)
{
// no lock; for now it's only called from within Simulate()

View File

@ -43,54 +43,54 @@ namespace OpenSim.Region.Physics.OdePlugin
public class OdePrim : PhysicsActor
{
protected static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
protected PhysicsVector _position;
protected PhysicsVector _velocity;
protected PhysicsVector _torque = new PhysicsVector(0,0,0);
protected PhysicsVector m_lastVelocity = new PhysicsVector(0.0f, 0.0f, 0.0f);
protected PhysicsVector m_lastposition = new PhysicsVector(0.0f, 0.0f, 0.0f);
protected Quaternion m_lastorientation = new Quaternion();
protected PhysicsVector m_rotationalVelocity;
protected PhysicsVector _size;
protected PhysicsVector _acceleration;
// protected d.Vector3 _zeroPosition = new d.Vector3(0.0f, 0.0f, 0.0f);
protected Quaternion _orientation;
protected PhysicsVector m_taintposition;
protected PhysicsVector m_taintsize;
protected PhysicsVector m_taintVelocity = new PhysicsVector(0, 0, 0);
protected PhysicsVector m_taintTorque = new PhysicsVector(0, 0, 0);
protected Quaternion m_taintrot;
protected PhysicsVector m_angularlock = new PhysicsVector(1f, 1f, 1f);
protected PhysicsVector m_taintAngularLock = new PhysicsVector(1f, 1f, 1f);
protected IntPtr Amotor = IntPtr.Zero;
private PhysicsVector _position;
private PhysicsVector _velocity;
private PhysicsVector _torque = new PhysicsVector(0,0,0);
private PhysicsVector m_lastVelocity = new PhysicsVector(0.0f, 0.0f, 0.0f);
private PhysicsVector m_lastposition = new PhysicsVector(0.0f, 0.0f, 0.0f);
private Quaternion m_lastorientation = new Quaternion();
private PhysicsVector m_rotationalVelocity;
private PhysicsVector _size;
private PhysicsVector _acceleration;
// private d.Vector3 _zeroPosition = new d.Vector3(0.0f, 0.0f, 0.0f);
private Quaternion _orientation;
private PhysicsVector m_taintposition;
private PhysicsVector m_taintsize;
private PhysicsVector m_taintVelocity = new PhysicsVector(0, 0, 0);
private PhysicsVector m_taintTorque = new PhysicsVector(0, 0, 0);
private Quaternion m_taintrot;
private PhysicsVector m_angularlock = new PhysicsVector(1f, 1f, 1f);
private PhysicsVector m_taintAngularLock = new PhysicsVector(1f, 1f, 1f);
private IntPtr Amotor = IntPtr.Zero;
protected PhysicsVector m_PIDTarget = new PhysicsVector(0, 0, 0);
protected float m_PIDTau = 0f;
protected float PID_D = 35f;
protected float PID_G = 25f;
protected float m_tensor = 5f;
protected int body_autodisable_frames = 20;
protected IMesh primMesh = null;
private PhysicsVector m_PIDTarget = new PhysicsVector(0, 0, 0);
private float m_PIDTau = 0f;
private float PID_D = 35f;
private float PID_G = 25f;
private float m_tensor = 5f;
private int body_autodisable_frames = 20;
private IMesh primMesh = null;
protected bool m_usePID = false;
private bool m_usePID = false;
protected const CollisionCategories m_default_collisionFlags = (CollisionCategories.Geom
private const CollisionCategories m_default_collisionFlags = (CollisionCategories.Geom
| CollisionCategories.Space
| CollisionCategories.Body
| CollisionCategories.Character
);
protected bool m_taintshape = false;
protected bool m_taintPhysics = false;
protected bool m_collidesLand = true;
protected bool m_collidesWater = false;
private bool m_taintshape = false;
private bool m_taintPhysics = false;
private bool m_collidesLand = true;
private bool m_collidesWater = false;
public bool m_returnCollisions = false;
// Default we're a Geometry
protected CollisionCategories m_collisionCategories = (CollisionCategories.Geom);
private CollisionCategories m_collisionCategories = (CollisionCategories.Geom);
// Default, Collide with Other Geometries, spaces and Bodies
protected CollisionCategories m_collisionFlags = m_default_collisionFlags;
private CollisionCategories m_collisionFlags = m_default_collisionFlags;
public bool m_taintremove = false;
public bool m_taintdisable = false;
@ -102,58 +102,58 @@ namespace OpenSim.Region.Physics.OdePlugin
public uint m_localID = 0;
//public GCHandle gc;
protected CollisionLocker ode;
private CollisionLocker ode;
protected bool m_taintforce = false;
protected bool m_taintaddangularforce = false;
protected PhysicsVector m_force = new PhysicsVector(0.0f, 0.0f, 0.0f);
protected List<PhysicsVector> m_forcelist = new List<PhysicsVector>();
protected List<PhysicsVector> m_angularforcelist = new List<PhysicsVector>();
private bool m_taintforce = false;
private bool m_taintaddangularforce = false;
private PhysicsVector m_force = new PhysicsVector(0.0f, 0.0f, 0.0f);
private List<PhysicsVector> m_forcelist = new List<PhysicsVector>();
private List<PhysicsVector> m_angularforcelist = new List<PhysicsVector>();
protected IMesh _mesh;
protected PrimitiveBaseShape _pbs;
protected OdeScene _parent_scene;
private IMesh _mesh;
private PrimitiveBaseShape _pbs;
private OdeScene _parent_scene;
public IntPtr m_targetSpace = (IntPtr) 0;
public IntPtr prim_geom;
public IntPtr prev_geom;
public IntPtr _triMeshData;
protected IntPtr _linkJointGroup = (IntPtr)0;
protected PhysicsActor _parent = null;
protected PhysicsActor m_taintparent = null;
private IntPtr _linkJointGroup = (IntPtr)0;
private PhysicsActor _parent = null;
private PhysicsActor m_taintparent = null;
protected List<OdePrim> childrenPrim = new List<OdePrim>();
private List<OdePrim> childrenPrim = new List<OdePrim>();
protected bool iscolliding = false;
protected bool m_isphysical = false;
protected bool m_isSelected = false;
private bool iscolliding = false;
private bool m_isphysical = false;
private bool m_isSelected = false;
public bool m_isVolumeDetect = false; // If true, this prim only detects collisions but doesn't collide actively
internal bool m_isVolumeDetect = false; // If true, this prim only detects collisions but doesn't collide actively
protected bool m_throttleUpdates = false;
protected int throttleCounter = 0;
private bool m_throttleUpdates = false;
private int throttleCounter = 0;
public int m_interpenetrationcount = 0;
public float m_collisionscore = 0;
public int m_roundsUnderMotionThreshold = 0;
protected int m_crossingfailures = 0;
private int m_crossingfailures = 0;
public float m_buoyancy = 0f;
public bool outofBounds = false;
protected float m_density = 10.000006836f; // Aluminum g/cm3;
private float m_density = 10.000006836f; // Aluminum g/cm3;
public bool _zeroFlag = false;
protected bool m_lastUpdateSent = false;
private bool m_lastUpdateSent = false;
public IntPtr Body = (IntPtr) 0;
protected String m_primName;
protected PhysicsVector _target_velocity;
private String m_primName;
private PhysicsVector _target_velocity;
public d.Mass pMass;
public int m_eventsubscription = 0;
protected CollisionEventUpdate CollisionEventsThisFrame = null;
private CollisionEventUpdate CollisionEventsThisFrame = null;
protected IntPtr m_linkJoint = (IntPtr)0;
private IntPtr m_linkJoint = (IntPtr)0;
public volatile bool childPrim = false;
@ -338,7 +338,7 @@ namespace OpenSim.Region.Physics.OdePlugin
#region Mass Calculation
protected float CalculateMass()
private float CalculateMass()
{
float volume = 0;
@ -815,7 +815,7 @@ namespace OpenSim.Region.Physics.OdePlugin
// }
}
public virtual void ProcessTaints(float timestep)
public void ProcessTaints(float timestep)
{
if (m_taintadd)
{
@ -875,7 +875,7 @@ namespace OpenSim.Region.Physics.OdePlugin
}
}
protected void changeAngularLock(float timestep)
private void changeAngularLock(float timestep)
{
// do we have a Physical object?
if (Body != IntPtr.Zero)
@ -904,7 +904,7 @@ namespace OpenSim.Region.Physics.OdePlugin
m_angularlock = new PhysicsVector(m_taintAngularLock.X, m_taintAngularLock.Y, m_taintAngularLock.Z);
}
protected void changelink(float timestep)
private void changelink(float timestep)
{
// If the newly set parent is not null
// create link
@ -1095,7 +1095,7 @@ namespace OpenSim.Region.Physics.OdePlugin
}
public void ChildSetGeom(OdePrim odePrim)
private void ChildSetGeom(OdePrim odePrim)
{
//if (m_isphysical && Body != IntPtr.Zero)
lock (childrenPrim)
@ -1129,7 +1129,7 @@ namespace OpenSim.Region.Physics.OdePlugin
}
protected void ChildDelink(OdePrim odePrim)
private void ChildDelink(OdePrim odePrim)
{
// Okay, we have a delinked child.. need to rebuild the body.
lock (childrenPrim)
@ -1173,7 +1173,7 @@ namespace OpenSim.Region.Physics.OdePlugin
}
protected void changeSelectedStatus(float timestep)
private void changeSelectedStatus(float timestep)
{
if (m_taintselected)
{
@ -1603,7 +1603,7 @@ namespace OpenSim.Region.Physics.OdePlugin
m_taintrot = _orientation;
}
protected void resetCollisionAccounting()
private void resetCollisionAccounting()
{
m_collisionscore = 0;
m_interpenetrationcount = 0;
@ -2132,7 +2132,7 @@ namespace OpenSim.Region.Physics.OdePlugin
m_taintaddangularforce = false;
}
protected void changevelocity(float timestep)
private void changevelocity(float timestep)
{
if (!m_isSelected)
{
@ -2622,7 +2622,7 @@ namespace OpenSim.Region.Physics.OdePlugin
public override bool PIDActive { set { m_usePID = value; } }
public override float PIDTau { set { m_PIDTau = value; } }
protected void createAMotor(PhysicsVector axis)
private void createAMotor(PhysicsVector axis)
{
if (Body == IntPtr.Zero)
return;

View File

@ -37,9 +37,9 @@ namespace OpenSim.Region.Physics.OdePlugin
[TestFixture]
public class ODETestClass
{
protected OdePlugin cbt;
protected PhysicsScene ps;
protected IMeshingPlugin imp;
private OdePlugin cbt;
private PhysicsScene ps;
private IMeshingPlugin imp;
[SetUp]
public void Initialize()

View File

@ -34,7 +34,7 @@ using OpenSim.Region.Physics.OdePlugin;
namespace OpenSim.Region.Physics.OdePlugin
{
public class OdePhysicsJoint : PhysicsJoint
class OdePhysicsJoint : PhysicsJoint
{
public override bool IsInPhysicsEngine
{

View File

@ -52,10 +52,10 @@ namespace OpenSim.Region.Physics.OdePlugin
/// </summary>
public class OdePlugin : IPhysicsPlugin
{
//protected static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
//private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
protected CollisionLocker ode;
protected OdeScene _mScene;
private CollisionLocker ode;
private OdeScene _mScene;
public OdePlugin()
{
@ -124,62 +124,62 @@ namespace OpenSim.Region.Physics.OdePlugin
public class OdeScene : PhysicsScene
{
protected ILog m_log;
// protected Dictionary<string, sCollisionData> m_storedCollisions = new Dictionary<string, sCollisionData>();
private ILog m_log;
// private Dictionary<string, sCollisionData> m_storedCollisions = new Dictionary<string, sCollisionData>();
protected CollisionLocker ode;
CollisionLocker ode;
protected Random fluidRandomizer = new Random(Environment.TickCount);
protected const uint m_regionWidth = Constants.RegionSize;
protected const uint m_regionHeight = Constants.RegionSize;
private const uint m_regionWidth = Constants.RegionSize;
private const uint m_regionHeight = Constants.RegionSize;
protected float ODE_STEPSIZE = 0.020f;
protected float metersInSpace = 29.9f;
private float ODE_STEPSIZE = 0.020f;
private float metersInSpace = 29.9f;
public float gravityx = 0f;
public float gravityy = 0f;
public float gravityz = -9.8f;
protected float contactsurfacelayer = 0.001f;
private float contactsurfacelayer = 0.001f;
protected int worldHashspaceLow = -4;
protected int worldHashspaceHigh = 128;
private int worldHashspaceLow = -4;
private int worldHashspaceHigh = 128;
protected int smallHashspaceLow = -4;
protected int smallHashspaceHigh = 66;
private int smallHashspaceLow = -4;
private int smallHashspaceHigh = 66;
protected float waterlevel = 0f;
protected int framecount = 0;
//protected int m_returncollisions = 10;
private float waterlevel = 0f;
private int framecount = 0;
//private int m_returncollisions = 10;
protected IntPtr contactgroup;
protected IntPtr LandGeom;
private IntPtr contactgroup;
private IntPtr LandGeom;
protected IntPtr WaterGeom;
private IntPtr WaterGeom;
protected float nmTerrainContactFriction = 255.0f;
protected float nmTerrainContactBounce = 0.1f;
protected float nmTerrainContactERP = 0.1025f;
private float nmTerrainContactFriction = 255.0f;
private float nmTerrainContactBounce = 0.1f;
private float nmTerrainContactERP = 0.1025f;
protected float mTerrainContactFriction = 75f;
protected float mTerrainContactBounce = 0.1f;
protected float mTerrainContactERP = 0.05025f;
private float mTerrainContactFriction = 75f;
private float mTerrainContactBounce = 0.1f;
private float mTerrainContactERP = 0.05025f;
protected float nmAvatarObjectContactFriction = 250f;
protected float nmAvatarObjectContactBounce = 0.1f;
private float nmAvatarObjectContactFriction = 250f;
private float nmAvatarObjectContactBounce = 0.1f;
protected float mAvatarObjectContactFriction = 75f;
protected float mAvatarObjectContactBounce = 0.1f;
private float mAvatarObjectContactFriction = 75f;
private float mAvatarObjectContactBounce = 0.1f;
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;
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;
public bool meshSculptedPrim = true;
@ -200,66 +200,66 @@ namespace OpenSim.Region.Physics.OdePlugin
public int bodyFramesAutoDisable = 20;
protected float[] _heightmap;
private float[] _heightmap;
protected float[] _watermap;
protected bool m_filterCollisions = true;
private float[] _watermap;
private bool m_filterCollisions = true;
// protected float[] _origheightmap;
// private float[] _origheightmap;
protected d.NearCallback nearCallback;
private d.NearCallback nearCallback;
public d.TriCallback triCallback;
public d.TriArrayCallback triArrayCallback;
protected List<OdeCharacter> _characters = new List<OdeCharacter>();
protected List<OdePrim> _prims = new List<OdePrim>();
protected List<OdePrim> _activeprims = new List<OdePrim>();
protected List<OdePrim> _taintedPrim = new List<OdePrim>();
protected List<OdeCharacter> _taintedActors = new List<OdeCharacter>();
protected List<d.ContactGeom> _perloopContact = new List<d.ContactGeom>();
protected List<PhysicsActor> _collisionEventPrim = new List<PhysicsActor>();
private List<OdeCharacter> _characters = new List<OdeCharacter>();
private List<OdePrim> _prims = new List<OdePrim>();
private List<OdePrim> _activeprims = new List<OdePrim>();
private List<OdePrim> _taintedPrim = new List<OdePrim>();
private List<OdeCharacter> _taintedActors = new List<OdeCharacter>();
private List<d.ContactGeom> _perloopContact = new List<d.ContactGeom>();
private List<PhysicsActor> _collisionEventPrim = new List<PhysicsActor>();
public Dictionary<IntPtr, String> geom_name_map = new Dictionary<IntPtr, String>();
public Dictionary<IntPtr, PhysicsActor> actor_name_map = new Dictionary<IntPtr, PhysicsActor>();
protected bool m_NINJA_physics_joints_enabled = false;
//protected Dictionary<String, IntPtr> jointpart_name_map = new Dictionary<String,IntPtr>();
protected Dictionary<String, List<PhysicsJoint>> joints_connecting_actor = new Dictionary<String, List<PhysicsJoint>>();
protected d.ContactGeom[] contacts = new d.ContactGeom[80];
protected List<PhysicsJoint> requestedJointsToBeCreated = new List<PhysicsJoint>(); // lock only briefly. accessed by external code (to request new joints) and by OdeScene.Simulate() to move those joints into pending/active
protected List<PhysicsJoint> pendingJoints = new List<PhysicsJoint>(); // can lock for longer. accessed only by OdeScene.
protected List<PhysicsJoint> activeJoints = new List<PhysicsJoint>(); // can lock for longer. accessed only by OdeScene.
protected List<string> requestedJointsToBeDeleted = new List<string>(); // 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<String, PhysicsJoint> SOPName_to_activeJoint = new Dictionary<String, PhysicsJoint>();
protected Dictionary<String, PhysicsJoint> SOPName_to_pendingJoint = new Dictionary<String, PhysicsJoint>();
private bool m_NINJA_physics_joints_enabled = false;
//private Dictionary<String, IntPtr> jointpart_name_map = new Dictionary<String,IntPtr>();
private Dictionary<String, List<PhysicsJoint>> joints_connecting_actor = new Dictionary<String, List<PhysicsJoint>>();
private d.ContactGeom[] contacts = new d.ContactGeom[80];
private List<PhysicsJoint> requestedJointsToBeCreated = new List<PhysicsJoint>(); // lock only briefly. accessed by external code (to request new joints) and by OdeScene.Simulate() to move those joints into pending/active
private List<PhysicsJoint> pendingJoints = new List<PhysicsJoint>(); // can lock for longer. accessed only by OdeScene.
private List<PhysicsJoint> activeJoints = new List<PhysicsJoint>(); // can lock for longer. accessed only by OdeScene.
private List<string> requestedJointsToBeDeleted = new List<string>(); // 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<String, PhysicsJoint> SOPName_to_activeJoint = new Dictionary<String, PhysicsJoint>();
private Dictionary<String, PhysicsJoint> SOPName_to_pendingJoint = new Dictionary<String, PhysicsJoint>();
protected d.Contact contact;
protected d.Contact TerrainContact;
protected d.Contact AvatarMovementprimContact;
protected d.Contact AvatarMovementTerrainContact;
protected d.Contact WaterContact;
private d.Contact contact;
private d.Contact TerrainContact;
private d.Contact AvatarMovementprimContact;
private d.Contact AvatarMovementTerrainContact;
private d.Contact WaterContact;
//Ckrinke: Comment out until used. We declare it, initialize it, but do not use it
//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 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: Comment out until used. We declare it, initialize it, but do not use it
//Ckrinke protected int ms = 0;
//Ckrinke private int ms = 0;
public IntPtr world;
//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 = "";
//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 = "";
public IntPtr space;
//protected IntPtr tmpSpace;
//private 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;
protected IConfigSource m_config;
private IConfigSource m_config;
public bool physics_logging = false;
public int physics_logging_interval = 0;
@ -498,7 +498,7 @@ namespace OpenSim.Region.Physics.OdePlugin
}
}
public void waitForSpaceUnlock(IntPtr space)
internal void waitForSpaceUnlock(IntPtr space)
{
//if (space != IntPtr.Zero)
//while (d.SpaceLockQuery(space)) { } // Wait and do nothing
@ -522,7 +522,7 @@ namespace OpenSim.Region.Physics.OdePlugin
/// <param name="space">The space that contains the geoms. Remember, spaces are also geoms</param>
/// <param name="g1">a geometry or space</param>
/// <param name="g2">another geometry or space</param>
protected void near(IntPtr space, IntPtr g1, IntPtr g2)
private void near(IntPtr space, IntPtr g1, IntPtr g2)
{
// no lock here! It's invoked from within Simulate(), which is thread-locked
@ -949,7 +949,7 @@ namespace OpenSim.Region.Physics.OdePlugin
}
}
protected bool checkDupe(d.ContactGeom contactGeom, int atype)
private bool checkDupe(d.ContactGeom contactGeom, int atype)
{
bool result = false;
//return result;
@ -1019,7 +1019,7 @@ namespace OpenSim.Region.Physics.OdePlugin
return result;
}
protected void collision_accounting_events(PhysicsActor p1, PhysicsActor p2, float collisiondepth)
private void collision_accounting_events(PhysicsActor p1, PhysicsActor p2, float collisiondepth)
{
// obj1LocalID = 0;
//returncollisions = false;
@ -1197,7 +1197,7 @@ namespace OpenSim.Region.Physics.OdePlugin
/// This is our collision testing routine in ODE
/// </summary>
/// <param name="timeStep"></param>
protected void collision_optimized(float timeStep)
private void collision_optimized(float timeStep)
{
_perloopContact.Clear();
@ -1286,7 +1286,7 @@ namespace OpenSim.Region.Physics.OdePlugin
#endregion
// TODO: unused
// protected float GetTerrainHeightAtXY(float x, float y)
// private float GetTerrainHeightAtXY(float x, float y)
// {
// return (float)_origheightmap[(int)y * Constants.RegionSize + (int)x];
// }
@ -1332,7 +1332,7 @@ namespace OpenSim.Region.Physics.OdePlugin
}
}
protected PhysicsActor AddPrim(String name, PhysicsVector position, PhysicsVector size, Quaternion rotation,
private 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);
@ -1407,28 +1407,28 @@ namespace OpenSim.Region.Physics.OdePlugin
}
// internal utility function: must be called within a lock (OdeLock)
protected void InternalAddActiveJoint(PhysicsJoint joint)
private void InternalAddActiveJoint(PhysicsJoint joint)
{
activeJoints.Add(joint);
SOPName_to_activeJoint.Add(joint.ObjectNameInScene, joint);
}
// internal utility function: must be called within a lock (OdeLock)
protected void InternalAddPendingJoint(OdePhysicsJoint joint)
private void InternalAddPendingJoint(OdePhysicsJoint joint)
{
pendingJoints.Add(joint);
SOPName_to_pendingJoint.Add(joint.ObjectNameInScene, joint);
}
// internal utility function: must be called within a lock (OdeLock)
protected void InternalRemovePendingJoint(PhysicsJoint joint)
private void InternalRemovePendingJoint(PhysicsJoint joint)
{
pendingJoints.Remove(joint);
SOPName_to_pendingJoint.Remove(joint.ObjectNameInScene);
}
// internal utility function: must be called within a lock (OdeLock)
protected void InternalRemoveActiveJoint(PhysicsJoint joint)
private void InternalRemoveActiveJoint(PhysicsJoint joint)
{
activeJoints.Remove(joint);
SOPName_to_activeJoint.Remove(joint.ObjectNameInScene);
@ -1482,7 +1482,7 @@ namespace OpenSim.Region.Physics.OdePlugin
}
}
protected void DeleteRequestedJoints()
private void DeleteRequestedJoints()
{
List<string> myRequestedJointsToBeDeleted;
lock (externalJointRequestsLock)
@ -1562,7 +1562,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
protected void CreateRequestedJoints()
private void CreateRequestedJoints()
{
List<PhysicsJoint> myRequestedJointsToBeCreated;
lock (externalJointRequestsLock)
@ -1648,7 +1648,7 @@ namespace OpenSim.Region.Physics.OdePlugin
return joint;
}
protected void RemoveAllJointsConnectedToActor(PhysicsActor actor)
private 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)