diff options
author | Melanie | 2012-12-28 08:32:34 +0000 |
---|---|---|
committer | Melanie | 2012-12-28 08:32:34 +0000 |
commit | 3ab1bd04031ca0bc1039e4e1d267ea19d0017430 (patch) | |
tree | 3f2417f3b96e151642158d29d1982dee2bd850a8 /OpenSim/Region/Physics/BulletSPlugin/BSScene.cs | |
parent | Merge branch 'master' into careminster (diff) | |
parent | BulletSim: correct collision mask definition for linkset children. (diff) | |
download | opensim-SC-3ab1bd04031ca0bc1039e4e1d267ea19d0017430.zip opensim-SC-3ab1bd04031ca0bc1039e4e1d267ea19d0017430.tar.gz opensim-SC-3ab1bd04031ca0bc1039e4e1d267ea19d0017430.tar.bz2 opensim-SC-3ab1bd04031ca0bc1039e4e1d267ea19d0017430.tar.xz |
Merge branch 'master' into careminster
Conflicts:
OpenSim/Region/Framework/Scenes/ScenePresence.cs
Diffstat (limited to 'OpenSim/Region/Physics/BulletSPlugin/BSScene.cs')
-rw-r--r-- | OpenSim/Region/Physics/BulletSPlugin/BSScene.cs | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs b/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs index 0022e45..4133107 100644 --- a/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs | |||
@@ -38,15 +38,6 @@ using Nini.Config; | |||
38 | using log4net; | 38 | using log4net; |
39 | using OpenMetaverse; | 39 | using OpenMetaverse; |
40 | 40 | ||
41 | // TODOs for BulletSim (for BSScene, BSPrim, BSCharacter and BulletSim) | ||
42 | // Based on material, set density and friction | ||
43 | // More efficient memory usage when passing hull information from BSPrim to BulletSim | ||
44 | // Do attachments need to be handled separately? Need collision events. Do not collide with VolumeDetect | ||
45 | // Implement LockAngularMotion | ||
46 | // Add PID movement operations. What does ScenePresence.MoveToTarget do? | ||
47 | // Check terrain size. 128 or 127? | ||
48 | // Raycast | ||
49 | // | ||
50 | namespace OpenSim.Region.Physics.BulletSPlugin | 41 | namespace OpenSim.Region.Physics.BulletSPlugin |
51 | { | 42 | { |
52 | public sealed class BSScene : PhysicsScene, IPhysicsParameters | 43 | public sealed class BSScene : PhysicsScene, IPhysicsParameters |
@@ -83,6 +74,7 @@ public sealed class BSScene : PhysicsScene, IPhysicsParameters | |||
83 | internal int m_maxSubSteps; | 74 | internal int m_maxSubSteps; |
84 | internal float m_fixedTimeStep; | 75 | internal float m_fixedTimeStep; |
85 | internal long m_simulationStep = 0; | 76 | internal long m_simulationStep = 0; |
77 | internal float NominalFrameRate { get; set; } | ||
86 | public long SimulationStep { get { return m_simulationStep; } } | 78 | public long SimulationStep { get { return m_simulationStep; } } |
87 | internal int m_taintsToProcessPerStep; | 79 | internal int m_taintsToProcessPerStep; |
88 | internal float LastTimeStep { get; private set; } | 80 | internal float LastTimeStep { get; private set; } |
@@ -171,6 +163,7 @@ public sealed class BSScene : PhysicsScene, IPhysicsParameters | |||
171 | private string m_physicsLoggingPrefix; | 163 | private string m_physicsLoggingPrefix; |
172 | private int m_physicsLoggingFileMinutes; | 164 | private int m_physicsLoggingFileMinutes; |
173 | private bool m_physicsLoggingDoFlush; | 165 | private bool m_physicsLoggingDoFlush; |
166 | private bool m_physicsPhysicalDumpEnabled; | ||
174 | // 'true' of the vehicle code is to log lots of details | 167 | // 'true' of the vehicle code is to log lots of details |
175 | public bool VehicleLoggingEnabled { get; private set; } | 168 | public bool VehicleLoggingEnabled { get; private set; } |
176 | public bool VehiclePhysicalLoggingEnabled { get; private set; } | 169 | public bool VehiclePhysicalLoggingEnabled { get; private set; } |
@@ -276,11 +269,13 @@ public sealed class BSScene : PhysicsScene, IPhysicsParameters | |||
276 | BSParam.SetParameterConfigurationValues(this, pConfig); | 269 | BSParam.SetParameterConfigurationValues(this, pConfig); |
277 | 270 | ||
278 | // Very detailed logging for physics debugging | 271 | // Very detailed logging for physics debugging |
272 | // TODO: the boolean values can be moved to the normal parameter processing. | ||
279 | m_physicsLoggingEnabled = pConfig.GetBoolean("PhysicsLoggingEnabled", false); | 273 | m_physicsLoggingEnabled = pConfig.GetBoolean("PhysicsLoggingEnabled", false); |
280 | m_physicsLoggingDir = pConfig.GetString("PhysicsLoggingDir", "."); | 274 | m_physicsLoggingDir = pConfig.GetString("PhysicsLoggingDir", "."); |
281 | m_physicsLoggingPrefix = pConfig.GetString("PhysicsLoggingPrefix", "physics-%REGIONNAME%-"); | 275 | m_physicsLoggingPrefix = pConfig.GetString("PhysicsLoggingPrefix", "physics-%REGIONNAME%-"); |
282 | m_physicsLoggingFileMinutes = pConfig.GetInt("PhysicsLoggingFileMinutes", 5); | 276 | m_physicsLoggingFileMinutes = pConfig.GetInt("PhysicsLoggingFileMinutes", 5); |
283 | m_physicsLoggingDoFlush = pConfig.GetBoolean("PhysicsLoggingDoFlush", false); | 277 | m_physicsLoggingDoFlush = pConfig.GetBoolean("PhysicsLoggingDoFlush", false); |
278 | m_physicsPhysicalDumpEnabled = pConfig.GetBoolean("PhysicsPhysicalDumpEnabled", false); | ||
284 | // Very detailed logging for vehicle debugging | 279 | // Very detailed logging for vehicle debugging |
285 | VehicleLoggingEnabled = pConfig.GetBoolean("VehicleLoggingEnabled", false); | 280 | VehicleLoggingEnabled = pConfig.GetBoolean("VehicleLoggingEnabled", false); |
286 | VehiclePhysicalLoggingEnabled = pConfig.GetBoolean("VehiclePhysicalLoggingEnabled", false); | 281 | VehiclePhysicalLoggingEnabled = pConfig.GetBoolean("VehiclePhysicalLoggingEnabled", false); |
@@ -495,6 +490,11 @@ public sealed class BSScene : PhysicsScene, IPhysicsParameters | |||
495 | 490 | ||
496 | InTaintTime = false; // Only used for debugging so locking is not necessary. | 491 | InTaintTime = false; // Only used for debugging so locking is not necessary. |
497 | 492 | ||
493 | // The following causes the unmanaged code to output ALL the values found in ALL the objects in the world. | ||
494 | // Only enable this in a limited test world with few objects. | ||
495 | if (m_physicsPhysicalDumpEnabled) | ||
496 | BulletSimAPI.DumpAllInfo2(World.ptr); | ||
497 | |||
498 | // step the physical world one interval | 498 | // step the physical world one interval |
499 | m_simulationStep++; | 499 | m_simulationStep++; |
500 | int numSubSteps = 0; | 500 | int numSubSteps = 0; |
@@ -592,12 +592,13 @@ public sealed class BSScene : PhysicsScene, IPhysicsParameters | |||
592 | 592 | ||
593 | // The following causes the unmanaged code to output ALL the values found in ALL the objects in the world. | 593 | // The following causes the unmanaged code to output ALL the values found in ALL the objects in the world. |
594 | // Only enable this in a limited test world with few objects. | 594 | // Only enable this in a limited test world with few objects. |
595 | // BulletSimAPI.DumpAllInfo2(World.ptr); // DEBUG DEBUG DEBUG | 595 | if (m_physicsPhysicalDumpEnabled) |
596 | BulletSimAPI.DumpAllInfo2(World.ptr); | ||
596 | 597 | ||
597 | // The physics engine returns the number of milliseconds it simulated this call. | 598 | // The physics engine returns the number of milliseconds it simulated this call. |
598 | // These are summed and normalized to one second and divided by 1000 to give the reported physics FPS. | 599 | // These are summed and normalized to one second and divided by 1000 to give the reported physics FPS. |
599 | // Multiply by 55 to give a nominal frame rate of 55. | 600 | // Multiply by 55 to give a nominal frame rate of 55. |
600 | return (float)numSubSteps * m_fixedTimeStep * 1000f * 55f; | 601 | return (float)numSubSteps * m_fixedTimeStep * 1000f * NominalFrameRate; |
601 | } | 602 | } |
602 | 603 | ||
603 | // Something has collided | 604 | // Something has collided |