浏览代码

skip h3d.Interactive with visible=false

ncannasse 9 年之前
父节点
当前提交
2f062811c0
共有 1 个文件被更改,包括 7 次插入1 次删除
  1. 7 1
      h3d/scene/Scene.hx

+ 7 - 1
h3d/scene/Scene.hx

@@ -61,8 +61,14 @@ class Scene extends Object implements h3d.IDrawable implements hxd.SceneEvents.I
 			var r = h3d.col.Ray.fromPoints(p0.toPoint(), p1.toPoint());
 			var saveR = r.clone();
 
-			var hitTmp = new h3d.col.Point();
+			var hitTmp = new h3d.col.Point();			
 			for( i in interactives ) {
+				
+				var p : h3d.scene.Object = i;
+				while( p != null && p.visible )
+					p = p.parent;
+				if( p != null ) continue;
+				
 				var minv = i.getInvPos();
 				r.transform(minv);
 				r.normalize();