BulletSim: comment out some chatty debug logging. Rearrange some code in BSDynamics to make velocity vs force calculation clearer.

0.7.5-pf-bulletsim
Robert Adams 2012-12-10 16:46:12 -08:00
parent 9df85eadf4
commit 93393fb975
2 changed files with 7 additions and 5 deletions

View File

@ -818,6 +818,8 @@ namespace OpenSim.Region.Physics.BulletSPlugin
+ hoverContribution
+ limitMotorUpContribution;
Vector3 newForce = buoyancyContribution;
// If not changing some axis, reduce out velocity
if ((m_flags & (VehicleFlag.NO_X)) != 0)
newVelocity.X = 0;
@ -845,7 +847,7 @@ namespace OpenSim.Region.Physics.BulletSPlugin
VehicleVelocity = newVelocity;
// Other linear forces are applied as forces.
Vector3 totalDownForce = buoyancyContribution * m_vehicleMass;
Vector3 totalDownForce = newForce * m_vehicleMass;
if (!totalDownForce.ApproxEquals(Vector3.Zero, 0.01f))
{
VehicleAddForce(totalDownForce);
@ -1005,8 +1007,8 @@ namespace OpenSim.Region.Physics.BulletSPlugin
// has a decay factor. This says this force should
// be computed with a motor.
// TODO: add interaction with banking.
VDetailLog("{0}, MoveLinear,limitMotorUp,distAbove={1},downForce={2}",
Prim.LocalID, distanceAboveGround, ret);
VDetailLog("{0}, MoveLinear,limitMotorUp,distAbove={1},colliding={2},ret={3}",
Prim.LocalID, distanceAboveGround, Prim.IsColliding, ret);
}
return ret;
}

View File

@ -501,7 +501,7 @@ public sealed class BSScene : PhysicsScene, IPhysicsParameters
try
{
if (VehicleLoggingEnabled) DumpVehicles(); // DEBUG
// if (VehicleLoggingEnabled) DumpVehicles(); // DEBUG
if (PhysicsLogging.Enabled) beforeTime = Util.EnvironmentTickCount();
numSubSteps = BulletSimAPI.PhysicsStep2(World.ptr, timeStep, m_maxSubSteps, m_fixedTimeStep,
@ -510,7 +510,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 (VehicleLoggingEnabled) DumpVehicles(); // DEBUG
}
catch (Exception e)
{