From 225b564573a5ac12ca1b1e592834476feccf8ebb Mon Sep 17 00:00:00 2001 From: Robert Adams Date: Wed, 26 Dec 2012 10:25:50 -0800 Subject: BulletSim: scale the force for external AddForce by the simulation step time so it will be applied completely the next step. The internal AddForce routine does not scale the force. --- OpenSim/Region/Physics/BulletSPlugin/BSScene.cs | 4 ++++ 1 file changed, 4 insertions(+) (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 0022e45..b67c0ed 100644 --- a/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs @@ -495,6 +495,10 @@ public sealed class BSScene : PhysicsScene, IPhysicsParameters InTaintTime = false; // Only used for debugging so locking is not necessary. + // The following causes the unmanaged code to output ALL the values found in ALL the objects in the world. + // Only enable this in a limited test world with few objects. + // BulletSimAPI.DumpAllInfo2(World.ptr); // DEBUG DEBUG DEBUG + // step the physical world one interval m_simulationStep++; int numSubSteps = 0; -- cgit v1.1 From f3baed5827853c5041f042ff36cf394b1e45538f Mon Sep 17 00:00:00 2001 From: Robert Adams Date: Thu, 27 Dec 2012 06:58:07 -0800 Subject: BulletSim: add physical parameter min/max constants in BSParam. I just don't like raw numbers scattered around the code. --- OpenSim/Region/Physics/BulletSPlugin/BSScene.cs | 9 --------- 1 file changed, 9 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 b67c0ed..a5fbf10 100644 --- a/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs @@ -38,15 +38,6 @@ using Nini.Config; using log4net; using OpenMetaverse; -// TODOs for BulletSim (for BSScene, BSPrim, BSCharacter and BulletSim) -// Based on material, set density and friction -// More efficient memory usage when passing hull information from BSPrim to BulletSim -// Do attachments need to be handled separately? Need collision events. Do not collide with VolumeDetect -// Implement LockAngularMotion -// Add PID movement operations. What does ScenePresence.MoveToTarget do? -// Check terrain size. 128 or 127? -// Raycast -// namespace OpenSim.Region.Physics.BulletSPlugin { public sealed class BSScene : PhysicsScene, IPhysicsParameters -- cgit v1.1 From c1e7539c77480b839d513dbb7db74aa8f260eba0 Mon Sep 17 00:00:00 2001 From: Robert Adams Date: Thu, 27 Dec 2012 18:19:25 -0800 Subject: BulletSim: Parameterize nominal frame rate (55) and add parameters to dynamially turn on/off detailed, unmanaged data dumping of prims and vehicles. --- OpenSim/Region/Physics/BulletSPlugin/BSScene.cs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 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 a5fbf10..8edcd20 100644 --- a/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs @@ -74,6 +74,7 @@ public sealed class BSScene : PhysicsScene, IPhysicsParameters internal int m_maxSubSteps; internal float m_fixedTimeStep; internal long m_simulationStep = 0; + internal float NominalFrameRate { get; set; } public long SimulationStep { get { return m_simulationStep; } } internal int m_taintsToProcessPerStep; internal float LastTimeStep { get; private set; } @@ -162,6 +163,7 @@ public sealed class BSScene : PhysicsScene, IPhysicsParameters private string m_physicsLoggingPrefix; private int m_physicsLoggingFileMinutes; private bool m_physicsLoggingDoFlush; + private bool m_physicsPhysicalDumpEnabled; // 'true' of the vehicle code is to log lots of details public bool VehicleLoggingEnabled { get; private set; } public bool VehiclePhysicalLoggingEnabled { get; private set; } @@ -272,6 +274,7 @@ public sealed class BSScene : PhysicsScene, IPhysicsParameters m_physicsLoggingPrefix = pConfig.GetString("PhysicsLoggingPrefix", "physics-%REGIONNAME%-"); m_physicsLoggingFileMinutes = pConfig.GetInt("PhysicsLoggingFileMinutes", 5); m_physicsLoggingDoFlush = pConfig.GetBoolean("PhysicsLoggingDoFlush", false); + m_physicsPhysicalDumpEnabled = pConfig.GetBoolean("PhysicsPhysicalDumpEnabled", false); // Very detailed logging for vehicle debugging VehicleLoggingEnabled = pConfig.GetBoolean("VehicleLoggingEnabled", false); VehiclePhysicalLoggingEnabled = pConfig.GetBoolean("VehiclePhysicalLoggingEnabled", false); @@ -488,7 +491,8 @@ public sealed class BSScene : PhysicsScene, IPhysicsParameters // The following causes the unmanaged code to output ALL the values found in ALL the objects in the world. // Only enable this in a limited test world with few objects. - // BulletSimAPI.DumpAllInfo2(World.ptr); // DEBUG DEBUG DEBUG + if (m_physicsPhysicalDumpEnabled) + BulletSimAPI.DumpAllInfo2(World.ptr); // step the physical world one interval m_simulationStep++; @@ -587,12 +591,13 @@ public sealed class BSScene : PhysicsScene, IPhysicsParameters // The following causes the unmanaged code to output ALL the values found in ALL the objects in the world. // Only enable this in a limited test world with few objects. - // BulletSimAPI.DumpAllInfo2(World.ptr); // DEBUG DEBUG DEBUG + if (m_physicsPhysicalDumpEnabled) + BulletSimAPI.DumpAllInfo2(World.ptr); // The physics engine returns the number of milliseconds it simulated this call. // These are summed and normalized to one second and divided by 1000 to give the reported physics FPS. // Multiply by 55 to give a nominal frame rate of 55. - return (float)numSubSteps * m_fixedTimeStep * 1000f * 55f; + return (float)numSubSteps * m_fixedTimeStep * 1000f * NominalFrameRate; } // Something has collided -- cgit v1.1 From 1f6aaad0b587f1589afd7a7ca6feb8d2bbba8641 Mon Sep 17 00:00:00 2001 From: Robert Adams Date: Thu, 27 Dec 2012 22:04:12 -0800 Subject: BulletSim: correct collision mask definition for linkset children. Remove unused code. Add comments and TODOs. --- OpenSim/Region/Physics/BulletSPlugin/BSScene.cs | 1 + 1 file changed, 1 insertion(+) (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 8edcd20..4133107 100644 --- a/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs @@ -269,6 +269,7 @@ public sealed class BSScene : PhysicsScene, IPhysicsParameters BSParam.SetParameterConfigurationValues(this, pConfig); // Very detailed logging for physics debugging + // TODO: the boolean values can be moved to the normal parameter processing. m_physicsLoggingEnabled = pConfig.GetBoolean("PhysicsLoggingEnabled", false); m_physicsLoggingDir = pConfig.GetString("PhysicsLoggingDir", "."); m_physicsLoggingPrefix = pConfig.GetString("PhysicsLoggingPrefix", "physics-%REGIONNAME%-"); -- cgit v1.1