From 869883f2dc51f2b2210ccf8fd41f3de0c07e39fc Mon Sep 17 00:00:00 2001 From: Robert Adams Date: Fri, 22 Jul 2011 15:23:57 -0700 Subject: BulletSim: fix buoyancy for prims. Start of configurable physics parameters. --- OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs') diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs b/OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs index dbd7285..82361ad 100644 --- a/OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs @@ -107,7 +107,7 @@ public class BSCharacter : PhysicsActor shapeData.Velocity = _velocity; shapeData.Scale = _scale; shapeData.Mass = _mass; - shapeData.Buoyancy = isFlying ? 0f : 1f; + shapeData.Buoyancy = isFlying ? 1f : 0f; shapeData.Static = ShapeData.numericFalse; // do actual create at taint time @@ -258,7 +258,7 @@ public class BSCharacter : PhysicsActor _scene.TaintedObject(delegate() { // simulate flying by changing the effect of gravity - BulletSimAPI.SetObjectBuoyancy(_scene.WorldID, LocalID, _flying ? 0f : 1f); + BulletSimAPI.SetObjectBuoyancy(_scene.WorldID, LocalID, _flying ? 1f : 0f); }); } } @@ -296,7 +296,13 @@ public class BSCharacter : PhysicsActor } public override float Buoyancy { get { return _buoyancy; } - set { _buoyancy = value; } + set { _buoyancy = value; + _scene.TaintedObject(delegate() + { + // simulate flying by changing the effect of gravity + BulletSimAPI.SetObjectBuoyancy(_scene.WorldID, LocalID, _buoyancy); + }); + } } // Used for MoveTo -- cgit v1.1