aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Physics/BulletSPlugin/BSScene.cs')
-rw-r--r--OpenSim/Region/Physics/BulletSPlugin/BSScene.cs34
1 files changed, 24 insertions, 10 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs b/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs
index 09b1423..f72bd74 100644
--- a/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs
+++ b/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs
@@ -96,6 +96,9 @@ public sealed class BSScene : PhysicsScene, IPhysicsParameters
96 public long SimulationStep { get { return m_simulationStep; } } 96 public long SimulationStep { get { return m_simulationStep; } }
97 private int m_taintsToProcessPerStep; 97 private int m_taintsToProcessPerStep;
98 98
99 public delegate void PreStepAction(float timeStep);
100 public event PreStepAction BeforeStep;
101
99 // A value of the time now so all the collision and update routines do not have to get their own 102 // A value of the time now so all the collision and update routines do not have to get their own
100 // Set to 'now' just before all the prims and actors are called for collisions and updates 103 // Set to 'now' just before all the prims and actors are called for collisions and updates
101 public int SimulationNowTime { get; private set; } 104 public int SimulationNowTime { get; private set; }
@@ -127,7 +130,7 @@ public sealed class BSScene : PhysicsScene, IPhysicsParameters
127 public const uint GROUNDPLANE_ID = 1; 130 public const uint GROUNDPLANE_ID = 1;
128 public const uint CHILDTERRAIN_ID = 2; // Terrain allocated based on our mega-prim childre start here 131 public const uint CHILDTERRAIN_ID = 2; // Terrain allocated based on our mega-prim childre start here
129 132
130 private float m_waterLevel; 133 public float SimpleWaterLevel { get; set; }
131 public BSTerrainManager TerrainManager { get; private set; } 134 public BSTerrainManager TerrainManager { get; private set; }
132 135
133 public ConfigurationParameters Params 136 public ConfigurationParameters Params
@@ -182,6 +185,7 @@ public sealed class BSScene : PhysicsScene, IPhysicsParameters
182 private string m_physicsLoggingDir; 185 private string m_physicsLoggingDir;
183 private string m_physicsLoggingPrefix; 186 private string m_physicsLoggingPrefix;
184 private int m_physicsLoggingFileMinutes; 187 private int m_physicsLoggingFileMinutes;
188 private bool m_physicsLoggingDoFlush;
185 // 'true' of the vehicle code is to log lots of details 189 // 'true' of the vehicle code is to log lots of details
186 public bool VehicleLoggingEnabled { get; private set; } 190 public bool VehicleLoggingEnabled { get; private set; }
187 191
@@ -290,6 +294,7 @@ public sealed class BSScene : PhysicsScene, IPhysicsParameters
290 m_physicsLoggingDir = pConfig.GetString("PhysicsLoggingDir", "."); 294 m_physicsLoggingDir = pConfig.GetString("PhysicsLoggingDir", ".");
291 m_physicsLoggingPrefix = pConfig.GetString("PhysicsLoggingPrefix", "physics-%REGIONNAME%-"); 295 m_physicsLoggingPrefix = pConfig.GetString("PhysicsLoggingPrefix", "physics-%REGIONNAME%-");
292 m_physicsLoggingFileMinutes = pConfig.GetInt("PhysicsLoggingFileMinutes", 5); 296 m_physicsLoggingFileMinutes = pConfig.GetInt("PhysicsLoggingFileMinutes", 5);
297 m_physicsLoggingDoFlush = pConfig.GetBoolean("PhysicsLoggingDoFlush", false);
293 // Very detailed logging for vehicle debugging 298 // Very detailed logging for vehicle debugging
294 VehicleLoggingEnabled = pConfig.GetBoolean("VehicleLoggingEnabled", false); 299 VehicleLoggingEnabled = pConfig.GetBoolean("VehicleLoggingEnabled", false);
295 300
@@ -485,8 +490,10 @@ public sealed class BSScene : PhysicsScene, IPhysicsParameters
485 ProcessTaints(); 490 ProcessTaints();
486 491
487 // Some of the prims operate with special vehicle properties 492 // Some of the prims operate with special vehicle properties
488 ProcessVehicles(timeStep); 493 DoPreStepActions(timeStep);
489 ProcessTaints(); // the vehicles might have added taints 494
495 // the prestep actions might have added taints
496 ProcessTaints();
490 497
491 // step the physical world one interval 498 // step the physical world one interval
492 m_simulationStep++; 499 m_simulationStep++;
@@ -634,12 +641,7 @@ public sealed class BSScene : PhysicsScene, IPhysicsParameters
634 641
635 public override void SetWaterLevel(float baseheight) 642 public override void SetWaterLevel(float baseheight)
636 { 643 {
637 m_waterLevel = baseheight; 644 SimpleWaterLevel = baseheight;
638 }
639 // Someday....
640 public float GetWaterLevelAtXYZ(Vector3 loc)
641 {
642 return m_waterLevel;
643 } 645 }
644 646
645 public override void DeleteTerrain() 647 public override void DeleteTerrain()
@@ -910,6 +912,16 @@ public sealed class BSScene : PhysicsScene, IPhysicsParameters
910 } 912 }
911 } 913 }
912 914
915 private void DoPreStepActions(float timeStep)
916 {
917 ProcessVehicles(timeStep);
918
919 PreStepAction actions = BeforeStep;
920 if (actions != null)
921 actions(timeStep);
922
923 }
924
913 // Some prims have extra vehicle actions 925 // Some prims have extra vehicle actions
914 // Called at taint time! 926 // Called at taint time!
915 private void ProcessVehicles(float timeStep) 927 private void ProcessVehicles(float timeStep)
@@ -974,6 +986,8 @@ public sealed class BSScene : PhysicsScene, IPhysicsParameters
974 // Should handle fetching the right type from the ini file and converting it. 986 // Should handle fetching the right type from the ini file and converting it.
975 // -- a delegate for getting the value as a float 987 // -- a delegate for getting the value as a float
976 // -- a delegate for setting the value from a float 988 // -- a delegate for setting the value from a float
989 // -- an optional delegate to update the value in the world. Most often used to
990 // push the new value to an in-world object.
977 // 991 //
978 // The single letter parameters for the delegates are: 992 // The single letter parameters for the delegates are:
979 // s = BSScene 993 // s = BSScene
@@ -1493,7 +1507,7 @@ public sealed class BSScene : PhysicsScene, IPhysicsParameters
1493 { 1507 {
1494 PhysicsLogging.Write(msg, args); 1508 PhysicsLogging.Write(msg, args);
1495 // Add the Flush() if debugging crashes. Gets all the messages written out. 1509 // Add the Flush() if debugging crashes. Gets all the messages written out.
1496 // PhysicsLogging.Flush(); 1510 if (m_physicsLoggingDoFlush) PhysicsLogging.Flush();
1497 } 1511 }
1498 // Used to fill in the LocalID when there isn't one. It's the correct number of characters. 1512 // Used to fill in the LocalID when there isn't one. It's the correct number of characters.
1499 public const string DetailLogZero = "0000000000"; 1513 public const string DetailLogZero = "0000000000";