From f74a9bcdc7b0682c1c205e9d640fbfa5f214840b Mon Sep 17 00:00:00 2001 From: Dahlia Trimble Date: Thu, 24 Jul 2008 07:45:58 +0000 Subject: Implements llSetForce() and llGetForce(). These are experimental and the units may not match the Linden implementation. --- OpenSim/Region/Physics/OdePlugin/ODEPrim.cs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'OpenSim/Region/Physics/OdePlugin/ODEPrim.cs') diff --git a/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs b/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs index 59655d7..a4c0d79 100644 --- a/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs +++ b/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs @@ -103,6 +103,7 @@ namespace OpenSim.Region.Physics.OdePlugin private CollisionLocker ode; private bool m_taintforce = false; + private PhysicsVector m_force = new PhysicsVector(0.0f, 0.0f, 0.0f); private List m_forcelist = new List(); private IMesh _mesh; @@ -749,7 +750,7 @@ namespace OpenSim.Region.Physics.OdePlugin changeshape(timestep); // - if (m_taintforce) + if (m_taintforce || m_force != new PhysicsVector(0.0f, 0.0f, 0.0f)) changeAddForce(timestep); if (m_taintdisable) @@ -1751,7 +1752,8 @@ namespace OpenSim.Region.Physics.OdePlugin //m_log.Info("[PHYSICS]: dequeing forcelist"); if (IsPhysical) { - PhysicsVector iforce = new PhysicsVector(); + //PhysicsVector iforce = new PhysicsVector(); + PhysicsVector iforce = m_force * 100.0f; for (int i = 0; i < m_forcelist.Count; i++) { iforce = iforce + (m_forcelist[i] * 100); @@ -1856,7 +1858,9 @@ namespace OpenSim.Region.Physics.OdePlugin public override PhysicsVector Force { - get { return PhysicsVector.Zero; } + //get { return PhysicsVector.Zero; } + get { return m_force; } + set { m_force = value; } } public override PhysicsVector CenterOfMass -- cgit v1.1