diff options
author | Mike Mazur | 2009-02-03 08:31:08 +0000 |
---|---|---|
committer | Mike Mazur | 2009-02-03 08:31:08 +0000 |
commit | 949ae6136e24aee1cb8d06491fed75970cab38d2 (patch) | |
tree | 23d1f735e7997ab911b4de639cc5d5bca390477b /OpenSim/Region/Physics/OdePlugin/ODECharacter.cs | |
parent | Embed OpenSim.Data.addin.xml as a resource into OpenSim.Data.dll. (diff) | |
download | opensim-SC_OLD-949ae6136e24aee1cb8d06491fed75970cab38d2.zip opensim-SC_OLD-949ae6136e24aee1cb8d06491fed75970cab38d2.tar.gz opensim-SC_OLD-949ae6136e24aee1cb8d06491fed75970cab38d2.tar.bz2 opensim-SC_OLD-949ae6136e24aee1cb8d06491fed75970cab38d2.tar.xz |
Change access levels from private to protected to facilitate
subclassing; also add new method signatures. Thanks tuco and mikkopa.
Fix Mantis #3072.
Diffstat (limited to 'OpenSim/Region/Physics/OdePlugin/ODECharacter.cs')
-rw-r--r-- | OpenSim/Region/Physics/OdePlugin/ODECharacter.cs | 74 |
1 files changed, 37 insertions, 37 deletions
diff --git a/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs b/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs index 2cdc988..73b7612 100644 --- a/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs +++ b/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs | |||
@@ -57,73 +57,73 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
57 | } | 57 | } |
58 | public class OdeCharacter : PhysicsActor | 58 | public class OdeCharacter : PhysicsActor |
59 | { | 59 | { |
60 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 60 | protected static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
61 | 61 | ||
62 | private PhysicsVector _position; | 62 | protected PhysicsVector _position; |
63 | private d.Vector3 _zeroPosition; | 63 | protected d.Vector3 _zeroPosition; |
64 | // private d.Matrix3 m_StandUpRotation; | 64 | // protected d.Matrix3 m_StandUpRotation; |
65 | private bool _zeroFlag = false; | 65 | protected bool _zeroFlag = false; |
66 | private bool m_lastUpdateSent = false; | 66 | protected bool m_lastUpdateSent = false; |
67 | private PhysicsVector _velocity; | 67 | protected PhysicsVector _velocity; |
68 | private PhysicsVector _target_velocity; | 68 | protected PhysicsVector _target_velocity; |
69 | private PhysicsVector _acceleration; | 69 | protected PhysicsVector _acceleration; |
70 | private PhysicsVector m_rotationalVelocity; | 70 | protected PhysicsVector m_rotationalVelocity; |
71 | private float m_mass = 80f; | 71 | protected float m_mass = 80f; |
72 | public float m_density = 60f; | 72 | public float m_density = 60f; |
73 | private bool m_pidControllerActive = true; | 73 | protected bool m_pidControllerActive = true; |
74 | public float PID_D = 800.0f; | 74 | public float PID_D = 800.0f; |
75 | public float PID_P = 900.0f; | 75 | public float PID_P = 900.0f; |
76 | //private static float POSTURE_SERVO = 10000.0f; | 76 | //protected static float POSTURE_SERVO = 10000.0f; |
77 | public float CAPSULE_RADIUS = 0.37f; | 77 | public float CAPSULE_RADIUS = 0.37f; |
78 | public float CAPSULE_LENGTH = 2.140599f; | 78 | public float CAPSULE_LENGTH = 2.140599f; |
79 | public float m_tensor = 3800000f; | 79 | public float m_tensor = 3800000f; |
80 | public float heightFudgeFactor = 0.52f; | 80 | public float heightFudgeFactor = 0.52f; |
81 | public float walkDivisor = 1.3f; | 81 | public float walkDivisor = 1.3f; |
82 | public float runDivisor = 0.8f; | 82 | public float runDivisor = 0.8f; |
83 | private bool flying = false; | 83 | protected bool flying = false; |
84 | private bool m_iscolliding = false; | 84 | protected bool m_iscolliding = false; |
85 | private bool m_iscollidingGround = false; | 85 | protected bool m_iscollidingGround = false; |
86 | private bool m_wascolliding = false; | 86 | protected bool m_wascolliding = false; |
87 | private bool m_wascollidingGround = false; | 87 | protected bool m_wascollidingGround = false; |
88 | private bool m_iscollidingObj = false; | 88 | protected bool m_iscollidingObj = false; |
89 | private bool m_alwaysRun = false; | 89 | protected bool m_alwaysRun = false; |
90 | private bool m_hackSentFall = false; | 90 | protected bool m_hackSentFall = false; |
91 | private bool m_hackSentFly = false; | 91 | protected bool m_hackSentFly = false; |
92 | private PhysicsVector m_taintPosition = new PhysicsVector(0, 0, 0); | 92 | protected PhysicsVector m_taintPosition = new PhysicsVector(0, 0, 0); |
93 | public uint m_localID = 0; | 93 | public uint m_localID = 0; |
94 | public bool m_returnCollisions = false; | 94 | public bool m_returnCollisions = false; |
95 | // taints and their non-tainted counterparts | 95 | // taints and their non-tainted counterparts |
96 | public bool m_isPhysical = false; // the current physical status | 96 | public bool m_isPhysical = false; // the current physical status |
97 | public bool m_tainted_isPhysical = false; // set when the physical status is tainted (false=not existing in physics engine, true=existing) | 97 | public bool m_tainted_isPhysical = false; // set when the physical status is tainted (false=not existing in physics engine, true=existing) |
98 | private float m_tainted_CAPSULE_LENGTH; // set when the capsule length changes. | 98 | protected float m_tainted_CAPSULE_LENGTH; // set when the capsule length changes. |
99 | 99 | ||
100 | private float m_buoyancy = 0f; | 100 | protected float m_buoyancy = 0f; |
101 | 101 | ||
102 | // private CollisionLocker ode; | 102 | // protected CollisionLocker ode; |
103 | 103 | ||
104 | private string m_name = String.Empty; | 104 | protected string m_name = String.Empty; |
105 | 105 | ||
106 | private bool[] m_colliderarr = new bool[11]; | 106 | protected bool[] m_colliderarr = new bool[11]; |
107 | private bool[] m_colliderGroundarr = new bool[11]; | 107 | protected bool[] m_colliderGroundarr = new bool[11]; |
108 | 108 | ||
109 | // Default we're a Character | 109 | // Default we're a Character |
110 | private CollisionCategories m_collisionCategories = (CollisionCategories.Character); | 110 | protected CollisionCategories m_collisionCategories = (CollisionCategories.Character); |
111 | 111 | ||
112 | // Default, Collide with Other Geometries, spaces, bodies and characters. | 112 | // Default, Collide with Other Geometries, spaces, bodies and characters. |
113 | private CollisionCategories m_collisionFlags = (CollisionCategories.Geom | 113 | protected CollisionCategories m_collisionFlags = (CollisionCategories.Geom |
114 | | CollisionCategories.Space | 114 | | CollisionCategories.Space |
115 | | CollisionCategories.Body | 115 | | CollisionCategories.Body |
116 | | CollisionCategories.Character | 116 | | CollisionCategories.Character |
117 | | CollisionCategories.Land); | 117 | | CollisionCategories.Land); |
118 | public IntPtr Body = IntPtr.Zero; | 118 | public IntPtr Body = IntPtr.Zero; |
119 | private OdeScene _parent_scene; | 119 | protected OdeScene _parent_scene; |
120 | public IntPtr Shell = IntPtr.Zero; | 120 | public IntPtr Shell = IntPtr.Zero; |
121 | public IntPtr Amotor = IntPtr.Zero; | 121 | public IntPtr Amotor = IntPtr.Zero; |
122 | public d.Mass ShellMass; | 122 | public d.Mass ShellMass; |
123 | public bool collidelock = false; | 123 | public bool collidelock = false; |
124 | 124 | ||
125 | public int m_eventsubscription = 0; | 125 | public int m_eventsubscription = 0; |
126 | private CollisionEventUpdate CollisionEventsThisFrame = new CollisionEventUpdate(); | 126 | protected CollisionEventUpdate CollisionEventsThisFrame = new CollisionEventUpdate(); |
127 | 127 | ||
128 | 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) | 128 | 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) |
129 | { | 129 | { |
@@ -421,7 +421,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
421 | // WARNING: This MUST NOT be called outside of ProcessTaints, else we can have unsynchronized access | 421 | // WARNING: This MUST NOT be called outside of ProcessTaints, else we can have unsynchronized access |
422 | // to ODE internals. ProcessTaints is called from within thread-locked Simulate(), so it is the only | 422 | // to ODE internals. ProcessTaints is called from within thread-locked Simulate(), so it is the only |
423 | // place that is safe to call this routine AvatarGeomAndBodyCreation. | 423 | // place that is safe to call this routine AvatarGeomAndBodyCreation. |
424 | private void AvatarGeomAndBodyCreation(float npositionX, float npositionY, float npositionZ, float tensor) | 424 | protected void AvatarGeomAndBodyCreation(float npositionX, float npositionY, float npositionZ, float tensor) |
425 | { | 425 | { |
426 | //CAPSULE_LENGTH = -5; | 426 | //CAPSULE_LENGTH = -5; |
427 | //CAPSULE_RADIUS = -5; | 427 | //CAPSULE_RADIUS = -5; |
@@ -535,7 +535,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
535 | // This code is very useful. Written by DanX0r. We're just not using it right now. | 535 | // This code is very useful. Written by DanX0r. We're just not using it right now. |
536 | // Commented out to prevent a warning. | 536 | // Commented out to prevent a warning. |
537 | // | 537 | // |
538 | // private void standupStraight() | 538 | // protected void standupStraight() |
539 | // { | 539 | // { |
540 | // // The purpose of this routine here is to quickly stabilize the Body while it's popped up in the air. | 540 | // // The purpose of this routine here is to quickly stabilize the Body while it's popped up in the air. |
541 | // // The amotor needs a few seconds to stabilize so without it, the avatar shoots up sky high when you | 541 | // // 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 | |||
714 | /// This is the avatar's movement control + PID Controller | 714 | /// This is the avatar's movement control + PID Controller |
715 | /// </summary> | 715 | /// </summary> |
716 | /// <param name="timeStep"></param> | 716 | /// <param name="timeStep"></param> |
717 | public void Move(float timeStep) | 717 | public virtual void Move(float timeStep) |
718 | { | 718 | { |
719 | // no lock; for now it's only called from within Simulate() | 719 | // no lock; for now it's only called from within Simulate() |
720 | 720 | ||