From 6c7151109bbace494b4ff0f7f850c413a0ce5f28 Mon Sep 17 00:00:00 2001 From: Teravus Ovares Date: Sat, 7 Mar 2009 06:51:27 +0000 Subject: * fixes mantis 3259 * I'm concerned however that the 'minimum fly height' should really be implemented in ScenePresence and not in the specific physics plugin so that all of the physics plugins can take advantage of it and if desired, a person could swap out the 'minimum fly height' functionality with other functionality. --- OpenSim/Region/Physics/OdePlugin/OdePlugin.cs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs index 0a6faa8..7a01702 100644 --- a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs +++ b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs @@ -1295,6 +1295,15 @@ namespace OpenSim.Region.Physics.OdePlugin // Recovered for use by fly height. Kitto Flora public float GetTerrainHeightAtXY(float x, float y) { + // Teravus: Kitto, this code causes recurring errors that stall physics permenantly unless + // the values are checked, so checking below. + // Is there any reason that we don't do this in ScenePresence? + // The only physics engine that benefits from it in the physics plugin is this one + + if ((int)x > Constants.RegionSize || (int)y > Constants.RegionSize || + (int)x < 0.001f || (int)y < 0.001f) + return 0; + return (float)_origheightmap[(int)y * Constants.RegionSize + (int)x]; } // End recovered. Kitto Flora -- cgit v1.1