diff options
author | Teravus Ovares | 2008-01-23 23:57:54 +0000 |
---|---|---|
committer | Teravus Ovares | 2008-01-23 23:57:54 +0000 |
commit | f0811e48009b172952f4a3205d799112c715d2c8 (patch) | |
tree | bb5902bbd9502cb4ea4fe336a5f762cb080b978b /OpenSim/Region | |
parent | * Added ReadEtcIssue to Util (diff) | |
download | opensim-SC_OLD-f0811e48009b172952f4a3205d799112c715d2c8.zip opensim-SC_OLD-f0811e48009b172952f4a3205d799112c715d2c8.tar.gz opensim-SC_OLD-f0811e48009b172952f4a3205d799112c715d2c8.tar.bz2 opensim-SC_OLD-f0811e48009b172952f4a3205d799112c715d2c8.tar.xz |
* This update updates ODE to again use the AMotor to keep the avatar upright instead of the 'avatar wobble' This also uses a hack to detect debian and change the force applied by the AMotor to a different value for Debian. The intent of this all is to get the avatar to stand up in Debian with the AMotor.
Diffstat (limited to 'OpenSim/Region')
-rw-r--r-- | OpenSim/Region/Environment/Scenes/Scene.cs | 8 | ||||
-rw-r--r-- | OpenSim/Region/Physics/OdePlugin/ODECharacter.cs | 64 |
2 files changed, 38 insertions, 34 deletions
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index c1c6fe9..6defe30 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs | |||
@@ -280,14 +280,6 @@ namespace OpenSim.Region.Environment.Scenes | |||
280 | 280 | ||
281 | m_statsReporter = new SimStatsReporter(regInfo); | 281 | m_statsReporter = new SimStatsReporter(regInfo); |
282 | m_statsReporter.OnSendStatsResult += SendSimStatsPackets; | 282 | m_statsReporter.OnSendStatsResult += SendSimStatsPackets; |
283 | MainLog.Instance.Verbose("PLATFORM", System.Environment.OSVersion.Platform.ToString()); | ||
284 | MainLog.Instance.Verbose("PLATFORM", System.Environment.OSVersion.ToString()); | ||
285 | string etcreturn = Util.ReadEtcIssue(); | ||
286 | if (etcreturn.Contains("Debian")) | ||
287 | { | ||
288 | MainLog.Instance.Verbose("PLATFORM", "Found Debian!"); | ||
289 | } | ||
290 | |||
291 | } | 283 | } |
292 | 284 | ||
293 | #endregion | 285 | #endregion |
diff --git a/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs b/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs index 08524a7..77f6db4 100644 --- a/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs +++ b/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs | |||
@@ -84,6 +84,8 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
84 | private bool m_alwaysRun = false; | 84 | private bool m_alwaysRun = false; |
85 | private bool m_hackSentFall = false; | 85 | private bool m_hackSentFall = false; |
86 | private bool m_hackSentFly = false; | 86 | private bool m_hackSentFly = false; |
87 | private bool m_foundDebian = false; | ||
88 | |||
87 | private string m_name = String.Empty; | 89 | private string m_name = String.Empty; |
88 | 90 | ||
89 | private bool[] m_colliderarr = new bool[11]; | 91 | private bool[] m_colliderarr = new bool[11]; |
@@ -106,7 +108,17 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
106 | _position = pos; | 108 | _position = pos; |
107 | _acceleration = new PhysicsVector(); | 109 | _acceleration = new PhysicsVector(); |
108 | _parent_scene = parent_scene; | 110 | _parent_scene = parent_scene; |
109 | 111 | string etcreturn = Util.ReadEtcIssue(); | |
112 | if (etcreturn.Contains("Debian")) | ||
113 | { | ||
114 | m_foundDebian = true; | ||
115 | m_tensor = 14000000f; | ||
116 | } | ||
117 | else | ||
118 | { | ||
119 | m_tensor = 3800000f; | ||
120 | } | ||
121 | |||
110 | m_StandUpRotation = | 122 | m_StandUpRotation = |
111 | new d.Matrix3(0.5f, 0.7071068f, 0.5f, -0.7071068f, 0f, 0.7071068f, 0.5f, -0.7071068f, | 123 | new d.Matrix3(0.5f, 0.7071068f, 0.5f, -0.7071068f, 0f, 0.7071068f, 0.5f, -0.7071068f, |
112 | 0.5f); | 124 | 0.5f); |
@@ -326,14 +338,14 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
326 | m_pidControllerActive = true; | 338 | m_pidControllerActive = true; |
327 | lock (OdeScene.OdeLock) | 339 | lock (OdeScene.OdeLock) |
328 | { | 340 | { |
329 | //d.JointDestroy(Amotor); | 341 | d.JointDestroy(Amotor); |
330 | 342 | ||
331 | PhysicsVector SetSize = value; | 343 | PhysicsVector SetSize = value; |
332 | float prevCapsule = CAPSULE_LENGTH; | 344 | float prevCapsule = CAPSULE_LENGTH; |
333 | float capsuleradius = CAPSULE_RADIUS; | 345 | float capsuleradius = CAPSULE_RADIUS; |
334 | //capsuleradius = 0.2f; | 346 | //capsuleradius = 0.2f; |
335 | 347 | ||
336 | CAPSULE_LENGTH = (SetSize.Z - ((SetSize.Z*0.43f))); // subtract 43% of the size | 348 | CAPSULE_LENGTH = (SetSize.Z - ((SetSize.Z*0.52f))); // subtract 43% of the size |
337 | OpenSim.Framework.Console.MainLog.Instance.Verbose("SIZE", CAPSULE_LENGTH.ToString()); | 349 | OpenSim.Framework.Console.MainLog.Instance.Verbose("SIZE", CAPSULE_LENGTH.ToString()); |
338 | d.BodyDestroy(Body); | 350 | d.BodyDestroy(Body); |
339 | d.GeomDestroy(Shell); | 351 | d.GeomDestroy(Shell); |
@@ -364,40 +376,40 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
364 | d.BodySetMass(Body, ref ShellMass); | 376 | d.BodySetMass(Body, ref ShellMass); |
365 | d.Matrix3 m_caprot; | 377 | d.Matrix3 m_caprot; |
366 | // 90 Stand up on the cap of the capped cyllinder | 378 | // 90 Stand up on the cap of the capped cyllinder |
367 | //d.RFromAxisAndAngle(out m_caprot, 1, 0, 1, (float)(Math.PI / 2)); | 379 | d.RFromAxisAndAngle(out m_caprot, 1, 0, 1, (float)(Math.PI / 2)); |
368 | 380 | ||
369 | 381 | ||
370 | //d.GeomSetRotation(Shell, ref m_caprot); | 382 | d.GeomSetRotation(Shell, ref m_caprot); |
371 | //d.BodySetRotation(Body, ref m_caprot); | 383 | d.BodySetRotation(Body, ref m_caprot); |
372 | 384 | ||
373 | d.GeomSetBody(Shell, Body); | 385 | d.GeomSetBody(Shell, Body); |
374 | 386 | ||
375 | 387 | ||
376 | // The purpose of the AMotor here is to keep the avatar's physical | 388 | // The purpose of the AMotor here is to keep the avatar's physical |
377 | // surrogate from rotating while moving | 389 | // surrogate from rotating while moving |
378 | //Amotor = d.JointCreateAMotor(_parent_scene.world, IntPtr.Zero); | 390 | Amotor = d.JointCreateAMotor(_parent_scene.world, IntPtr.Zero); |
379 | //d.JointAttach(Amotor, Body, IntPtr.Zero); | 391 | d.JointAttach(Amotor, Body, IntPtr.Zero); |
380 | ///d.JointSetAMotorMode(Amotor, dAMotorEuler); | 392 | d.JointSetAMotorMode(Amotor, dAMotorEuler); |
381 | //d.JointSetAMotorNumAxes(Amotor, 3); | 393 | d.JointSetAMotorNumAxes(Amotor, 3); |
382 | //d.JointSetAMotorAxis(Amotor, 0, 0, 1, 0, 0); | 394 | d.JointSetAMotorAxis(Amotor, 0, 0, 1, 0, 0); |
383 | //d.JointSetAMotorAxis(Amotor, 1, 0, 0, 1, 0); | 395 | d.JointSetAMotorAxis(Amotor, 1, 0, 0, 1, 0); |
384 | //d.JointSetAMotorAxis(Amotor, 2, 0, 0, 0, 1); | 396 | d.JointSetAMotorAxis(Amotor, 2, 0, 0, 0, 1); |
385 | //d.JointSetAMotorAngle(Amotor, 0, 0); | 397 | d.JointSetAMotorAngle(Amotor, 0, 0); |
386 | //d.JointSetAMotorAngle(Amotor, 1, 0); | 398 | d.JointSetAMotorAngle(Amotor, 1, 0); |
387 | //d.JointSetAMotorAngle(Amotor, 2, 0); | 399 | d.JointSetAMotorAngle(Amotor, 2, 0); |
388 | 400 | ||
389 | // These lowstops and high stops are effectively (no wiggle room) | 401 | // These lowstops and high stops are effectively (no wiggle room) |
390 | //d.JointSetAMotorParam(Amotor, (int)dParam.LowStop, -0.000000000001f); | 402 | d.JointSetAMotorParam(Amotor, (int)dParam.LowStop, -0.000000000001f); |
391 | //d.JointSetAMotorParam(Amotor, (int)dParam.LoStop3, -0.000000000001f); | 403 | d.JointSetAMotorParam(Amotor, (int)dParam.LoStop3, -0.000000000001f); |
392 | //d.JointSetAMotorParam(Amotor, (int)dParam.LoStop2, -0.000000000001f); | 404 | d.JointSetAMotorParam(Amotor, (int)dParam.LoStop2, -0.000000000001f); |
393 | //d.JointSetAMotorParam(Amotor, (int)dParam.HiStop, 0.000000000001f); | 405 | d.JointSetAMotorParam(Amotor, (int)dParam.HiStop, 0.000000000001f); |
394 | //d.JointSetAMotorParam(Amotor, (int)dParam.HiStop3, 0.000000000001f); | 406 | d.JointSetAMotorParam(Amotor, (int)dParam.HiStop3, 0.000000000001f); |
395 | //d.JointSetAMotorParam(Amotor, (int)dParam.HiStop2, 0.000000000001f); | 407 | d.JointSetAMotorParam(Amotor, (int)dParam.HiStop2, 0.000000000001f); |
396 | 408 | ||
397 | // Fudge factor is 1f by default, we're setting it to 0. We don't want it to Fudge or the | 409 | // Fudge factor is 1f by default, we're setting it to 0. We don't want it to Fudge or the |
398 | // capped cyllinder will fall over | 410 | // capped cyllinder will fall over |
399 | //d.JointSetAMotorParam(Amotor, (int)dParam.FudgeFactor, 0f); | 411 | d.JointSetAMotorParam(Amotor, (int)dParam.FudgeFactor, 0f); |
400 | //d.JointSetAMotorParam(Amotor, (int)dParam.FMax, tensor); | 412 | d.JointSetAMotorParam(Amotor, (int)dParam.FMax, tensor); |
401 | 413 | ||
402 | //d.Matrix3 bodyrotation = d.BodyGetRotation(Body); | 414 | //d.Matrix3 bodyrotation = d.BodyGetRotation(Body); |
403 | //d.QfromR( | 415 | //d.QfromR( |
@@ -528,7 +540,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
528 | { | 540 | { |
529 | d.BodyAddForce(Body, force.X, force.Y, force.Z); | 541 | d.BodyAddForce(Body, force.X, force.Y, force.Z); |
530 | //d.BodySetRotation(Body, ref m_StandUpRotation); | 542 | //d.BodySetRotation(Body, ref m_StandUpRotation); |
531 | standupStraight(); | 543 | //standupStraight(); |
532 | 544 | ||
533 | } | 545 | } |
534 | } | 546 | } |
@@ -721,7 +733,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
721 | lock (OdeScene.OdeLock) | 733 | lock (OdeScene.OdeLock) |
722 | { | 734 | { |
723 | // Kill the Amotor | 735 | // Kill the Amotor |
724 | //d.JointDestroy(Amotor); | 736 | d.JointDestroy(Amotor); |
725 | 737 | ||
726 | //kill the Geometry | 738 | //kill the Geometry |
727 | d.GeomDestroy(Shell); | 739 | d.GeomDestroy(Shell); |