BulletSim: Debugging log statements added. Reduced size of updata buffer trying to find a corrupted memory problem. Update DLL and SO.

0.7.4.1
Robert Adams 2012-08-02 16:30:23 -07:00
parent 293d0cc629
commit 8b04e8a297
7 changed files with 28 additions and 7 deletions

View File

@ -1331,13 +1331,15 @@ public sealed class BSPrim : PhysicsActor
base.RequestPhysicsterseUpdate();
}
/*
else
{
// For debugging, we can also report the movement of children
// For debugging, we also report the movement of children
DetailLog("{0},UpdateProperties,child,pos={1},orient={2},vel={3},accel={4},rotVel={5}",
LocalID, entprop.Position, entprop.Rotation, entprop.Velocity,
entprop.Acceleration, entprop.RotationalVelocity);
}
*/
}
// I've collided with something

View File

@ -390,9 +390,9 @@ public class BSScene : PhysicsScene, IPhysicsParameters
// Simulate one timestep
public override float Simulate(float timeStep)
{
int updatedEntityCount;
int updatedEntityCount = 0;
IntPtr updatedEntitiesPtr;
int collidersCount;
int collidersCount = 0;
IntPtr collidersPtr;
LastSimulatedTimestep = timeStep;
@ -411,8 +411,21 @@ public class BSScene : PhysicsScene, IPhysicsParameters
// step the physical world one interval
m_simulationStep++;
int numSubSteps = BulletSimAPI.PhysicsStep(m_worldID, timeStep, m_maxSubSteps, m_fixedTimeStep,
out updatedEntityCount, out updatedEntitiesPtr, out collidersCount, out collidersPtr);
int numSubSteps = 0;
try
{
numSubSteps = BulletSimAPI.PhysicsStep(m_worldID, timeStep, m_maxSubSteps, m_fixedTimeStep,
out updatedEntityCount, out updatedEntitiesPtr, out collidersCount, out collidersPtr);
DetailLog("{0},Simulate,call, substeps={1}, updates={2}, colliders={3}", "0000000000", numSubSteps, updatedEntityCount, collidersCount);
}
catch (Exception e)
{
m_log.WarnFormat("{0},PhysicsStep Exception: substeps={1}, updates={2}, colliders={3}, e={4}", LogHeader, numSubSteps, updatedEntityCount, collidersCount, e);
DetailLog("{0},PhysicsStepException,call, substeps={1}, updates={2}, colliders={3}", "0000000000", numSubSteps, updatedEntityCount, collidersCount);
// updatedEntityCount = 0;
collidersCount = 0;
}
// Don't have to use the pointers passed back since we know it is the same pinned memory we passed in
@ -711,7 +724,7 @@ public class BSScene : PhysicsScene, IPhysicsParameters
return true;
}
// The calls to the PhysicsActors can't directly call into the physics engine
// Calls to the PhysicsActors can't directly call into the physics engine
// because it might be busy. We delay changes to a known time.
// We rely on C#'s closure to save and restore the context for the delegate.
public void TaintedObject(TaintCallback callback)
@ -1275,5 +1288,11 @@ public class BSScene : PhysicsScene, IPhysicsParameters
#endregion Runtime settable parameters
// Invoke the detailed logger and output something if it's enabled.
private void DetailLog(string msg, params Object[] args)
{
PhysicsLogging.Write(msg, args);
}
}
}

View File

@ -937,7 +937,7 @@
FixedTimeStep = .01667
MaxCollisionsPerFrame = 2048
MaxUpdatesPerFrame = 8192
MaxUpdatesPerFrame = 2048
[RemoteAdmin]
enabled = false

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.