diff options
author | Robert Adams | 2012-12-11 00:13:13 -0800 |
---|---|---|
committer | Robert Adams | 2012-12-11 00:13:13 -0800 |
commit | 8b861e880ad128edc0267b8e2d5931cfc8a142bc (patch) | |
tree | 5b003bc0c79c2d3c7f4efa0de1ba6d75db5a1bdf /OpenSim/Region/Physics/BulletSPlugin/BSDynamics.cs | |
parent | BulletSim: set mass for single prim linksets when going physical. This fixes ... (diff) | |
download | opensim-SC_OLD-8b861e880ad128edc0267b8e2d5931cfc8a142bc.zip opensim-SC_OLD-8b861e880ad128edc0267b8e2d5931cfc8a142bc.tar.gz opensim-SC_OLD-8b861e880ad128edc0267b8e2d5931cfc8a142bc.tar.bz2 opensim-SC_OLD-8b861e880ad128edc0267b8e2d5931cfc8a142bc.tar.xz |
BulletSim: add ini file and command line parameters to control
dumping of physical vehicle parameters (out of Bullet) on each
simulation step and to optionally scale vehicle angular velocity
by the time step. The latter looks to be part of a difference
between angular parameters for ODE and BulletSim. SL docs say
angular velocity is measured in radians/timeScale. Not sure if this
is different than what ODE does.
Diffstat (limited to 'OpenSim/Region/Physics/BulletSPlugin/BSDynamics.cs')
-rw-r--r-- | OpenSim/Region/Physics/BulletSPlugin/BSDynamics.cs | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSDynamics.cs b/OpenSim/Region/Physics/BulletSPlugin/BSDynamics.cs index cb84456..acddc09 100644 --- a/OpenSim/Region/Physics/BulletSPlugin/BSDynamics.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSDynamics.cs | |||
@@ -570,8 +570,8 @@ namespace OpenSim.Region.Physics.BulletSPlugin | |||
570 | BulletSimAPI.SetMassProps2(Prim.PhysBody.ptr, m_vehicleMass, localInertia); | 570 | BulletSimAPI.SetMassProps2(Prim.PhysBody.ptr, m_vehicleMass, localInertia); |
571 | BulletSimAPI.UpdateInertiaTensor2(Prim.PhysBody.ptr); | 571 | BulletSimAPI.UpdateInertiaTensor2(Prim.PhysBody.ptr); |
572 | 572 | ||
573 | VDetailLog("{0},BSDynamics.Refresh,frict={1},inert={2},aDamp={3}", | 573 | VDetailLog("{0},BSDynamics.Refresh,mass={1},frict={2},inert={3},aDamp={4}", |
574 | Prim.LocalID, friction, localInertia, angularDamping); | 574 | Prim.LocalID, m_vehicleMass, friction, localInertia, angularDamping); |
575 | } | 575 | } |
576 | else | 576 | else |
577 | { | 577 | { |
@@ -1057,7 +1057,10 @@ namespace OpenSim.Region.Physics.BulletSPlugin | |||
1057 | // TODO: Should this be applied as an angular force (torque)? | 1057 | // TODO: Should this be applied as an angular force (torque)? |
1058 | if (!m_lastAngularCorrection.ApproxEquals(Vector3.Zero, 0.01f)) | 1058 | if (!m_lastAngularCorrection.ApproxEquals(Vector3.Zero, 0.01f)) |
1059 | { | 1059 | { |
1060 | Vector3 scaledCorrection = m_lastAngularCorrection * pTimestep; | 1060 | // DEBUG DEBUG DEBUG: optionally scale the angular velocity. Debugging SL vs ODE turning functions. |
1061 | Vector3 scaledCorrection = m_lastAngularCorrection; | ||
1062 | if (PhysicsScene.VehicleScaleAngularVelocityByTimestep) | ||
1063 | scaledCorrection *= pTimestep; | ||
1061 | VehicleRotationalVelocity = scaledCorrection; | 1064 | VehicleRotationalVelocity = scaledCorrection; |
1062 | 1065 | ||
1063 | VDetailLog("{0}, MoveAngular,done,nonZero,angMotorContrib={1},vertAttrContrib={2},bankContrib={3},deflectContrib={4},totalContrib={5},scaledCorr={6}", | 1066 | VDetailLog("{0}, MoveAngular,done,nonZero,angMotorContrib={1},vertAttrContrib={2},bankContrib={3},deflectContrib={4},totalContrib={5},scaledCorr={6}", |