aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Physics/BulletSPlugin
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Physics/BulletSPlugin')
-rw-r--r--OpenSim/Region/Physics/BulletSPlugin/BSScene.cs25
1 files changed, 13 insertions, 12 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs b/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs
index f63ad95..cacab01 100644
--- a/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs
+++ b/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs
@@ -511,12 +511,12 @@ public class BSScene : PhysicsScene, IPhysicsParameters
511 // long simulateTotalTime = Util.EnvironmentTickCountSubtract(simulateStartTime); 511 // long simulateTotalTime = Util.EnvironmentTickCountSubtract(simulateStartTime);
512 // return (timeStep * (float)simulateTotalTime); 512 // return (timeStep * (float)simulateTotalTime);
513 513
514 // TODO: FIX THIS: fps calculation possibly wrong. 514 // TODO: FIX THIS: fps calculation possibly wrong.
515 // This calculation says 1/timeStep is the ideal frame rate. Any time added to 515 // This calculation says 1/timeStep is the ideal frame rate. Any time added to
516 // that by the physics simulation gives a slower frame rate. 516 // that by the physics simulation gives a slower frame rate.
517 long totalSimulationTime = Util.EnvironmentTickCountSubtract(simulateStartTime); 517 long totalSimulationTime = Util.EnvironmentTickCountSubtract(simulateStartTime);
518 if (totalSimulationTime >= timeStep) 518 if (totalSimulationTime >= timeStep)
519 return 0; 519 return 0;
520 return 1f / (timeStep + totalSimulationTime); 520 return 1f / (timeStep + totalSimulationTime);
521 } 521 }
522 522
@@ -595,12 +595,6 @@ public class BSScene : PhysicsScene, IPhysicsParameters
595 // make sure no stepping happens while we're deleting stuff 595 // make sure no stepping happens while we're deleting stuff
596 m_initialized = false; 596 m_initialized = false;
597 597
598 if (m_constraintCollection != null)
599 {
600 m_constraintCollection.Dispose();
601 m_constraintCollection = null;
602 }
603
604 foreach (KeyValuePair<uint, BSCharacter> kvp in m_avatars) 598 foreach (KeyValuePair<uint, BSCharacter> kvp in m_avatars)
605 { 599 {
606 kvp.Value.Destroy(); 600 kvp.Value.Destroy();
@@ -613,6 +607,13 @@ public class BSScene : PhysicsScene, IPhysicsParameters
613 } 607 }
614 m_prims.Clear(); 608 m_prims.Clear();
615 609
610 // Now that the prims are all cleaned up, there should be no constraints left
611 if (m_constraintCollection != null)
612 {
613 m_constraintCollection.Dispose();
614 m_constraintCollection = null;
615 }
616
616 // Anything left in the unmanaged code should be cleaned out 617 // Anything left in the unmanaged code should be cleaned out
617 BulletSimAPI.Shutdown(WorldID); 618 BulletSimAPI.Shutdown(WorldID);
618 619