aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorRobert Adams2012-12-10 16:46:12 -0800
committerRobert Adams2012-12-10 16:46:12 -0800
commit93393fb975f3886c448b6f945705304552fe8875 (patch)
treeda5452ab6a2b78588cd3aab2f559a81f8c342fbe
parentBulletSim: Fix crash on the destruction of physical linksets. (diff)
downloadopensim-SC-93393fb975f3886c448b6f945705304552fe8875.zip
opensim-SC-93393fb975f3886c448b6f945705304552fe8875.tar.gz
opensim-SC-93393fb975f3886c448b6f945705304552fe8875.tar.bz2
opensim-SC-93393fb975f3886c448b6f945705304552fe8875.tar.xz
BulletSim: comment out some chatty debug logging. Rearrange some code in BSDynamics to make velocity vs force calculation clearer.
-rw-r--r--OpenSim/Region/Physics/BulletSPlugin/BSDynamics.cs8
-rw-r--r--OpenSim/Region/Physics/BulletSPlugin/BSScene.cs4
2 files changed, 7 insertions, 5 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSDynamics.cs b/OpenSim/Region/Physics/BulletSPlugin/BSDynamics.cs
index fa3110c..cb84456 100644
--- a/OpenSim/Region/Physics/BulletSPlugin/BSDynamics.cs
+++ b/OpenSim/Region/Physics/BulletSPlugin/BSDynamics.cs
@@ -818,6 +818,8 @@ namespace OpenSim.Region.Physics.BulletSPlugin
818 + hoverContribution 818 + hoverContribution
819 + limitMotorUpContribution; 819 + limitMotorUpContribution;
820 820
821 Vector3 newForce = buoyancyContribution;
822
821 // If not changing some axis, reduce out velocity 823 // If not changing some axis, reduce out velocity
822 if ((m_flags & (VehicleFlag.NO_X)) != 0) 824 if ((m_flags & (VehicleFlag.NO_X)) != 0)
823 newVelocity.X = 0; 825 newVelocity.X = 0;
@@ -845,7 +847,7 @@ namespace OpenSim.Region.Physics.BulletSPlugin
845 VehicleVelocity = newVelocity; 847 VehicleVelocity = newVelocity;
846 848
847 // Other linear forces are applied as forces. 849 // Other linear forces are applied as forces.
848 Vector3 totalDownForce = buoyancyContribution * m_vehicleMass; 850 Vector3 totalDownForce = newForce * m_vehicleMass;
849 if (!totalDownForce.ApproxEquals(Vector3.Zero, 0.01f)) 851 if (!totalDownForce.ApproxEquals(Vector3.Zero, 0.01f))
850 { 852 {
851 VehicleAddForce(totalDownForce); 853 VehicleAddForce(totalDownForce);
@@ -1005,8 +1007,8 @@ namespace OpenSim.Region.Physics.BulletSPlugin
1005 // has a decay factor. This says this force should 1007 // has a decay factor. This says this force should
1006 // be computed with a motor. 1008 // be computed with a motor.
1007 // TODO: add interaction with banking. 1009 // TODO: add interaction with banking.
1008 VDetailLog("{0}, MoveLinear,limitMotorUp,distAbove={1},downForce={2}", 1010 VDetailLog("{0}, MoveLinear,limitMotorUp,distAbove={1},colliding={2},ret={3}",
1009 Prim.LocalID, distanceAboveGround, ret); 1011 Prim.LocalID, distanceAboveGround, Prim.IsColliding, ret);
1010 } 1012 }
1011 return ret; 1013 return ret;
1012 } 1014 }
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs b/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs
index f72bd74..17cc7b4 100644
--- a/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs
+++ b/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs
@@ -501,7 +501,7 @@ public sealed class BSScene : PhysicsScene, IPhysicsParameters
501 501
502 try 502 try
503 { 503 {
504 if (VehicleLoggingEnabled) DumpVehicles(); // DEBUG 504 // if (VehicleLoggingEnabled) DumpVehicles(); // DEBUG
505 if (PhysicsLogging.Enabled) beforeTime = Util.EnvironmentTickCount(); 505 if (PhysicsLogging.Enabled) beforeTime = Util.EnvironmentTickCount();
506 506
507 numSubSteps = BulletSimAPI.PhysicsStep2(World.ptr, timeStep, m_maxSubSteps, m_fixedTimeStep, 507 numSubSteps = BulletSimAPI.PhysicsStep2(World.ptr, timeStep, m_maxSubSteps, m_fixedTimeStep,
@@ -510,7 +510,7 @@ public sealed class BSScene : PhysicsScene, IPhysicsParameters
510 if (PhysicsLogging.Enabled) simTime = Util.EnvironmentTickCountSubtract(beforeTime); 510 if (PhysicsLogging.Enabled) simTime = Util.EnvironmentTickCountSubtract(beforeTime);
511 DetailLog("{0},Simulate,call, frame={1}, nTaints={2}, simTime={3}, substeps={4}, updates={5}, colliders={6}", 511 DetailLog("{0},Simulate,call, frame={1}, nTaints={2}, simTime={3}, substeps={4}, updates={5}, colliders={6}",
512 DetailLogZero, m_simulationStep, numTaints, simTime, numSubSteps, updatedEntityCount, collidersCount); 512 DetailLogZero, m_simulationStep, numTaints, simTime, numSubSteps, updatedEntityCount, collidersCount);
513 if (VehicleLoggingEnabled) DumpVehicles(); // DEBUG 513 // if (VehicleLoggingEnabled) DumpVehicles(); // DEBUG
514 } 514 }
515 catch (Exception e) 515 catch (Exception e)
516 { 516 {