aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Physics
diff options
context:
space:
mode:
authorRobert Adams2012-10-29 14:32:07 -0700
committerRobert Adams2012-11-03 21:14:33 -0700
commit42d65840c843f2cac6f02fc1b6012140c9cb240e (patch)
tree63946d9c226b0ce3e55cb614e33ae6e89df5a453 /OpenSim/Region/Physics
parentBulletSim: fix problem with multiple linksets stepping on each other if they ... (diff)
downloadopensim-SC_OLD-42d65840c843f2cac6f02fc1b6012140c9cb240e.zip
opensim-SC_OLD-42d65840c843f2cac6f02fc1b6012140c9cb240e.tar.gz
opensim-SC_OLD-42d65840c843f2cac6f02fc1b6012140c9cb240e.tar.bz2
opensim-SC_OLD-42d65840c843f2cac6f02fc1b6012140c9cb240e.tar.xz
BulletSim: Add gravity force to vehicle. Some debugging additions.
Diffstat (limited to 'OpenSim/Region/Physics')
-rw-r--r--OpenSim/Region/Physics/BulletSPlugin/BSDynamics.cs8
1 files changed, 6 insertions, 2 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSDynamics.cs b/OpenSim/Region/Physics/BulletSPlugin/BSDynamics.cs
index 8bd8117..4981007 100644
--- a/OpenSim/Region/Physics/BulletSPlugin/BSDynamics.cs
+++ b/OpenSim/Region/Physics/BulletSPlugin/BSDynamics.cs
@@ -539,6 +539,8 @@ namespace OpenSim.Region.Physics.BulletSPlugin
539 { 539 {
540 if (!IsActive) return; 540 if (!IsActive) return;
541 541
542 m_lastAngularVelocity = Prim.ForceRotationalVelocity; // DEBUG: account for what Bullet did last time
543
542 MoveLinear(pTimestep); 544 MoveLinear(pTimestep);
543 MoveAngular(pTimestep); 545 MoveAngular(pTimestep);
544 LimitRotation(pTimestep); 546 LimitRotation(pTimestep);
@@ -558,7 +560,8 @@ namespace OpenSim.Region.Physics.BulletSPlugin
558 Prim.ForceOrientation = newOrientation; 560 Prim.ForceOrientation = newOrientation;
559 } 561 }
560 */ 562 */
561 BulletSimAPI.SetInterpolationVelocity2(Prim.BSBody.ptr, m_newVelocity, m_lastAngularVelocity); 563 // DEBUG: Trying to figure out why Bullet goes crazy when the root prim is moved.
564 BulletSimAPI.SetInterpolationVelocity2(Prim.BSBody.ptr, m_newVelocity, m_lastAngularVelocity); // DEBUG DEBUG DEBUG
562 565
563 // remember the position so next step we can limit absolute movement effects 566 // remember the position so next step we can limit absolute movement effects
564 m_lastPositionVector = Prim.ForcePosition; 567 m_lastPositionVector = Prim.ForcePosition;
@@ -762,13 +765,14 @@ namespace OpenSim.Region.Physics.BulletSPlugin
762 // Apply velocity 765 // Apply velocity
763 Prim.ForceVelocity = m_newVelocity; 766 Prim.ForceVelocity = m_newVelocity;
764 // Prim.AddForce(m_newVelocity * Prim.Linkset.LinksetMass, false); 767 // Prim.AddForce(m_newVelocity * Prim.Linkset.LinksetMass, false);
765 // Prim.AddForce(grav * Prim.Linkset.LinksetMass, false); 768 Prim.AddForce(grav * Prim.Linkset.LinksetMass, false);
766 769
767 VDetailLog("{0},MoveLinear,done,lmDir={1},lmVel={2},newVel={3},grav={4}", 770 VDetailLog("{0},MoveLinear,done,lmDir={1},lmVel={2},newVel={3},grav={4}",
768 Prim.LocalID, m_linearMotorDirection, m_lastLinearVelocityVector, m_newVelocity, grav); 771 Prim.LocalID, m_linearMotorDirection, m_lastLinearVelocityVector, m_newVelocity, grav);
769 772
770 } // end MoveLinear() 773 } // end MoveLinear()
771 774
775 // =======================================================================
772 // Apply the effect of the angular motor. 776 // Apply the effect of the angular motor.
773 private void MoveAngular(float pTimestep) 777 private void MoveAngular(float pTimestep)
774 { 778 {