diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs b/OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs index 8bb4b21..b9013ab 100644 --- a/OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs | |||
@@ -155,8 +155,7 @@ public sealed class BSCharacter : BSPhysObject | |||
155 | BulletSimAPI.SetCcdSweptSphereRadius2(BSBody.ptr, PhysicsScene.Params.ccdSweptSphereRadius); | 155 | BulletSimAPI.SetCcdSweptSphereRadius2(BSBody.ptr, PhysicsScene.Params.ccdSweptSphereRadius); |
156 | } | 156 | } |
157 | 157 | ||
158 | OMV.Vector3 localInertia = BulletSimAPI.CalculateLocalInertia2(BSShape.ptr, MassRaw); | 158 | UpdatePhysicalMassProperties(MassRaw); |
159 | BulletSimAPI.SetMassProps2(BSBody.ptr, MassRaw, localInertia); | ||
160 | 159 | ||
161 | // Make so capsule does not fall over | 160 | // Make so capsule does not fall over |
162 | BulletSimAPI.SetAngularFactorV2(BSBody.ptr, OMV.Vector3.Zero); | 161 | BulletSimAPI.SetAngularFactorV2(BSBody.ptr, OMV.Vector3.Zero); |
@@ -201,8 +200,7 @@ public sealed class BSCharacter : BSPhysObject | |||
201 | PhysicsScene.TaintedObject("BSCharacter.setSize", delegate() | 200 | PhysicsScene.TaintedObject("BSCharacter.setSize", delegate() |
202 | { | 201 | { |
203 | BulletSimAPI.SetLocalScaling2(BSShape.ptr, Scale); | 202 | BulletSimAPI.SetLocalScaling2(BSShape.ptr, Scale); |
204 | OMV.Vector3 localInertia = BulletSimAPI.CalculateLocalInertia2(BSShape.ptr, MassRaw); | 203 | UpdatePhysicalMassProperties(MassRaw); |
205 | BulletSimAPI.SetMassProps2(BSBody.ptr, MassRaw, localInertia); | ||
206 | }); | 204 | }); |
207 | 205 | ||
208 | } | 206 | } |
@@ -329,7 +327,14 @@ public sealed class BSCharacter : BSPhysObject | |||
329 | public override float Mass { get { return _mass; } } | 327 | public override float Mass { get { return _mass; } } |
330 | 328 | ||
331 | // used when we only want this prim's mass and not the linkset thing | 329 | // used when we only want this prim's mass and not the linkset thing |
332 | public override float MassRaw { get {return _mass; } } | 330 | public override float MassRaw { |
331 | get {return _mass; } | ||
332 | } | ||
333 | public override void UpdatePhysicalMassProperties(float physMass) | ||
334 | { | ||
335 | OMV.Vector3 localInertia = BulletSimAPI.CalculateLocalInertia2(BSShape.ptr, physMass); | ||
336 | BulletSimAPI.SetMassProps2(BSBody.ptr, physMass, localInertia); | ||
337 | } | ||
333 | 338 | ||
334 | public override OMV.Vector3 Force { | 339 | public override OMV.Vector3 Force { |
335 | get { return _force; } | 340 | get { return _force; } |