瀏覽代碼

Splines: fix tangent and up not taking spline transform

lviguier 5 月之前
父節點
當前提交
b9d7455561
共有 1 個文件被更改,包括 6 次插入0 次删除
  1. 6 0
      hrt/prefab/l3d/Spline.hx

+ 6 - 0
hrt/prefab/l3d/Spline.hx

@@ -443,6 +443,12 @@ class Spline extends hrt.prefab.Object3D {
 
 		var out = new SplinePoint(sp.pos, sp.up, sp.tangentIn, sp.tangentOut);
 		out.pos = localToGlobal(out.pos);
+
+		var abs = getAbsPos(true);
+		out.up = out.up.transformed3x3(abs);
+		out.up.normalize();
+		out.tangentIn = out.tangentIn.transformed3x3(abs);
+		out.tangentOut = out.tangentOut.transformed3x3(abs);
 		return out;
 	}