aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Physics/ChOdePlugin
diff options
context:
space:
mode:
authorKitto Flora2010-02-03 16:20:13 -0500
committerKitto Flora2010-02-03 16:20:13 -0500
commit48134af6162249885740bad80a6b1bbb618bbc6e (patch)
treed6a3349602666f84602f088fc4c58d0f2e212645 /OpenSim/Region/Physics/ChOdePlugin
parentMerge branch 'master' of ssh://3dhosting.de/var/git/careminster (diff)
downloadopensim-SC-48134af6162249885740bad80a6b1bbb618bbc6e.zip
opensim-SC-48134af6162249885740bad80a6b1bbb618bbc6e.tar.gz
opensim-SC-48134af6162249885740bad80a6b1bbb618bbc6e.tar.bz2
opensim-SC-48134af6162249885740bad80a6b1bbb618bbc6e.tar.xz
Motor angular decay fix.
Diffstat (limited to 'OpenSim/Region/Physics/ChOdePlugin')
-rw-r--r--OpenSim/Region/Physics/ChOdePlugin/ODEDynamics.cs11
1 files changed, 7 insertions, 4 deletions
diff --git a/OpenSim/Region/Physics/ChOdePlugin/ODEDynamics.cs b/OpenSim/Region/Physics/ChOdePlugin/ODEDynamics.cs
index c03e381..4eb3313 100644
--- a/OpenSim/Region/Physics/ChOdePlugin/ODEDynamics.cs
+++ b/OpenSim/Region/Physics/ChOdePlugin/ODEDynamics.cs
@@ -646,12 +646,15 @@ namespace OpenSim.Region.Physics.OdePlugin
646//if(frcount == 0) Console.WriteLine("V0 = {0}", angObjectVel); 646//if(frcount == 0) Console.WriteLine("V0 = {0}", angObjectVel);
647// Vector3 FrAaccel = m_lastAngularVelocity - angObjectVel; 647// Vector3 FrAaccel = m_lastAngularVelocity - angObjectVel;
648// Vector3 initavel = angObjectVel; 648// Vector3 initavel = angObjectVel;
649 // Decay Angular Motor 649 // Decay Angular Motor 1. In SL this also depends on attack rate! decay ~= 23/Attack.
650 float atk_decayfactor = 23.0f / (m_angularMotorTimescale * pTimestep);
651 m_angularMotorDVel -= m_angularMotorDVel / atk_decayfactor;
652 // Decay Angular Motor 2.
650 if (m_angularMotorDecayTimescale < 300.0f) 653 if (m_angularMotorDecayTimescale < 300.0f)
651 { 654 {
652 float decayfactor = m_angularMotorDecayTimescale/pTimestep; 655 float decayfactor = m_angularMotorDecayTimescale/pTimestep; // df = Dec / pts
653 Vector3 decayAmount = (m_angularMotorDVel/decayfactor); 656 Vector3 decayAmount = (m_angularMotorDVel/decayfactor); // v-da = v-Dvel / df = v-Dvel * pts / Dec
654 m_angularMotorDVel -= decayAmount; 657 m_angularMotorDVel -= decayAmount; // v-Dvel = v-Dvel - (v-Dvel / df = v-Dvel * pts / Dec)
655 658
656 if (m_angularMotorDVel.ApproxEquals(Vector3.Zero, 0.01f)) 659 if (m_angularMotorDVel.ApproxEquals(Vector3.Zero, 0.01f))
657 { 660 {