diff --git a/OpenSim/Region/PhysicsModules/BulletS/BSActorMoveToTarget.cs b/OpenSim/Region/PhysicsModules/BulletS/BSActorMoveToTarget.cs index 3db8f2cf25..87cf9729ec 100755 --- a/OpenSim/Region/PhysicsModules/BulletS/BSActorMoveToTarget.cs +++ b/OpenSim/Region/PhysicsModules/BulletS/BSActorMoveToTarget.cs @@ -211,7 +211,7 @@ public class BSActorMoveToTarget : BSActor // Add enough force to overcome the mass of the object addedForce *= m_controllingPrim.Mass; - m_controllingPrim.AddForce(addedForce, false /* pushForce */, true /* inTaintTime */); + m_controllingPrim.AddForce(true /* inTaintTime */, addedForce); } m_physicsScene.DetailLog("{0},BSActorMoveToTarget.Mover3,move,fromPos={1},addedForce={2}", m_controllingPrim.LocalID, origPosition, addedForce); diff --git a/OpenSim/Region/PhysicsModules/BulletS/BSActorSetTorque.cs b/OpenSim/Region/PhysicsModules/BulletS/BSActorSetTorque.cs index a1cf4db95b..0261bcb937 100755 --- a/OpenSim/Region/PhysicsModules/BulletS/BSActorSetTorque.cs +++ b/OpenSim/Region/PhysicsModules/BulletS/BSActorSetTorque.cs @@ -127,7 +127,7 @@ public class BSActorSetTorque : BSActor m_physicsScene.DetailLog("{0},BSActorSetTorque,preStep,force={1}", m_controllingPrim.LocalID, m_controllingPrim.RawTorque); if (m_controllingPrim.PhysBody.HasPhysicalBody) { - m_controllingPrim.AddAngularForce(m_controllingPrim.RawTorque, false, true); + m_controllingPrim.AddAngularForce(true /* inTaintTime */, m_controllingPrim.RawTorque); m_controllingPrim.ActivateIfPhysical(false); } diff --git a/OpenSim/Region/PhysicsModules/BulletS/BSCharacter.cs b/OpenSim/Region/PhysicsModules/BulletS/BSCharacter.cs index ab9cc27e3f..0eb5fbace9 100644 --- a/OpenSim/Region/PhysicsModules/BulletS/BSCharacter.cs +++ b/OpenSim/Region/PhysicsModules/BulletS/BSCharacter.cs @@ -457,7 +457,7 @@ public sealed class BSCharacter : BSPhysObject get { return RawVelocity; } set { RawVelocity = value; - OMV.Vector3 vel = RawVelocity; + OMV.Vector3 vel = RawVelocity; DetailLog("{0}: set Velocity = {1}", LocalID, value); @@ -662,10 +662,10 @@ public sealed class BSCharacter : BSPhysObject addForce *= Mass * BSParam.AvatarAddForcePushFactor; DetailLog("{0},BSCharacter.addForce,call,force={1},addForce={2},push={3},mass={4}", LocalID, force, addForce, pushforce, Mass); - AddForce(addForce, pushforce, false); + AddForce(false, addForce); } - public override void AddForce(OMV.Vector3 force, bool pushforce, bool inTaintTime) { + public override void AddForce(bool inTaintTime, OMV.Vector3 force) { if (force.IsFinite()) { OMV.Vector3 addForce = Util.ClampV(force, BSParam.MaxAddForceMagnitude); @@ -692,7 +692,7 @@ public sealed class BSCharacter : BSPhysObject } } - public override void AddAngularForce(OMV.Vector3 force, bool pushforce, bool inTaintTime) { + public override void AddAngularForce(bool inTaintTime, OMV.Vector3 force) { } public override void SetMomentum(OMV.Vector3 momentum) { } diff --git a/OpenSim/Region/PhysicsModules/BulletS/BSDynamics.cs b/OpenSim/Region/PhysicsModules/BulletS/BSDynamics.cs index 0fc55776a4..313c961780 100644 --- a/OpenSim/Region/PhysicsModules/BulletS/BSDynamics.cs +++ b/OpenSim/Region/PhysicsModules/BulletS/BSDynamics.cs @@ -768,7 +768,7 @@ namespace OpenSim.Region.PhysicsModule.BulletS } if ((m_knownChanged & m_knownChangedForce) != 0) - ControllingPrim.AddForce((Vector3)m_knownForce, false /*pushForce*/, true /*inTaintTime*/); + ControllingPrim.AddForce(false /* inTaintTime */, (Vector3)m_knownForce); if ((m_knownChanged & m_knownChangedForceImpulse) != 0) ControllingPrim.AddForceImpulse((Vector3)m_knownForceImpulse, false /*pushforce*/, true /*inTaintTime*/); @@ -784,7 +784,7 @@ namespace OpenSim.Region.PhysicsModule.BulletS if ((m_knownChanged & m_knownChangedRotationalForce) != 0) { - ControllingPrim.AddAngularForce((Vector3)m_knownRotationalForce, false /*pushForce*/, true /*inTaintTime*/); + ControllingPrim.AddAngularForce(true /* inTaintTime */, (Vector3)m_knownRotationalForce); } // If we set one of the values (ie, the physics engine didn't do it) we must force diff --git a/OpenSim/Region/PhysicsModules/BulletS/BSPhysObject.cs b/OpenSim/Region/PhysicsModules/BulletS/BSPhysObject.cs index b50e4cce11..ff6baca149 100755 --- a/OpenSim/Region/PhysicsModules/BulletS/BSPhysObject.cs +++ b/OpenSim/Region/PhysicsModules/BulletS/BSPhysObject.cs @@ -245,10 +245,10 @@ public abstract class BSPhysObject : PhysicsActor public override void AddAngularForce(OMV.Vector3 force, bool pushforce) { - AddAngularForce(force, pushforce, false); + AddAngularForce(false, force); } - public abstract void AddAngularForce(OMV.Vector3 force, bool pushforce, bool inTaintTime); - public abstract void AddForce(OMV.Vector3 force, bool pushforce, bool inTaintTime); + public abstract void AddAngularForce(bool inTaintTime, OMV.Vector3 force); + public abstract void AddForce(bool inTaintTime, OMV.Vector3 force); public abstract OMV.Vector3 ForceRotationalVelocity { get; set; } diff --git a/OpenSim/Region/PhysicsModules/BulletS/BSPrim.cs b/OpenSim/Region/PhysicsModules/BulletS/BSPrim.cs index 1d552ebb4c..fd9b8344f4 100644 --- a/OpenSim/Region/PhysicsModules/BulletS/BSPrim.cs +++ b/OpenSim/Region/PhysicsModules/BulletS/BSPrim.cs @@ -394,7 +394,7 @@ public class BSPrim : BSPhysObject // Apply upforce and overcome gravity. OMV.Vector3 correctionForce = upForce - PhysScene.DefaultGravity; DetailLog("{0},BSPrim.PositionSanityCheck,applyForce,pos={1},upForce={2},correctionForce={3}", LocalID, RawPosition, upForce, correctionForce); - AddForce(correctionForce, false, inTaintTime); + AddForce(inTaintTime, correctionForce); ret = true; } } @@ -1249,14 +1249,18 @@ public class BSPrim : BSPhysObject // Per documentation, max force is limited. OMV.Vector3 addForce = Util.ClampV(force, BSParam.MaxAddForceMagnitude); - // Since this force is being applied in only one step, make this a force per second. - addForce /= PhysScene.LastTimeStep; - AddForce(addForce, pushforce, false /* inTaintTime */); + // Push forces seem to be scaled differently (follow pattern in ubODE) + if (!pushforce) { + // Since this force is being applied in only one step, make this a force per second. + addForce /= PhysScene.LastTimeStep; + } + + AddForce(false /* inTaintTime */, addForce); } // Applying a force just adds this to the total force on the object. // This added force will only last the next simulation tick. - public override void AddForce(OMV.Vector3 force, bool pushforce, bool inTaintTime) { + public override void AddForce(bool inTaintTime, OMV.Vector3 force) { // for an object, doesn't matter if force is a pushforce or not if (IsPhysicallyActive) { @@ -1315,7 +1319,7 @@ public class BSPrim : BSPhysObject } // BSPhysObject.AddAngularForce() - public override void AddAngularForce(OMV.Vector3 force, bool pushforce, bool inTaintTime) + public override void AddAngularForce(bool inTaintTime, OMV.Vector3 force) { if (force.IsFinite()) {