aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs
diff options
context:
space:
mode:
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 }