diff options
author | Teravus Ovares | 2008-01-27 03:18:10 +0000 |
---|---|---|
committer | Teravus Ovares | 2008-01-27 03:18:10 +0000 |
commit | 205001ab8d1a53338c3d98f52f381269124db928 (patch) | |
tree | baf7106595cb580f4069276186d9a45a20c250b1 /OpenSim/Region/Physics/OdePlugin/ODECharacter.cs | |
parent | * Shifted strategy of detecting specific *nix distributions to detecting *nix. (diff) | |
download | opensim-SC-205001ab8d1a53338c3d98f52f381269124db928.zip opensim-SC-205001ab8d1a53338c3d98f52f381269124db928.tar.gz opensim-SC-205001ab8d1a53338c3d98f52f381269124db928.tar.bz2 opensim-SC-205001ab8d1a53338c3d98f52f381269124db928.tar.xz |
* Highly experimental ODE_STEPSIZE = 0.025f - 1000 / 25 = 40fps - 10 substeps with fallback to 5 substeps when things get slow
* Just to give you an idea of the difference .. previous ODE_STEPSIZE was 0.005f - 1000/5 = 200fps - 10 substeps with fallback to 5 substeps when things get slow
* *nix avatar may fall over again, *sorry*
Diffstat (limited to 'OpenSim/Region/Physics/OdePlugin/ODECharacter.cs')
-rw-r--r-- | OpenSim/Region/Physics/OdePlugin/ODECharacter.cs | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs b/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs index 097e2aa..6bd2706 100644 --- a/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs +++ b/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs | |||
@@ -68,8 +68,8 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
68 | private float m_mass = 80f; | 68 | private float m_mass = 80f; |
69 | private float m_density = 60f; | 69 | private float m_density = 60f; |
70 | private bool m_pidControllerActive = true; | 70 | private bool m_pidControllerActive = true; |
71 | private static float PID_D = 3020.0f; | 71 | private float PID_D = 800.0f; |
72 | private static float PID_P = 7000.0f; | 72 | private float PID_P = 900.0f; |
73 | private static float POSTURE_SERVO = 10000.0f; | 73 | private static float POSTURE_SERVO = 10000.0f; |
74 | public static float CAPSULE_RADIUS = 0.37f; | 74 | public static float CAPSULE_RADIUS = 0.37f; |
75 | public float CAPSULE_LENGTH = 2.140599f; | 75 | public float CAPSULE_LENGTH = 2.140599f; |
@@ -112,11 +112,11 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
112 | if (System.Environment.OSVersion.Platform == PlatformID.Unix) | 112 | if (System.Environment.OSVersion.Platform == PlatformID.Unix) |
113 | { | 113 | { |
114 | m_foundDebian = true; | 114 | m_foundDebian = true; |
115 | m_tensor = 14000000f; | 115 | m_tensor = 1000000f; |
116 | } | 116 | } |
117 | else | 117 | else |
118 | { | 118 | { |
119 | m_tensor = 3800000f; | 119 | m_tensor = 1000000f; |
120 | } | 120 | } |
121 | 121 | ||
122 | m_StandUpRotation = | 122 | m_StandUpRotation = |
@@ -384,7 +384,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
384 | 384 | ||
385 | d.GeomSetBody(Shell, Body); | 385 | d.GeomSetBody(Shell, Body); |
386 | 386 | ||
387 | 387 | ||
388 | // 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 |
389 | // surrogate from rotating while moving | 389 | // surrogate from rotating while moving |
390 | Amotor = d.JointCreateAMotor(_parent_scene.world, IntPtr.Zero); | 390 | Amotor = d.JointCreateAMotor(_parent_scene.world, IntPtr.Zero); |
@@ -562,6 +562,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
562 | // If the PID Controller isn't active then we set our force | 562 | // If the PID Controller isn't active then we set our force |
563 | // calculating base velocity to the current position | 563 | // calculating base velocity to the current position |
564 | 564 | ||
565 | |||
565 | if (m_pidControllerActive == false) | 566 | if (m_pidControllerActive == false) |
566 | { | 567 | { |
567 | _zeroPosition = d.BodyGetPosition(Body); | 568 | _zeroPosition = d.BodyGetPosition(Body); |
@@ -598,11 +599,11 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
598 | // Prim to avatar collisions | 599 | // Prim to avatar collisions |
599 | 600 | ||
600 | d.Vector3 pos = d.BodyGetPosition(Body); | 601 | d.Vector3 pos = d.BodyGetPosition(Body); |
601 | vec.X = (_target_velocity.X - vel.X)*PID_D + (_zeroPosition.X - pos.X)*PID_P; | 602 | vec.X = (_target_velocity.X - vel.X) * (PID_D) + (_zeroPosition.X - pos.X) * PID_P; |
602 | vec.Y = (_target_velocity.Y - vel.Y)*PID_D + (_zeroPosition.Y - pos.Y)*PID_P; | 603 | vec.Y = (_target_velocity.Y - vel.Y)*(PID_D) + (_zeroPosition.Y - pos.Y)*PID_P; |
603 | if (flying) | 604 | if (flying) |
604 | { | 605 | { |
605 | vec.Z = (_target_velocity.Z - vel.Z)*(PID_D + 5100) + (_zeroPosition.Z - pos.Z)*PID_P; | 606 | vec.Z = (_target_velocity.Z - vel.Z) * (PID_D) + (_zeroPosition.Z - pos.Z) * PID_P; |
606 | } | 607 | } |
607 | } | 608 | } |
608 | //PidStatus = true; | 609 | //PidStatus = true; |
@@ -650,12 +651,12 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
650 | 651 | ||
651 | if (flying) | 652 | if (flying) |
652 | { | 653 | { |
653 | vec.Z = (_target_velocity.Z - vel.Z)*(PID_D + 5100); | 654 | vec.Z = (_target_velocity.Z - vel.Z) * (PID_D); |
654 | } | 655 | } |
655 | } | 656 | } |
656 | if (flying) | 657 | if (flying) |
657 | { | 658 | { |
658 | vec.Z += 10.0f; | 659 | vec.Z += (9.8f*m_mass); |
659 | } | 660 | } |
660 | 661 | ||
661 | 662 | ||