diff options
author | Robert Adams | 2012-10-10 13:56:16 -0700 |
---|---|---|
committer | Robert Adams | 2012-10-11 14:01:18 -0700 |
commit | 3a458e2a36253f6514720213deaa19372b06cc52 (patch) | |
tree | 7d0d849232391402e74bf83909e4256ce890abb5 /OpenSim/Region/Physics/BulletSPlugin/BSDynamics.cs | |
parent | BulletSim: Change defaults for constraint CFM and ERP to make large linksets ... (diff) | |
download | opensim-SC-3a458e2a36253f6514720213deaa19372b06cc52.zip opensim-SC-3a458e2a36253f6514720213deaa19372b06cc52.tar.gz opensim-SC-3a458e2a36253f6514720213deaa19372b06cc52.tar.bz2 opensim-SC-3a458e2a36253f6514720213deaa19372b06cc52.tar.xz |
BulletSim: Use full linkset mass when computing vehicle gravity force. Add taint-time specification to new AddForce().
Diffstat (limited to 'OpenSim/Region/Physics/BulletSPlugin/BSDynamics.cs')
-rw-r--r-- | OpenSim/Region/Physics/BulletSPlugin/BSDynamics.cs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSDynamics.cs b/OpenSim/Region/Physics/BulletSPlugin/BSDynamics.cs index 76230a1..56342b8 100644 --- a/OpenSim/Region/Physics/BulletSPlugin/BSDynamics.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSDynamics.cs | |||
@@ -462,7 +462,7 @@ namespace OpenSim.Region.Physics.BulletSPlugin | |||
462 | return; | 462 | return; |
463 | 463 | ||
464 | // Set the prim's inertia to zero. The vehicle code handles that and this | 464 | // Set the prim's inertia to zero. The vehicle code handles that and this |
465 | // removes the torque action introduced by Bullet. | 465 | // removes the motion and torque actions introduced by Bullet. |
466 | Vector3 inertia = Vector3.Zero; | 466 | Vector3 inertia = Vector3.Zero; |
467 | BulletSimAPI.SetMassProps2(Prim.BSBody.ptr, Prim.MassRaw, inertia); | 467 | BulletSimAPI.SetMassProps2(Prim.BSBody.ptr, Prim.MassRaw, inertia); |
468 | BulletSimAPI.UpdateInertiaTensor2(Prim.BSBody.ptr); | 468 | BulletSimAPI.UpdateInertiaTensor2(Prim.BSBody.ptr); |
@@ -540,7 +540,7 @@ namespace OpenSim.Region.Physics.BulletSPlugin | |||
540 | // add Gravity and Buoyancy | 540 | // add Gravity and Buoyancy |
541 | // There is some gravity, make a gravity force vector that is applied after object velocity. | 541 | // There is some gravity, make a gravity force vector that is applied after object velocity. |
542 | // m_VehicleBuoyancy: -1=2g; 0=1g; 1=0g; | 542 | // m_VehicleBuoyancy: -1=2g; 0=1g; 1=0g; |
543 | Vector3 grav = Prim.PhysicsScene.DefaultGravity * (Prim.MassRaw * (1f - m_VehicleBuoyancy)); | 543 | Vector3 grav = Prim.PhysicsScene.DefaultGravity * (Prim.Linkset.LinksetMass * (1f - m_VehicleBuoyancy)); |
544 | 544 | ||
545 | /* | 545 | /* |
546 | * RA: Not sure why one would do this | 546 | * RA: Not sure why one would do this |
@@ -681,7 +681,7 @@ namespace OpenSim.Region.Physics.BulletSPlugin | |||
681 | Prim.ForceVelocity = m_newVelocity; | 681 | Prim.ForceVelocity = m_newVelocity; |
682 | // apply gravity force | 682 | // apply gravity force |
683 | // Why is this set here? The physics engine already does gravity. | 683 | // Why is this set here? The physics engine already does gravity. |
684 | Prim.AddForce(grav, false); | 684 | Prim.AddForce(grav, false, true); |
685 | 685 | ||
686 | // Apply friction | 686 | // Apply friction |
687 | Vector3 keepFraction = Vector3.One - (Vector3.One / (m_linearFrictionTimescale / pTimestep)); | 687 | Vector3 keepFraction = Vector3.One - (Vector3.One / (m_linearFrictionTimescale / pTimestep)); |