瀏覽代碼

added getMeshes()

bstouls 9 年之前
父節點
當前提交
796f0f5deb
共有 1 個文件被更改,包括 9 次插入0 次删除
  1. 9 0
      h3d/scene/Object.hx

+ 9 - 0
h3d/scene/Object.hx

@@ -192,6 +192,15 @@ class Object {
 		return b;
 	}
 
+	public function getMeshes( ?out : Array<Mesh> ) {
+		if( out == null ) out = [];
+		var m = Std.instance(this, Mesh);
+		if( m != null ) out.push(m);
+		for( c in childs )
+			c.getMeshes(out);
+		return out;
+	}
+
 	public function getObjectByName( name : String ) {
 		if( this.name == name )
 			return this;