Forráskód Böngészése

skip NaN Interactive (so they don't take all the events)

ncannasse 9 éve
szülő
commit
417f4c8e18
1 módosított fájl, 7 hozzáadás és 0 törlés
  1. 7 0
      h3d/scene/Scene.hx

+ 7 - 0
h3d/scene/Scene.hx

@@ -72,6 +72,13 @@ class Scene extends Object implements h3d.IDrawable implements hxd.SceneEvents.I
 				var minv = i.getInvPos();
 				r.transform(minv);
 				r.normalize();
+				
+				// check for NaN
+				if( r.lx != r.lx ) {
+					r.load(saveR);
+					continue;
+				}
+				
 				var hit = i.shape.rayIntersection(r, hitTmp);
 				r.load(saveR);
 				if( hit == null ) continue;