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/BSScene.cs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region/Physics/BulletSPlugin/BSScene.cs') diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs b/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs index 17cc7b4..f4f2801 100644 --- a/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs @@ -188,6 +188,8 @@ public sealed class BSScene : PhysicsScene, IPhysicsParameters private bool m_physicsLoggingDoFlush; // 'true' of the vehicle code is to log lots of details public bool VehicleLoggingEnabled { get; private set; } + public bool VehiclePhysicalLoggingEnabled { get; private set; } + public bool VehicleScaleAngularVelocityByTimestep { get; private set; } #region Construction and Initialization public BSScene(string identifier) @@ -297,6 +299,7 @@ public sealed class BSScene : PhysicsScene, IPhysicsParameters m_physicsLoggingDoFlush = pConfig.GetBoolean("PhysicsLoggingDoFlush", false); // Very detailed logging for vehicle debugging VehicleLoggingEnabled = pConfig.GetBoolean("VehicleLoggingEnabled", false); + VehiclePhysicalLoggingEnabled = pConfig.GetBoolean("VehiclePhysicalLoggingEnabled", false); // Do any replacements in the parameters m_physicsLoggingPrefix = m_physicsLoggingPrefix.Replace("%REGIONNAME%", RegionName); @@ -501,7 +504,7 @@ public sealed class BSScene : PhysicsScene, IPhysicsParameters try { - // if (VehicleLoggingEnabled) DumpVehicles(); // DEBUG + if (VehiclePhysicalLoggingEnabled) DumpVehicles(); // DEBUG if (PhysicsLogging.Enabled) beforeTime = Util.EnvironmentTickCount(); numSubSteps = BulletSimAPI.PhysicsStep2(World.ptr, timeStep, m_maxSubSteps, m_fixedTimeStep, @@ -510,7 +513,7 @@ public sealed class BSScene : PhysicsScene, IPhysicsParameters if (PhysicsLogging.Enabled) simTime = Util.EnvironmentTickCountSubtract(beforeTime); DetailLog("{0},Simulate,call, frame={1}, nTaints={2}, simTime={3}, substeps={4}, updates={5}, colliders={6}", DetailLogZero, m_simulationStep, numTaints, simTime, numSubSteps, updatedEntityCount, collidersCount); - // if (VehicleLoggingEnabled) DumpVehicles(); // DEBUG + if (VehiclePhysicalLoggingEnabled) DumpVehicles(); // DEBUG } catch (Exception e) { @@ -1226,6 +1229,11 @@ public sealed class BSScene : PhysicsScene, IPhysicsParameters (s,cf,p,v) => { s.m_params[0].vehicleAngularDamping = cf.GetFloat(p, v); }, (s) => { return s.m_params[0].vehicleAngularDamping; }, (s,p,l,v) => { s.m_params[0].vehicleAngularDamping = v; } ), + new ParameterDefn("VehicleScaleAngularVelocityByTimestep", "If true, scale angular turning by timestep", + ConfigurationParameters.numericFalse, + (s,cf,p,v) => { s.VehicleScaleAngularVelocityByTimestep = cf.GetBoolean(p, s.BoolNumeric(v)); }, + (s) => { return s.NumericBool(s.VehicleScaleAngularVelocityByTimestep); }, + (s,p,l,v) => { s.VehicleScaleAngularVelocityByTimestep = s.BoolNumeric(v); } ), new ParameterDefn("MaxPersistantManifoldPoolSize", "Number of manifolds pooled (0 means default of 4096)", 0f, -- cgit v1.1