Ver código fonte

added getMeshes()

bstouls 9 anos atrás
pai
commit
796f0f5deb
1 arquivos alterados com 9 adições e 0 exclusões
  1. 9 0
      h3d/scene/Object.hx

+ 9 - 0
h3d/scene/Object.hx

@@ -192,6 +192,15 @@ class Object {
 		return b;
 		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 ) {
 	public function getObjectByName( name : String ) {
 		if( this.name == name )
 		if( this.name == name )
 			return this;
 			return this;