From d39154bb50571c07fa5f2425261f123034b0b1c1 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 18 Jun 2008 09:06:51 +0000 Subject: bugfix, BGE, use vec.safe_normalized() rather then vec.normalized() because in some cases the ray_cast sensor could crash blender. --- source/gameengine/Ketsji/KX_RayCast.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source/gameengine/Ketsji/KX_RayCast.cpp') diff --git a/source/gameengine/Ketsji/KX_RayCast.cpp b/source/gameengine/Ketsji/KX_RayCast.cpp index b88741625b6..89e2d645d54 100644 --- a/source/gameengine/Ketsji/KX_RayCast.cpp +++ b/source/gameengine/Ketsji/KX_RayCast.cpp @@ -49,7 +49,7 @@ bool KX_RayCast::RayTest(KX_IPhysicsController* ignore_controller, PHY_IPhysicsE // // returns true if an object was found, false if not. MT_Point3 frompoint(_frompoint); - const MT_Vector3 todir( (topoint - frompoint).normalized() ); + const MT_Vector3 todir( (topoint - frompoint).safe_normalized() ); PHY_IPhysicsController* hit_controller; PHY__Vector3 phy_pos; -- cgit v1.2.3