소스 검색

added hideProps

ncannasse 8 년 전
부모
커밋
1e2b10f659
1개의 변경된 파일6개의 추가작업 그리고 1개의 파일을 삭제
  1. 6 1
      h3d/parts/GpuParticles.hx

+ 6 - 1
h3d/parts/GpuParticles.hx

@@ -6,6 +6,7 @@ private typedef GpuSave = {
 	var version : Int;
 	var version : Int;
 	var bounds : Array<Float>;
 	var bounds : Array<Float>;
 	var groups : Array<Dynamic>;
 	var groups : Array<Dynamic>;
+	@:optional var hide : Dynamic;
 }
 }
 
 
 enum GpuSortMode {
 enum GpuSortMode {
@@ -415,6 +416,7 @@ class GpuParticles extends h3d.scene.MultiMaterial {
 	var partAlloc : GpuPart;
 	var partAlloc : GpuPart;
 	var rnd = new hxd.Rand(0);
 	var rnd = new hxd.Rand(0);
 	var lastMove : Float;
 	var lastMove : Float;
+	var hideProps : Dynamic;
 
 
 	public var seed(default, set) : Int	= Std.random(0x1000000);
 	public var seed(default, set) : Int	= Std.random(0x1000000);
 	public var volumeBounds(default, set) : h3d.col.Bounds;
 	public var volumeBounds(default, set) : h3d.col.Bounds;
@@ -473,7 +475,9 @@ class GpuParticles extends h3d.scene.MultiMaterial {
 				}
 				}
 			default:
 			default:
 			}
 			}
-		return ({ type : "particles3D", version : VERSION, groups : [for( g in groups ) g.save()], bounds : bounds } : GpuSave);
+		var save : GpuSave = { type : "particles3D", version : VERSION, groups : [for( g in groups ) g.save()], bounds : bounds };
+		if( hideProps != null ) save.hide = hideProps;
+		return save;
 	}
 	}
 
 
 	public function load( _o : Dynamic, ?resourcePath : String ) {
 	public function load( _o : Dynamic, ?resourcePath : String ) {
@@ -484,6 +488,7 @@ class GpuParticles extends h3d.scene.MultiMaterial {
 			addGroup().load(o.version, g);
 			addGroup().load(o.version, g);
 		if( o.bounds != null )
 		if( o.bounds != null )
 			volumeBounds = h3d.col.Bounds.fromValues(o.bounds[0] - o.bounds[3] * 0.5, o.bounds[1] - o.bounds[4] * 0.5, o.bounds[2] - o.bounds[5] * 0.5, o.bounds[3], o.bounds[4], o.bounds[5]);
 			volumeBounds = h3d.col.Bounds.fromValues(o.bounds[0] - o.bounds[3] * 0.5, o.bounds[1] - o.bounds[4] * 0.5, o.bounds[2] - o.bounds[5] * 0.5, o.bounds[3], o.bounds[4], o.bounds[5]);
+		hideProps = o.hide;
 	}
 	}
 
 
 	public function addGroup( ?g : GpuPartGroup, ?material : h3d.mat.Material, ?index ) {
 	public function addGroup( ?g : GpuPartGroup, ?material : h3d.mat.Material, ?index ) {