diff options
author | Justin Clark-Casey (justincc) | 2011-10-15 01:41:39 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2011-10-15 01:41:39 +0100 |
commit | 978fb3d482072d840e6280aa5acd090b67ee6205 (patch) | |
tree | 10ef8d7e8cd6a28ba6adf3af450b36dd4c766d7f /OpenSim/Region/Physics | |
parent | restrict unnecessary access levels on ODEPrim fields/properties (diff) | |
download | opensim-SC-978fb3d482072d840e6280aa5acd090b67ee6205.zip opensim-SC-978fb3d482072d840e6280aa5acd090b67ee6205.tar.gz opensim-SC-978fb3d482072d840e6280aa5acd090b67ee6205.tar.bz2 opensim-SC-978fb3d482072d840e6280aa5acd090b67ee6205.tar.xz |
reduce access to ODECharacter methods to make code analysis easier. Eliminate redundant argument on ProcessTaints()
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Physics/OdePlugin/ODECharacter.cs | 88 | ||||
-rw-r--r-- | OpenSim/Region/Physics/OdePlugin/OdeScene.cs | 2 |
2 files changed, 36 insertions, 54 deletions
diff --git a/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs b/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs index 7f3ae6b..771a2ea 100644 --- a/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs +++ b/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs | |||
@@ -78,17 +78,17 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
78 | private Vector3 _acceleration; | 78 | private Vector3 _acceleration; |
79 | private Vector3 m_rotationalVelocity; | 79 | private Vector3 m_rotationalVelocity; |
80 | private float m_mass = 80f; | 80 | private float m_mass = 80f; |
81 | public float m_density = 60f; | 81 | private float m_density = 60f; |
82 | private bool m_pidControllerActive = true; | 82 | private bool m_pidControllerActive = true; |
83 | public float PID_D = 800.0f; | 83 | private float PID_D = 800.0f; |
84 | public float PID_P = 900.0f; | 84 | private float PID_P = 900.0f; |
85 | //private static float POSTURE_SERVO = 10000.0f; | 85 | //private static float POSTURE_SERVO = 10000.0f; |
86 | public float CAPSULE_RADIUS = 0.37f; | 86 | private float CAPSULE_RADIUS = 0.37f; |
87 | public float CAPSULE_LENGTH = 2.140599f; | 87 | private float CAPSULE_LENGTH = 2.140599f; |
88 | public float m_tensor = 3800000f; | 88 | private float m_tensor = 3800000f; |
89 | public float heightFudgeFactor = 0.52f; | 89 | private float heightFudgeFactor = 0.52f; |
90 | public float walkDivisor = 1.3f; | 90 | private float walkDivisor = 1.3f; |
91 | public float runDivisor = 0.8f; | 91 | private float runDivisor = 0.8f; |
92 | private bool flying = false; | 92 | private bool flying = false; |
93 | private bool m_iscolliding = false; | 93 | private bool m_iscolliding = false; |
94 | private bool m_iscollidingGround = false; | 94 | private bool m_iscollidingGround = false; |
@@ -100,12 +100,11 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
100 | private bool m_hackSentFly = false; | 100 | private bool m_hackSentFly = false; |
101 | private int m_requestedUpdateFrequency = 0; | 101 | private int m_requestedUpdateFrequency = 0; |
102 | private Vector3 m_taintPosition = Vector3.Zero; | 102 | private Vector3 m_taintPosition = Vector3.Zero; |
103 | public uint m_localID = 0; | 103 | internal uint m_localID = 0; |
104 | public bool m_returnCollisions = false; | ||
105 | // taints and their non-tainted counterparts | 104 | // taints and their non-tainted counterparts |
106 | public bool m_isPhysical = false; // the current physical status | 105 | private bool m_isPhysical = false; // the current physical status |
107 | public bool m_tainted_isPhysical = false; // set when the physical status is tainted (false=not existing in physics engine, true=existing) | 106 | private bool m_tainted_isPhysical = false; // set when the physical status is tainted (false=not existing in physics engine, true=existing) |
108 | public float MinimumGroundFlightOffset = 3f; | 107 | internal float MinimumGroundFlightOffset = 3f; |
109 | 108 | ||
110 | private float m_tainted_CAPSULE_LENGTH; // set when the capsule length changes. | 109 | private float m_tainted_CAPSULE_LENGTH; // set when the capsule length changes. |
111 | 110 | ||
@@ -132,19 +131,18 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
132 | | CollisionCategories.Body | 131 | | CollisionCategories.Body |
133 | | CollisionCategories.Character | 132 | | CollisionCategories.Character |
134 | | CollisionCategories.Land); | 133 | | CollisionCategories.Land); |
135 | public IntPtr Body = IntPtr.Zero; | 134 | internal IntPtr Body = IntPtr.Zero; |
136 | private OdeScene _parent_scene; | 135 | private OdeScene _parent_scene; |
137 | public IntPtr Shell = IntPtr.Zero; | 136 | internal IntPtr Shell = IntPtr.Zero; |
138 | public IntPtr Amotor = IntPtr.Zero; | 137 | internal IntPtr Amotor = IntPtr.Zero; |
139 | public d.Mass ShellMass; | 138 | private d.Mass ShellMass; |
140 | public bool collidelock = false; | ||
141 | 139 | ||
142 | public int m_eventsubscription = 0; | 140 | private int m_eventsubscription = 0; |
143 | private CollisionEventUpdate CollisionEventsThisFrame = new CollisionEventUpdate(); | 141 | private CollisionEventUpdate CollisionEventsThisFrame = new CollisionEventUpdate(); |
144 | 142 | ||
145 | // unique UUID of this character object | 143 | // unique UUID of this character object |
146 | public UUID m_uuid; | 144 | internal UUID m_uuid { get; private set; } |
147 | public bool bad = false; | 145 | internal bool bad = false; |
148 | 146 | ||
149 | public OdeCharacter(String avName, OdeScene parent_scene, Vector3 pos, CollisionLocker dode, Vector3 size, float pid_d, float pid_p, float capsule_radius, float tensor, float density, float height_fudge_factor, float walk_divisor, float rundivisor) | 147 | public OdeCharacter(String avName, OdeScene parent_scene, Vector3 pos, CollisionLocker dode, Vector3 size, float pid_d, float pid_p, float capsule_radius, float tensor, float density, float height_fudge_factor, float walk_divisor, float rundivisor) |
150 | { | 148 | { |
@@ -680,20 +678,12 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
680 | return m_density*AVvolume; | 678 | return m_density*AVvolume; |
681 | } | 679 | } |
682 | } | 680 | } |
683 | public override void link(PhysicsActor obj) | ||
684 | { | ||
685 | |||
686 | } | ||
687 | 681 | ||
688 | public override void delink() | 682 | public override void link(PhysicsActor obj) {} |
689 | { | ||
690 | 683 | ||
691 | } | 684 | public override void delink() {} |
692 | 685 | ||
693 | public override void LockAngularMotion(Vector3 axis) | 686 | public override void LockAngularMotion(Vector3 axis) {} |
694 | { | ||
695 | |||
696 | } | ||
697 | 687 | ||
698 | // This code is very useful. Written by DanX0r. We're just not using it right now. | 688 | // This code is very useful. Written by DanX0r. We're just not using it right now. |
699 | // Commented out to prevent a warning. | 689 | // Commented out to prevent a warning. |
@@ -732,27 +722,22 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
732 | 722 | ||
733 | public override void VehicleFloatParam(int param, float value) | 723 | public override void VehicleFloatParam(int param, float value) |
734 | { | 724 | { |
735 | |||
736 | } | 725 | } |
737 | 726 | ||
738 | public override void VehicleVectorParam(int param, Vector3 value) | 727 | public override void VehicleVectorParam(int param, Vector3 value) |
739 | { | 728 | { |
740 | |||
741 | } | 729 | } |
742 | 730 | ||
743 | public override void VehicleRotationParam(int param, Quaternion rotation) | 731 | public override void VehicleRotationParam(int param, Quaternion rotation) |
744 | { | 732 | { |
745 | |||
746 | } | 733 | } |
747 | 734 | ||
748 | public override void VehicleFlags(int param, bool remove) | 735 | public override void VehicleFlags(int param, bool remove) |
749 | { | 736 | { |
750 | |||
751 | } | 737 | } |
752 | 738 | ||
753 | public override void SetVolumeDetect(int param) | 739 | public override void SetVolumeDetect(int param) |
754 | { | 740 | { |
755 | |||
756 | } | 741 | } |
757 | 742 | ||
758 | public override Vector3 CenterOfMass | 743 | public override Vector3 CenterOfMass |
@@ -772,13 +757,15 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
772 | 757 | ||
773 | public override Vector3 Velocity | 758 | public override Vector3 Velocity |
774 | { | 759 | { |
775 | get { | 760 | get |
761 | { | ||
776 | // There's a problem with Vector3.Zero! Don't Use it Here! | 762 | // There's a problem with Vector3.Zero! Don't Use it Here! |
777 | if (_zeroFlag) | 763 | if (_zeroFlag) |
778 | return Vector3.Zero; | 764 | return Vector3.Zero; |
779 | m_lastUpdateSent = false; | 765 | m_lastUpdateSent = false; |
780 | return _velocity; | 766 | return _velocity; |
781 | } | 767 | } |
768 | |||
782 | set | 769 | set |
783 | { | 770 | { |
784 | if (value.IsFinite()) | 771 | if (value.IsFinite()) |
@@ -872,7 +859,6 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
872 | 859 | ||
873 | public override void AddAngularForce(Vector3 force, bool pushforce) | 860 | public override void AddAngularForce(Vector3 force, bool pushforce) |
874 | { | 861 | { |
875 | |||
876 | } | 862 | } |
877 | 863 | ||
878 | /// <summary> | 864 | /// <summary> |
@@ -881,12 +867,9 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
881 | /// <param name="force"></param> | 867 | /// <param name="force"></param> |
882 | public void doForce(Vector3 force) | 868 | public void doForce(Vector3 force) |
883 | { | 869 | { |
884 | if (!collidelock) | 870 | d.BodyAddForce(Body, force.X, force.Y, force.Z); |
885 | { | 871 | //d.BodySetRotation(Body, ref m_StandUpRotation); |
886 | d.BodyAddForce(Body, force.X, force.Y, force.Z); | 872 | //standupStraight(); |
887 | //d.BodySetRotation(Body, ref m_StandUpRotation); | ||
888 | //standupStraight(); | ||
889 | } | ||
890 | } | 873 | } |
891 | 874 | ||
892 | public override void SetMomentum(Vector3 momentum) | 875 | public override void SetMomentum(Vector3 momentum) |
@@ -1074,7 +1057,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1074 | /// <summary> | 1057 | /// <summary> |
1075 | /// Updates the reported position and velocity. This essentially sends the data up to ScenePresence. | 1058 | /// Updates the reported position and velocity. This essentially sends the data up to ScenePresence. |
1076 | /// </summary> | 1059 | /// </summary> |
1077 | public void UpdatePositionAndVelocity() | 1060 | internal void UpdatePositionAndVelocity() |
1078 | { | 1061 | { |
1079 | // no lock; called from Simulate() -- if you call this from elsewhere, gotta lock or do Monitor.Enter/Exit! | 1062 | // no lock; called from Simulate() -- if you call this from elsewhere, gotta lock or do Monitor.Enter/Exit! |
1080 | d.Vector3 vec; | 1063 | d.Vector3 vec; |
@@ -1162,7 +1145,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1162 | /// <summary> | 1145 | /// <summary> |
1163 | /// Cleanup the things we use in the scene. | 1146 | /// Cleanup the things we use in the scene. |
1164 | /// </summary> | 1147 | /// </summary> |
1165 | public void Destroy() | 1148 | internal void Destroy() |
1166 | { | 1149 | { |
1167 | m_tainted_isPhysical = false; | 1150 | m_tainted_isPhysical = false; |
1168 | _parent_scene.AddPhysicsActorTaint(this); | 1151 | _parent_scene.AddPhysicsActorTaint(this); |
@@ -1221,7 +1204,6 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1221 | 1204 | ||
1222 | public override float APIDDamping{ set { return; } } | 1205 | public override float APIDDamping{ set { return; } } |
1223 | 1206 | ||
1224 | |||
1225 | public override void SubscribeEvents(int ms) | 1207 | public override void SubscribeEvents(int ms) |
1226 | { | 1208 | { |
1227 | m_requestedUpdateFrequency = ms; | 1209 | m_requestedUpdateFrequency = ms; |
@@ -1236,7 +1218,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1236 | m_eventsubscription = 0; | 1218 | m_eventsubscription = 0; |
1237 | } | 1219 | } |
1238 | 1220 | ||
1239 | public void AddCollisionEvent(uint CollidedWith, ContactPoint contact) | 1221 | internal void AddCollisionEvent(uint CollidedWith, ContactPoint contact) |
1240 | { | 1222 | { |
1241 | if (m_eventsubscription > 0) | 1223 | if (m_eventsubscription > 0) |
1242 | { | 1224 | { |
@@ -1247,7 +1229,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1247 | } | 1229 | } |
1248 | } | 1230 | } |
1249 | 1231 | ||
1250 | public void SendCollisions() | 1232 | internal void SendCollisions() |
1251 | { | 1233 | { |
1252 | if (m_eventsubscription > m_requestedUpdateFrequency) | 1234 | if (m_eventsubscription > m_requestedUpdateFrequency) |
1253 | { | 1235 | { |
@@ -1267,7 +1249,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1267 | return false; | 1249 | return false; |
1268 | } | 1250 | } |
1269 | 1251 | ||
1270 | public void ProcessTaints(float timestep) | 1252 | internal void ProcessTaints() |
1271 | { | 1253 | { |
1272 | if (m_tainted_isPhysical != m_isPhysical) | 1254 | if (m_tainted_isPhysical != m_isPhysical) |
1273 | { | 1255 | { |
@@ -1350,4 +1332,4 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1350 | m_eventsubscription += p; | 1332 | m_eventsubscription += p; |
1351 | } | 1333 | } |
1352 | } | 1334 | } |
1353 | } | 1335 | } \ No newline at end of file |
diff --git a/OpenSim/Region/Physics/OdePlugin/OdeScene.cs b/OpenSim/Region/Physics/OdePlugin/OdeScene.cs index 355d30b..fc45b82 100644 --- a/OpenSim/Region/Physics/OdePlugin/OdeScene.cs +++ b/OpenSim/Region/Physics/OdePlugin/OdeScene.cs | |||
@@ -2709,7 +2709,7 @@ Console.WriteLine("AddPhysicsActorTaint to " + taintedprim.Name); | |||
2709 | { | 2709 | { |
2710 | foreach (OdeCharacter character in _taintedActors) | 2710 | foreach (OdeCharacter character in _taintedActors) |
2711 | { | 2711 | { |
2712 | character.ProcessTaints(timeStep); | 2712 | character.ProcessTaints(); |
2713 | 2713 | ||
2714 | processedtaints = true; | 2714 | processedtaints = true; |
2715 | //character.m_collisionscore = 0; | 2715 | //character.m_collisionscore = 0; |