diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs b/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs index 5e70a234dd..17cc7b4634 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 public long SimulationStep { get { return m_simulationStep; } } private int m_taintsToProcessPerStep; + public delegate void PreStepAction(float timeStep); + public event PreStepAction BeforeStep; + // A value of the time now so all the collision and update routines do not have to get their own // Set to 'now' just before all the prims and actors are called for collisions and updates public int SimulationNowTime { get; private set; } @@ -487,8 +490,10 @@ public sealed class BSScene : PhysicsScene, IPhysicsParameters ProcessTaints(); // Some of the prims operate with special vehicle properties - ProcessVehicles(timeStep); - ProcessTaints(); // the vehicles might have added taints + DoPreStepActions(timeStep); + + // the prestep actions might have added taints + ProcessTaints(); // step the physical world one interval m_simulationStep++; @@ -907,6 +912,16 @@ public sealed class BSScene : PhysicsScene, IPhysicsParameters } } + private void DoPreStepActions(float timeStep) + { + ProcessVehicles(timeStep); + + PreStepAction actions = BeforeStep; + if (actions != null) + actions(timeStep); + + } + // Some prims have extra vehicle actions // Called at taint time! private void ProcessVehicles(float timeStep) diff --git a/OpenSim/Region/Physics/BulletSPlugin/BulletSimTODO.txt b/OpenSim/Region/Physics/BulletSPlugin/BulletSimTODO.txt index cf112fbe59..ca71313638 100755 --- a/OpenSim/Region/Physics/BulletSPlugin/BulletSimTODO.txt +++ b/OpenSim/Region/Physics/BulletSPlugin/BulletSimTODO.txt @@ -27,6 +27,7 @@ Small physical objects do not interact correctly Chains above 2x2x.4 are move stable and get stablier as torui get larger. Add material type linkage and input all the material property definitions. Skeleton classes and table are in the sources but are not filled or used. +Add PID motor for avatar movement (slow to stop, ...) After getting off a vehicle, the root prim is phantom (can be walked through) Need to force a position update for the root prim after compound shape destruction @@ -78,7 +79,10 @@ Breakout code for mesh/hull/compound/native into separate BSShape* classes Generalize Dynamics and PID with standardized motors. Generalize Linkset and vehicles into PropertyManagers Methods for Refresh, RemoveBodyDependencies, RestoreBodyDependencies - Possibly generalized a 'per step action' registration. + Possibly generalized a 'pre step action' registration. +Complete implemention of preStepActions + Replace vehicle step call with prestep event. + Is there a need for postStepActions? postStepTaints? Implement linkset by setting position of children when root updated. (LinksetManual) LinkablePrim class? Would that simplify/centralize the linkset logic? Linkset implementation using manual prim movement.