From c67198299efbe3bfcea4c7d9705bcf53c0f52bd3 Mon Sep 17 00:00:00 2001 From: Dahlia Trimble Date: Thu, 24 Jul 2008 21:05:30 +0000 Subject: Changed application of constant forces to after PID force is applied. llSetForce() should behave identical to the Linden implementation now. --- OpenSim/Region/Physics/OdePlugin/ODEPrim.cs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs b/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs index a4c0d79..c1e54da 100644 --- a/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs +++ b/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs @@ -750,7 +750,7 @@ namespace OpenSim.Region.Physics.OdePlugin changeshape(timestep); // - if (m_taintforce || m_force != new PhysicsVector(0.0f, 0.0f, 0.0f)) + if (m_taintforce) changeAddForce(timestep); if (m_taintdisable) @@ -1194,6 +1194,10 @@ namespace OpenSim.Region.Physics.OdePlugin fy *= m_mass; //fz *= m_mass; + fx += m_force.X; + fy += m_force.Y; + fz += m_force.Z; + //m_log.Info("[OBJPID]: X:" + fx.ToString() + " Y:" + fy.ToString() + " Z:" + fz.ToString()); if (fx != 0 || fy != 0 || fz != 0) { @@ -1752,8 +1756,7 @@ namespace OpenSim.Region.Physics.OdePlugin //m_log.Info("[PHYSICS]: dequeing forcelist"); if (IsPhysical) { - //PhysicsVector iforce = new PhysicsVector(); - PhysicsVector iforce = m_force * 100.0f; + PhysicsVector iforce = new PhysicsVector(); for (int i = 0; i < m_forcelist.Count; i++) { iforce = iforce + (m_forcelist[i] * 100); @@ -1767,6 +1770,7 @@ namespace OpenSim.Region.Physics.OdePlugin m_collisionscore = 0; m_interpenetrationcount = 0; } + m_taintforce = false; } -- cgit v1.1