From 1372b4f600d4bffc6e06bfb65075577a9eeb40dc Mon Sep 17 00:00:00 2001 From: Nathan Bowhay Date: Tue, 3 Feb 2015 14:14:02 -0800 Subject: [PATCH] Fixed raycast bug start x position is NaN Fixed bug in _castRay when the start x position is NaN. --- Engine/source/scene/sceneContainer.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Engine/source/scene/sceneContainer.cpp b/Engine/source/scene/sceneContainer.cpp index 5d81cc0bd..e9fd51812 100644 --- a/Engine/source/scene/sceneContainer.cpp +++ b/Engine/source/scene/sceneContainer.cpp @@ -1012,6 +1012,11 @@ bool SceneContainer::_castRay( U32 type, const Point3F& start, const Point3F& en F32 currStartX = normalStart.x; AssertFatal(currStartX != normalEnd.x, "This is going to cause problems in SceneContainer::castRay"); + if(_isnan(currStartX)) + { + PROFILE_END(); + return false; + } while (currStartX != normalEnd.x) { F32 currEndX = getMin(currStartX + csmTotalBinSize, normalEnd.x);