From d773ca514726d67d7f8092440484f27440459745 Mon Sep 17 00:00:00 2001 From: Teravus Ovares Date: Wed, 13 Feb 2008 07:50:15 +0000 Subject: * Made physical prim stable enough for the general population to turn on. (though I still don't recommend it for welcome regions unless object build is off. * Updated the ode.dll for windows with a more reasonable stack space reserve. Linux users will need to type ulimit -s 262144 before starting up OpenSimulator if using Physical Prim to protect against stack collisions. or run the included ./bin/opensim-ode.sh to start up OpenSimulator in ODE mode. * Added internal collision score and am keeping track of 'high usage' prim. * Tweaked collisions some more * Tested up to 460 physical prim in extremely close quarters (which was previously impossible in OpenSim). After 460 in tight quarters, physics slows down enough to make it hard to do any moving, however.. non physics things still work, such as logging on to the simulator, etc. --- OpenSim/Region/Environment/Scenes/Scene.cs | 2 +- OpenSim/Region/Environment/Scenes/ScenePresence.cs | 18 ++++++++++++++++-- 2 files changed, 17 insertions(+), 3 deletions(-) (limited to 'OpenSim/Region/Environment/Scenes') diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index c41979c..dbb4be0 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs @@ -737,7 +737,7 @@ namespace OpenSim.Region.Environment.Scenes m_statsReporter.addOtherMS(otherMS); m_statsReporter.SetActiveScripts(m_innerScene.GetActiveScripts()); m_statsReporter.addScriptLines(m_innerScene.GetScriptLPS()); - + m_log.Warn(physicsMS); } catch (NotImplementedException) { diff --git a/OpenSim/Region/Environment/Scenes/ScenePresence.cs b/OpenSim/Region/Environment/Scenes/ScenePresence.cs index 5403fc7..61fce39 100644 --- a/OpenSim/Region/Environment/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Environment/Scenes/ScenePresence.cs @@ -100,6 +100,9 @@ namespace OpenSim.Region.Environment.Scenes private LLQuaternion m_headrotation = new LLQuaternion(); private byte m_state = (byte) 0; + //Reuse the LLVector3 instead of creating a new one on the UpdateMovement method + private LLVector3 movementvector = new LLVector3(); + private List m_knownPrimUUID = new List(); // Agent's Draw distance. @@ -1660,8 +1663,19 @@ namespace OpenSim.Region.Environment.Scenes NewForce force = m_forcesList[i]; m_updateflag = true; - - Velocity = new LLVector3(force.X, force.Y, force.Z); + try + { + movementvector.X = force.X; + movementvector.Y = force.Y; + movementvector.Z = force.Z; + Velocity = movementvector; + } + catch (System.NullReferenceException) + { + // Under extreme load, this returns a NullReference Exception that we can ignore. + // Ignoring this causes no movement to be sent to the physics engine... + // which when the scene is moving at 1 frame every 10 seconds, it doesn't really matter! + } m_newForce = true; } for (int i = 0; i < m_forcesList.Count; i++) -- cgit v1.1