Browse Source

lods: wip

lviguier 1 năm trước cách đây
mục cha
commit
73b2b72e6b
2 tập tin đã thay đổi với 13 bổ sung0 xóa
  1. 6 0
      hxd/fmt/fbx/HMDOut.hx
  2. 7 0
      hxd/fmt/hmd/Data.hx

+ 6 - 0
hxd/fmt/fbx/HMDOut.hx

@@ -772,6 +772,11 @@ class HMDOut extends BaseLibrary {
 			var ref = o.skin == null ? o : o.skin;
 
 			model.name = o.model == null ? null : o.model.getName();
+			if (model.name != null) {
+				var lodNameIdx = model.name.indexOf("_LOD");
+				if (lodNameIdx > 0)
+					trace(model.name.substr(0, lodNameIdx));
+			}
 			model.parent = o.parent == null || o.parent.isJoint ? -1 : o.parent.index;
 			model.follow = o.parent != null && o.parent.isJoint ? o.parent.model.getName() : null;
 			var m = ref.model == null ? new hxd.fmt.fbx.BaseLibrary.DefaultMatrixes() : getDefaultMatrixes(ref.model);
@@ -1162,6 +1167,7 @@ class HMDOut extends BaseLibrary {
 		d.models = [];
 		d.animations = [];
 		d.shapes = [];
+		d.lods = [];
 
 		dataOut = new haxe.io.BytesOutput();
 

+ 7 - 0
hxd/fmt/hmd/Data.hx

@@ -90,6 +90,12 @@ class BlendShape {
 	}
 }
 
+class Lod {
+	public var name : Int;
+	public var idx : Int;
+	public var geometry : Index<Geometry>;
+}
+
 class Material {
 
 	public var name : String;
@@ -204,6 +210,7 @@ class Data {
 	public var models : Array<Model>;
 	public var animations : Array<Animation>;
 	public var shapes : Array<BlendShape>;
+	public var lods : Array<Lod>;
 	public var dataPosition : Int;
 	public var data : haxe.io.Bytes;