Browse Source

added getMeshes()

bstouls 9 years ago
parent
commit
796f0f5deb
1 changed files with 9 additions and 0 deletions
  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;