소스 검색

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;