aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs
diff options
context:
space:
mode:
authorTeravus Ovares2009-03-07 00:27:56 +0000
committerTeravus Ovares2009-03-07 00:27:56 +0000
commit3a93bb992fade04a463d6cd91bc014b110e217a5 (patch)
treeb95ef31af1cb58bfec63e2639f2de0f7eaa0f165 /OpenSim/Region/Physics/OdePlugin/ODEPrim.cs
parentFixes Mantis #3260. Thank you kindly, MCortez for a patch that: (diff)
downloadopensim-SC_OLD-3a93bb992fade04a463d6cd91bc014b110e217a5.zip
opensim-SC_OLD-3a93bb992fade04a463d6cd91bc014b110e217a5.tar.gz
opensim-SC_OLD-3a93bb992fade04a463d6cd91bc014b110e217a5.tar.bz2
opensim-SC_OLD-3a93bb992fade04a463d6cd91bc014b110e217a5.tar.xz
* Added some limits to the maximum force applied per second by llMoveToTarget. Currently, it's 350 times the mass in newtons applied per second, maximum.
Diffstat (limited to 'OpenSim/Region/Physics/OdePlugin/ODEPrim.cs')
-rw-r--r--OpenSim/Region/Physics/OdePlugin/ODEPrim.cs19
1 files changed, 18 insertions, 1 deletions
diff --git a/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs b/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs
index f164048..3291b79 100644
--- a/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs
+++ b/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs
@@ -1500,6 +1500,8 @@ namespace OpenSim.Region.Physics.OdePlugin
1500 1500
1501 if (m_usePID) 1501 if (m_usePID)
1502 { 1502 {
1503 //if (!d.BodyIsEnabled(Body))
1504 //d.BodySetForce(Body, 0f, 0f, 0f);
1503 // If we're using the PID controller, then we have no gravity 1505 // If we're using the PID controller, then we have no gravity
1504 fz = (-1 * _parent_scene.gravityz) * m_mass; 1506 fz = (-1 * _parent_scene.gravityz) * m_mass;
1505 1507
@@ -1510,7 +1512,8 @@ namespace OpenSim.Region.Physics.OdePlugin
1510 1512
1511 if ((m_PIDTau < 1)) 1513 if ((m_PIDTau < 1))
1512 { 1514 {
1513 PID_G = PID_G / m_PIDTau; 1515 //PID_G = PID_G / m_PIDTau;
1516 m_PIDTau = 1;
1514 } 1517 }
1515 1518
1516 if ((PID_G - m_PIDTau) <= 0) 1519 if ((PID_G - m_PIDTau) <= 0)
@@ -1668,6 +1671,20 @@ namespace OpenSim.Region.Physics.OdePlugin
1668 d.BodySetForce(Body, 0, 0, 0); 1671 d.BodySetForce(Body, 0, 0, 0);
1669 enableBodySoft(); 1672 enableBodySoft();
1670 } 1673 }
1674
1675 // 35x10 = 350n times the mass per second applied maximum.
1676 float nmax = 35f * m_mass;
1677 float nmin = -35f * m_mass;
1678
1679
1680 if (fx > nmax)
1681 fx = nmax;
1682 if (fx < nmin)
1683 fx = nmin;
1684 if (fy > nmax)
1685 fy = nmax;
1686 if (fy < nmin)
1687 fy = nmin;
1671 d.BodyAddForce(Body, fx, fy, fz); 1688 d.BodyAddForce(Body, fx, fy, fz);
1672 } 1689 }
1673 } 1690 }