aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Region/Physics/UbitOdePlugin/ODECharacter.cs16
1 files changed, 11 insertions, 5 deletions
diff --git a/OpenSim/Region/Physics/UbitOdePlugin/ODECharacter.cs b/OpenSim/Region/Physics/UbitOdePlugin/ODECharacter.cs
index f5bf05d..94ed663 100644
--- a/OpenSim/Region/Physics/UbitOdePlugin/ODECharacter.cs
+++ b/OpenSim/Region/Physics/UbitOdePlugin/ODECharacter.cs
@@ -85,8 +85,12 @@ namespace OpenSim.Region.Physics.OdePlugin
85 public float PID_D = 800.0f; 85 public float PID_D = 800.0f;
86 public float PID_P = 900.0f; 86 public float PID_P = 900.0f;
87 //private static float POSTURE_SERVO = 10000.0f; 87 //private static float POSTURE_SERVO = 10000.0f;
88
88 public float CAPSULE_RADIUS = 0.37f; 89 public float CAPSULE_RADIUS = 0.37f;
89 public float CAPSULE_LENGTH = 2.140599f; 90 public float CAPSULE_LENGTH = 2.140599f;
91
92 const float CAP_OFFSET = -.2f; // compensation of SL size offset plus spheric collision shape bottom
93
90 public float walkDivisor = 1.3f; 94 public float walkDivisor = 1.3f;
91 public float runDivisor = 0.8f; 95 public float runDivisor = 0.8f;
92 private bool flying = false; 96 private bool flying = false;
@@ -139,6 +143,8 @@ namespace OpenSim.Region.Physics.OdePlugin
139 143
140 float mu; 144 float mu;
141 145
146
147
142 public OdeCharacter(String avName, OdeScene parent_scene, Vector3 pos, Vector3 size, float pid_d, float pid_p, float capsule_radius, float density, float walk_divisor, float rundivisor) 148 public OdeCharacter(String avName, OdeScene parent_scene, Vector3 pos, Vector3 size, float pid_d, float pid_p, float capsule_radius, float density, float walk_divisor, float rundivisor)
143 { 149 {
144 m_uuid = UUID.Random(); 150 m_uuid = UUID.Random();
@@ -177,7 +183,7 @@ namespace OpenSim.Region.Physics.OdePlugin
177 walkDivisor = walk_divisor; 183 walkDivisor = walk_divisor;
178 runDivisor = rundivisor; 184 runDivisor = rundivisor;
179 185
180 CAPSULE_LENGTH = size.Z * 1.15f - CAPSULE_RADIUS * 2.0f; 186 CAPSULE_LENGTH = size.Z - CAPSULE_RADIUS + CAP_OFFSET;
181 //m_log.Info("[SIZE]: " + CAPSULE_LENGTH.ToString()); 187 //m_log.Info("[SIZE]: " + CAPSULE_LENGTH.ToString());
182 188
183 m_isPhysical = false; // current status: no ODE information exists 189 m_isPhysical = false; // current status: no ODE information exists
@@ -422,7 +428,8 @@ namespace OpenSim.Region.Physics.OdePlugin
422 { 428 {
423 get { 429 get {
424 float d = CAPSULE_RADIUS * 2; 430 float d = CAPSULE_RADIUS * 2;
425 return new Vector3(d, d, (CAPSULE_LENGTH +d)/1.15f); } 431 return new Vector3(d, d, (CAPSULE_LENGTH + CAPSULE_RADIUS - CAP_OFFSET));
432 }
426 set 433 set
427 { 434 {
428 if (value.IsFinite()) 435 if (value.IsFinite())
@@ -837,8 +844,7 @@ namespace OpenSim.Region.Physics.OdePlugin
837 // colide with land 844 // colide with land
838 d.AABB aabb; 845 d.AABB aabb;
839 d.GeomGetAABB(Shell, out aabb); 846 d.GeomGetAABB(Shell, out aabb);
840 float chrminZ = aabb.MinZ; 847 float chrminZ = aabb.MinZ - 0.04f; // move up a bit
841
842 Vector3 posch = localpos; 848 Vector3 posch = localpos;
843 849
844 float ftmp; 850 float ftmp;
@@ -1224,7 +1230,7 @@ namespace OpenSim.Region.Physics.OdePlugin
1224 { 1230 {
1225 float caplen = Size.Z; 1231 float caplen = Size.Z;
1226 1232
1227 caplen = caplen * 1.15f - CAPSULE_RADIUS * 2.0f; 1233 caplen = caplen - CAPSULE_RADIUS + CAP_OFFSET;
1228 1234
1229 if (caplen != CAPSULE_LENGTH) 1235 if (caplen != CAPSULE_LENGTH)
1230 { 1236 {