From 11246c284fa1fb2def5dd5cd9804c353a2bee0ab Mon Sep 17 00:00:00 2001 From: Teravus Ovares Date: Wed, 4 Jun 2008 16:27:35 +0000 Subject: * Added a check for a non-finite heightfield array value passed to the ODEPlugin. This may, or may not fix anything. --- OpenSim/Region/Physics/OdePlugin/OdePlugin.cs | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs index 5078f03..787cb12 100644 --- a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs +++ b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs @@ -2025,8 +2025,17 @@ namespace OpenSim.Region.Physics.OdePlugin { for (int x = 0; x < 512; x++) { + if (Single.IsNaN(resultarr2[y, x]) || Single.IsInfinity(resultarr2[y, x])) + { + m_log.Warn("[PHYSICS]: Non finite heightfield element detected. Setting it to 0"); + resultarr2[y, x] = 0; + } + if (resultarr2[y, x] <= 0) + { returnarr[i] = 0.0000001f; + + } else returnarr[i] = resultarr2[y, x]; -- cgit v1.1