From 8b861e880ad128edc0267b8e2d5931cfc8a142bc Mon Sep 17 00:00:00 2001 From: Robert Adams Date: Tue, 11 Dec 2012 00:13:13 -0800 Subject: 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. --- OpenSim/Region/Physics/BulletSPlugin/BSDynamics.cs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'OpenSim/Region/Physics/BulletSPlugin/BSDynamics.cs') 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 BulletSimAPI.SetMassProps2(Prim.PhysBody.ptr, m_vehicleMass, localInertia); BulletSimAPI.UpdateInertiaTensor2(Prim.PhysBody.ptr); - VDetailLog("{0},BSDynamics.Refresh,frict={1},inert={2},aDamp={3}", - Prim.LocalID, friction, localInertia, angularDamping); + VDetailLog("{0},BSDynamics.Refresh,mass={1},frict={2},inert={3},aDamp={4}", + Prim.LocalID, m_vehicleMass, friction, localInertia, angularDamping); } else { @@ -1057,7 +1057,10 @@ namespace OpenSim.Region.Physics.BulletSPlugin // TODO: Should this be applied as an angular force (torque)? if (!m_lastAngularCorrection.ApproxEquals(Vector3.Zero, 0.01f)) { - Vector3 scaledCorrection = m_lastAngularCorrection * pTimestep; + // DEBUG DEBUG DEBUG: optionally scale the angular velocity. Debugging SL vs ODE turning functions. + Vector3 scaledCorrection = m_lastAngularCorrection; + if (PhysicsScene.VehicleScaleAngularVelocityByTimestep) + scaledCorrection *= pTimestep; VehicleRotationalVelocity = scaledCorrection; VDetailLog("{0}, MoveAngular,done,nonZero,angMotorContrib={1},vertAttrContrib={2},bankContrib={3},deflectContrib={4},totalContrib={5},scaledCorr={6}", -- cgit v1.1