瀏覽代碼

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

ncannasse 9 年之前
父節點
當前提交
417f4c8e18
共有 1 個文件被更改,包括 7 次插入0 次删除
  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;