BulletSim: set buoyancy in only one place

0.7.4.1
Robert Adams 2012-03-16 17:13:06 -07:00
parent b22d040169
commit 6ecdadb329
1 changed files with 3 additions and 5 deletions

View File

@ -260,11 +260,8 @@ public class BSCharacter : PhysicsActor
get { return _flying; } get { return _flying; }
set { set {
_flying = value; _flying = value;
_scene.TaintedObject(delegate()
{
// simulate flying by changing the effect of gravity // simulate flying by changing the effect of gravity
BulletSimAPI.SetObjectBuoyancy(_scene.WorldID, LocalID, _flying ? 1f : 0f); this.Buoyancy(_flying ? 1f : 0f);
});
} }
} }
public override bool public override bool
@ -299,6 +296,7 @@ public class BSCharacter : PhysicsActor
get { return _kinematic; } get { return _kinematic; }
set { _kinematic = value; } set { _kinematic = value; }
} }
// neg=fall quickly, 0=1g, 1=0g, pos=float up
public override float Buoyancy { public override float Buoyancy {
get { return _buoyancy; } get { return _buoyancy; }
set { _buoyancy = value; set { _buoyancy = value;