@realsee/dnalogel 3.77.4-alpha.2 → 3.77.4-alpha.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -12,6 +12,7 @@ export declare class DigitalHuman {
12
12
  state: {
13
13
  currentTime: number;
14
14
  currentAnimation: THREE.AnimationClip | null;
15
+ currentAnimationRepeat: boolean;
15
16
  playing: boolean;
16
17
  };
17
18
  animationFrameId: number | null;
@@ -1,25 +1,25 @@
1
- var x = Object.defineProperty;
2
- var R = (y, e, t) => e in y ? x(y, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : y[e] = t;
3
- var n = (y, e, t) => (R(y, typeof e != "symbol" ? e + "" : e, t), t);
4
- var M = (y, e, t) => new Promise((l, o) => {
1
+ var B = Object.defineProperty;
2
+ var x = (p, e, t) => e in p ? B(p, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : p[e] = t;
3
+ var n = (p, e, t) => (x(p, typeof e != "symbol" ? e + "" : e, t), t);
4
+ var M = (p, e, t) => new Promise((l, o) => {
5
5
  var a = (d) => {
6
6
  try {
7
- p(t.next(d));
7
+ y(t.next(d));
8
8
  } catch (F) {
9
9
  o(F);
10
10
  }
11
11
  }, g = (d) => {
12
12
  try {
13
- p(t.throw(d));
13
+ y(t.throw(d));
14
14
  } catch (F) {
15
15
  o(F);
16
16
  }
17
- }, p = (d) => d.done ? l(d.value) : Promise.resolve(d.value).then(a, g);
18
- p((t = t.apply(y, e)).next());
17
+ }, y = (d) => d.done ? l(d.value) : Promise.resolve(d.value).then(a, g);
18
+ y((t = t.apply(p, e)).next());
19
19
  });
20
20
  import * as i from "three";
21
- import { DigitalStateMachine as S } from "./DigitalStateMachine.js";
22
- import { Trace as L } from "./Trace.js";
21
+ import { DigitalStateMachine as L } from "./DigitalStateMachine.js";
22
+ import { Trace as S } from "./Trace.js";
23
23
  const q = 300;
24
24
  class D {
25
25
  constructor(e, t) {
@@ -45,17 +45,18 @@ class D {
45
45
  n(this, "attachedItems", /* @__PURE__ */ new Map());
46
46
  // 缓存 RightHand 骨骼
47
47
  n(this, "rightHandBone", null);
48
- this.model = e, this.model.visible = !1, this.model.mixer = null, this.mixer = new i.AnimationMixer(this.model), this.action = null, this.keyframesManager = new S(), this.keyframes = [], this.items = [], this.effects = [], this.digitalPlayground = t, this.state = {
48
+ this.model = e, this.model.visible = !1, this.model.mixer = null, this.mixer = new i.AnimationMixer(this.model), this.action = null, this.keyframesManager = new L(), this.keyframes = [], this.items = [], this.effects = [], this.digitalPlayground = t, this.state = {
49
49
  currentTime: 0,
50
50
  currentAnimation: null,
51
+ currentAnimationRepeat: !1,
51
52
  playing: !1
52
- }, this.animationFrameId = null, this.itemMatrixMap = /* @__PURE__ */ new Map(), this.trace = new L(), this.curveLine = new i.Line(), this.curveLine.material = new i.LineBasicMaterial({ color: 14467195, linewidth: 5 }), this.effectsGroup = new i.Group(), this.effectObjects = /* @__PURE__ */ new Map(), this.container = new i.Group(), this.container.add(this.model), this.container.add(this.curveLine), this.container.add(this.effectsGroup);
53
+ }, this.animationFrameId = null, this.itemMatrixMap = /* @__PURE__ */ new Map(), this.trace = new S(), this.curveLine = new i.Line(), this.curveLine.material = new i.LineBasicMaterial({ color: 14467195, linewidth: 5 }), this.effectsGroup = new i.Group(), this.effectObjects = /* @__PURE__ */ new Map(), this.container = new i.Group(), this.container.add(this.model), this.container.add(this.curveLine), this.container.add(this.effectsGroup);
53
54
  }
54
55
  playAnimation({ animation: e, repeat: t, switchDuration: l }) {
55
56
  const o = this.action;
56
57
  e.tracks = e.tracks.filter((g) => g);
57
58
  const a = this.mixer.clipAction(e);
58
- a.reset(), t || (a.setLoop(i.LoopOnce, 1), a.clampWhenFinished = !0), o && (a.enabled = !0, a.setEffectiveTimeScale(1), a.crossFadeFrom(o, l / 1e3, !0)), a.play(), o && o !== a && setTimeout(() => {
59
+ a.reset(), t ? (a.setLoop(i.LoopRepeat, 1 / 0), a.clampWhenFinished = !1) : (a.setLoop(i.LoopOnce, 1), a.clampWhenFinished = !0), o && (a.enabled = !0, a.setEffectiveTimeScale(1), a.crossFadeFrom(o, l / 1e3, !0)), a.play(), o && o !== a && setTimeout(() => {
59
60
  o.stop();
60
61
  }, l), this.action = a;
61
62
  }
@@ -80,9 +81,9 @@ class D {
80
81
  return M(this, null, function* () {
81
82
  this.clearProcessedNeedRenderKeyframeIndices();
82
83
  const { keyframes: t, items: l, effects: o } = e || {};
83
- return this.keyframes = t || this.keyframes, this.items = l || this.items, this.effects = o || this.effects, this.state.currentAnimation = null, this.state.playing = !0, new Promise((a, g) => {
84
+ return this.keyframes = t || this.keyframes, this.items = l || this.items, this.effects = o || this.effects, this.state.currentAnimation = null, this.state.currentAnimationRepeat = !1, this.state.playing = !0, new Promise((a, g) => {
84
85
  this.state.currentTime || this.init();
85
- let p = null;
86
+ let y = null;
86
87
  for (let c = 0; c < this.items.length; c++) {
87
88
  const h = this.digitalPlayground.getDigitalItem(this.items[c].model);
88
89
  if (h) {
@@ -112,9 +113,9 @@ class D {
112
113
  }
113
114
  const v = (c) => {
114
115
  var A, w;
115
- p === null && (p = c);
116
- const h = c - p;
117
- p = c, this.state.currentTime += h;
116
+ y === null && (y = c);
117
+ const h = c - y;
118
+ y = c, this.state.currentTime += h;
118
119
  const s = this.keyframesManager.getStateByTime(this.state.currentTime, this.keyframes, "model");
119
120
  this.trace.addPoint(s.translation);
120
121
  const u = new i.BufferGeometry().setFromPoints(this.trace.tracePoints);
@@ -122,8 +123,8 @@ class D {
122
123
  this.model.visible = !1, this.container.visible = !1, this.stopAnimation(), this.model.needsRender = !0, a(!0), this.animationFrameId !== null && (cancelAnimationFrame(this.animationFrameId), this.animationFrameId = null);
123
124
  return;
124
125
  } else if (s.animation) {
125
- const r = this.digitalPlayground.getAnimation(s.animation.url), m = s.animation.needRender;
126
- (r !== this.state.currentAnimation || m && !this.hasProcessedNeedRenderForTimestamp(s.keyframeIndex)) && (m && r === this.state.currentAnimation && this.markNeedRenderProcessedForTimestamp(s.keyframeIndex), this.state.currentAnimation = r, this.playAnimation({
126
+ const r = this.digitalPlayground.getAnimation(s.animation.url), m = s.animation.needRender, I = s.animation.repeat !== this.state.currentAnimationRepeat;
127
+ (r !== this.state.currentAnimation || I || m && !this.hasProcessedNeedRenderForTimestamp(s.keyframeIndex)) && (m && r === this.state.currentAnimation && this.markNeedRenderProcessedForTimestamp(s.keyframeIndex), this.state.currentAnimation = r, this.state.currentAnimationRepeat = s.animation.repeat, this.playAnimation({
127
128
  animation: r,
128
129
  repeat: s.animation.repeat,
129
130
  switchDuration: (A = s.animation.switchDuration) != null ? A : q
@@ -139,9 +140,9 @@ class D {
139
140
  if (m.type === "frameSequence") {
140
141
  const I = m.type + r;
141
142
  if (!this.effectObjects.has(I)) {
142
- const b = new i.PlaneGeometry(1, 1), B = new i.MeshBasicMaterial({
143
+ const R = new i.PlaneGeometry(1, 1), b = new i.MeshBasicMaterial({
143
144
  transparent: !0
144
- }), k = new i.Mesh(b, B);
145
+ }), k = new i.Mesh(R, b);
145
146
  k.rotateX(-Math.PI / 2), k.position.copy(new i.Vector3().fromArray(m.position)), this.effectObjects.set(I, k), this.effectsGroup.add(k);
146
147
  }
147
148
  const f = this.effectObjects.get(I), T = this.keyframesManager.getStateByTime(this.state.currentTime, this.effects[r].keyframes, "effect"), P = d.get(T.image);
@@ -1,50 +1,50 @@
1
1
  import * as _ from "three";
2
- function G(t) {
3
- const m = [t[12], t[13], t[14]], r = t[0], o = t[4], l = t[8], p = t[1], x = t[5], h = t[9], e = t[2], u = t[6], b = t[10], v = Math.sqrt(r * r + p * p + e * e), q = Math.sqrt(o * o + x * x + u * u), F = Math.sqrt(l * l + h * h + b * b), E = [v, q, F], N = [r / v, o / q, l / F, p / v, x / q, h / F, e / v, u / q, b / F], S = nt(N);
2
+ function J(t) {
3
+ const m = [t[12], t[13], t[14]], r = t[0], o = t[4], l = t[8], p = t[1], x = t[5], h = t[9], e = t[2], u = t[6], z = t[10], w = Math.sqrt(r * r + p * p + e * e), q = Math.sqrt(o * o + x * x + u * u), F = Math.sqrt(l * l + h * h + z * z), E = [w, q, F], N = [r / w, o / q, l / F, p / w, x / q, h / F, e / w, u / q, z / F], S = it(N);
4
4
  return { position: m, quaternion: S, scale: E };
5
5
  }
6
- function nt(t) {
6
+ function it(t) {
7
7
  const m = t[0] + t[4] + t[8];
8
8
  let r, o = [0, 0, 0, 0];
9
9
  return m > 0 ? (r = Math.sqrt(m + 1) * 2, o[3] = 0.25 * r, o[0] = (t[7] - t[5]) / r, o[1] = (t[2] - t[6]) / r, o[2] = (t[3] - t[1]) / r) : t[0] > t[4] && t[0] > t[8] ? (r = Math.sqrt(1 + t[0] - t[4] - t[8]) * 2, o[3] = (t[7] - t[5]) / r, o[0] = 0.25 * r, o[1] = (t[1] + t[3]) / r, o[2] = (t[2] + t[6]) / r) : t[4] > t[8] ? (r = Math.sqrt(1 + t[4] - t[0] - t[8]) * 2, o[3] = (t[2] - t[6]) / r, o[0] = (t[1] + t[3]) / r, o[1] = 0.25 * r, o[2] = (t[5] + t[7]) / r) : (r = Math.sqrt(1 + t[8] - t[0] - t[4]) * 2, o[3] = (t[3] - t[1]) / r, o[0] = (t[2] + t[6]) / r, o[1] = (t[5] + t[7]) / r, o[2] = 0.25 * r), o;
10
10
  }
11
- function it({ x: t, y: m, z: r, order: o = "XYZ" }) {
11
+ function ot({ x: t, y: m, z: r, order: o = "XYZ" }) {
12
12
  const l = Math.cos(t / 2), p = Math.cos(m / 2), x = Math.cos(r / 2), h = Math.sin(t / 2), e = Math.sin(m / 2), u = Math.sin(r / 2);
13
- let b, v, q, F;
13
+ let z, w, q, F;
14
14
  switch (o) {
15
15
  case "XYZ":
16
- b = h * p * x + l * e * u, v = l * e * x - h * p * u, q = l * p * u + h * e * x, F = l * p * x - h * e * u;
16
+ z = h * p * x + l * e * u, w = l * e * x - h * p * u, q = l * p * u + h * e * x, F = l * p * x - h * e * u;
17
17
  break;
18
18
  default:
19
- b = h * p * x + l * e * u, v = l * e * x - h * p * u, q = l * p * u + h * e * x, F = l * p * x - h * e * u;
19
+ z = h * p * x + l * e * u, w = l * e * x - h * p * u, q = l * p * u + h * e * x, F = l * p * x - h * e * u;
20
20
  }
21
- return [b, v, q, F];
21
+ return [z, w, q, F];
22
22
  }
23
- function J(t) {
23
+ function W(t) {
24
24
  if (typeof t == "string" && !isNaN(Number(t)))
25
25
  return [0, -(Number(t) * Math.PI) / 180, 0];
26
26
  if (Array.isArray(t) && t.length === 3)
27
27
  return [t[0], -t[1], t[2]];
28
28
  }
29
- function W(t, m) {
29
+ function D(t, m) {
30
30
  if (!m)
31
31
  return t;
32
- const r = it({ x: m[0], y: m[1], z: m[2] }), [o, l, p, x] = r, [h, e, u, b] = t;
32
+ const r = ot({ x: m[0], y: m[1], z: m[2] }), [o, l, p, x] = r, [h, e, u, z] = t;
33
33
  return [
34
- x * h + o * b + l * u - p * e,
35
- x * e - o * u + l * b + p * h,
36
- x * u + o * e - l * h + p * b,
37
- x * b - o * h - l * e - p * u
34
+ x * h + o * z + l * u - p * e,
35
+ x * e - o * u + l * z + p * h,
36
+ x * u + o * e - l * h + p * z,
37
+ x * z - o * h - l * e - p * u
38
38
  ];
39
39
  }
40
- function ot(t, m) {
40
+ function et(t, m) {
41
41
  const r = new _.Vector3(m.x - t.x, m.y - t.y, m.z - t.z).normalize(), o = new _.Vector3(0, 0, 1), l = new _.Quaternion();
42
42
  return l.setFromUnitVectors(o, r), [l.x, l.y, l.z, l.w];
43
43
  }
44
- function et(t, m = 0, r = 300) {
45
- var H, L, O;
44
+ function st(t, m = 0, r = 300) {
45
+ var H, L, O, V;
46
46
  if (!((H = t.track) != null && H.path) || t.track.path.length === 0) {
47
- const i = G(t.matrix), n = [
47
+ const i = J(t.matrix), n = [
48
48
  {
49
49
  visible: !0,
50
50
  timeStamp: 0 + m,
@@ -60,7 +60,7 @@ function et(t, m = 0, r = 300) {
60
60
  keyframes: n
61
61
  };
62
62
  }
63
- const o = G(t.matrix);
63
+ const o = J(t.matrix);
64
64
  let l = o.quaternion.slice();
65
65
  const p = t.track.points.find(
66
66
  (i) => Math.abs(i.point.x - o.position[0]) < 1e-3 && Math.abs(i.point.y - o.position[1]) < 1e-3 && Math.abs(i.point.z - o.position[2]) < 1e-3
@@ -80,8 +80,9 @@ function et(t, m = 0, r = 300) {
80
80
  scale: o.scale,
81
81
  animation: {
82
82
  url: a ? n.animationUrl : t.animationUrl,
83
- repeat: !a && (n == null ? void 0 : n.repeat),
84
- needRender: a
83
+ repeat: !a || (n == null ? void 0 : n.repeat),
84
+ needRender: a,
85
+ item: (L = n.subAction) != null && L.url ? n.subAction : void 0
85
86
  }
86
87
  }), i += n.duration * 1e3;
87
88
  }
@@ -108,17 +109,17 @@ function et(t, m = 0, r = 300) {
108
109
  repeat: h
109
110
  }
110
111
  });
111
- let b = 0;
112
+ let z = 0;
112
113
  if (p) {
113
114
  let i = 0;
114
115
  for (const n of p.actions)
115
116
  if (n.duration > 0 || n.animationUrl === "x_turn") {
116
117
  if (n.animationUrl === "x_turn") {
117
118
  n.duration = 1;
118
- const a = J(n.rotation);
119
- a && (l = W(l, a));
119
+ const a = W(n.rotation);
120
+ a && (l = D(l, a));
120
121
  }
121
- i += n.duration * 1e3, b += n.duration * 1e3, u({
122
+ i += n.duration * 1e3, z += n.duration * 1e3, u({
122
123
  visible: !0,
123
124
  timeStamp: i,
124
125
  position: o.position,
@@ -131,15 +132,15 @@ function et(t, m = 0, r = 300) {
131
132
  }
132
133
  });
133
134
  }
134
- console.log(`初始action point处理完成,总延迟: ${b}ms`);
135
+ console.log(`初始action point处理完成,总延迟: ${z}ms`);
135
136
  }
136
- function v(i, n) {
137
+ function w(i, n) {
137
138
  return Math.sqrt(Math.pow(n.x - i.x, 2) + Math.pow(n.y - i.y, 2) + Math.pow(n.z - i.z, 2));
138
139
  }
139
140
  let q = 0;
140
141
  const F = [];
141
142
  for (let i = 0; i < t.track.path.length - 1; i++) {
142
- const n = v(t.track.path[i], t.track.path[i + 1]);
143
+ const n = w(t.track.path[i], t.track.path[i + 1]);
143
144
  F.push(n), q += n;
144
145
  }
145
146
  const E = q / t.track.duration;
@@ -153,12 +154,12 @@ function et(t, m = 0, r = 300) {
153
154
  const n = `${i.point.x.toFixed(3)}_${i.point.y.toFixed(3)}_${i.point.z.toFixed(3)}`;
154
155
  let a = 1 / 0, y = 0;
155
156
  for (let f = 0; f < t.track.path.length - 1; f++) {
156
- const $ = D(i.point, t.track.path[f], t.track.path[f + 1]);
157
+ const $ = k(i.point, t.track.path[f], t.track.path[f + 1]);
157
158
  $ < a && (a = $, y = f);
158
159
  }
159
160
  N.set(n, y);
160
161
  }
161
- let S = b, j = 0;
162
+ let S = z, j = 0;
162
163
  const C = /* @__PURE__ */ new Set();
163
164
  for (let i = 0; i < t.track.path.length - 1; i++) {
164
165
  const n = t.track.path[i], a = t.track.path[i + 1], y = F[i], f = j / q * t.track.duration * 1e3;
@@ -191,15 +192,15 @@ function et(t, m = 0, r = 300) {
191
192
  continue;
192
193
  }
193
194
  if (N.get(T) === i) {
194
- const d = k(s.point, n, a), M = j - y + y * d, R = M / q * t.track.duration * 1e3 + S;
195
+ const d = tt(s.point, n, a), M = j - y + y * d, R = M / q * t.track.duration * 1e3 + S;
195
196
  console.log(
196
197
  `Action点: 位置[${s.point.x.toFixed(2)}, ${s.point.y.toFixed(2)}, ${s.point.z.toFixed(
197
198
  2
198
199
  )}], 距离${M.toFixed(2)}, 到达时间${R.toFixed(0)}ms`
199
200
  );
200
201
  let I = t.animationUrl;
201
- const z = s.actions.find((c) => c.duration > 0 && c.animationUrl !== "none"), A = z == null ? void 0 : z.subAction;
202
- z ? (I = z.animationUrl, z.duration > 2, console.log(`到达动作点,使用该点的动画: ${I}`)) : console.log("动作点没有有效动作,使用默认移动动画"), u({
202
+ const b = s.actions.find((c) => c.duration > 0 && c.animationUrl !== "none"), A = b == null ? void 0 : b.subAction;
203
+ b ? (I = b.animationUrl, b.duration > 2, console.log(`到达动作点,使用该点的动画: ${I}`)) : console.log("动作点没有有效动作,使用默认移动动画"), u({
203
204
  visible: !0,
204
205
  timeStamp: R,
205
206
  position: [s.point.x, s.point.y, s.point.z],
@@ -208,8 +209,8 @@ function et(t, m = 0, r = 300) {
208
209
  animation: {
209
210
  url: I,
210
211
  item: A != null && A.url ? A : void 0,
211
- repeat: z == null ? void 0 : z.repeat,
212
- duration: z == null ? void 0 : z.duration
212
+ repeat: b == null ? void 0 : b.repeat,
213
+ duration: b == null ? void 0 : b.duration
213
214
  }
214
215
  });
215
216
  let P = R, K = 0;
@@ -217,8 +218,8 @@ function et(t, m = 0, r = 300) {
217
218
  if (c.duration > 0 || c.animationUrl === "x_turn") {
218
219
  if (c.animationUrl === "x_turn") {
219
220
  c.duration = 1;
220
- const V = J(c.rotation);
221
- V && (l = W(l, V));
221
+ const G = W(c.rotation);
222
+ G && (l = D(l, G));
222
223
  }
223
224
  const B = c.animationUrl !== "none" && c.animationUrl !== "x_turn";
224
225
  u({
@@ -231,7 +232,7 @@ function et(t, m = 0, r = 300) {
231
232
  url: B ? c.animationUrl : t.animationUrl,
232
233
  repeat: !B || (c == null ? void 0 : c.repeat),
233
234
  needRender: B,
234
- item: (L = c.subAction) != null && L.url ? c.subAction : void 0,
235
+ item: (O = c.subAction) != null && O.url ? c.subAction : void 0,
235
236
  duration: c == null ? void 0 : c.duration
236
237
  }
237
238
  }), P += c.duration * 1e3, K += c.duration * 1e3, u({
@@ -243,7 +244,7 @@ function et(t, m = 0, r = 300) {
243
244
  animation: {
244
245
  url: t.animationUrl,
245
246
  repeat: t.repeat === "loop",
246
- item: (O = c.subAction) != null && O.url ? c.subAction : void 0
247
+ item: (V = c.subAction) != null && V.url ? c.subAction : void 0
247
248
  }
248
249
  });
249
250
  }
@@ -269,16 +270,16 @@ function et(t, m = 0, r = 300) {
269
270
  });
270
271
  }
271
272
  }
272
- function D(i, n, a) {
273
+ function k(i, n, a) {
273
274
  const y = i.x - n.x, f = i.y - n.y, $ = i.z - n.z, U = a.x - n.x, g = a.y - n.y, s = a.z - n.z, T = y * U + f * g + $ * s, d = U * U + g * g + s * s;
274
275
  if (d === 0)
275
276
  return Math.sqrt(y * y + f * f + $ * $);
276
277
  let M = T / d;
277
278
  M < 0 ? M = 0 : M > 1 && (M = 1);
278
- const w = n.x + M * U, R = n.y + M * g, I = n.z + M * s, z = i.x - w, A = i.y - R, P = i.z - I;
279
- return Math.sqrt(z * z + A * A + P * P);
279
+ const v = n.x + M * U, R = n.y + M * g, I = n.z + M * s, b = i.x - v, A = i.y - R, P = i.z - I;
280
+ return Math.sqrt(b * b + A * A + P * P);
280
281
  }
281
- function k(i, n, a) {
282
+ function tt(i, n, a) {
282
283
  const y = a.x - n.x, f = a.y - n.y, $ = a.z - n.z, U = y * y + f * f + $ * $;
283
284
  if (U === 0)
284
285
  return 0;
@@ -296,7 +297,7 @@ function et(t, m = 0, r = 300) {
296
297
  a.position[1] - n.position[1],
297
298
  a.position[2] - n.position[2]
298
299
  ).normalize(), g = $.clone().add(U.multiplyScalar(f));
299
- let s = ot(
300
+ let s = et(
300
301
  { x: n.position[0], y: n.position[1], z: n.position[2] },
301
302
  { x: a.position[0], y: a.position[1], z: a.position[2] }
302
303
  );
@@ -318,16 +319,16 @@ function et(t, m = 0, r = 300) {
318
319
  if (e[d].timeStamp > n.timeStamp + r)
319
320
  if (Math.abs(e[d].position[0] - a.position[0]) < 1e-3 && Math.abs(e[d].position[1] - a.position[1]) < 1e-3 && Math.abs(e[d].position[2] - a.position[2]) < 1e-3)
320
321
  if (d < e.length - 1) {
321
- const M = e[d].quaternion, w = e[d + 1].quaternion;
322
- if (Math.abs(M[0] - w[0]) + Math.abs(M[1] - w[1]) + Math.abs(M[2] - w[2]) + Math.abs(M[3] - w[3]) < 1e-3)
322
+ const M = e[d].quaternion, v = e[d + 1].quaternion;
323
+ if (Math.abs(M[0] - v[0]) + Math.abs(M[1] - v[1]) + Math.abs(M[2] - v[2]) + Math.abs(M[3] - v[3]) < 1e-3)
323
324
  e[d].quaternion = s.slice(), console.log(`关键帧${d}没有旋转,设置为路径方向`);
324
325
  else {
325
- const I = new _.Quaternion(), z = new _.Quaternion(
326
+ const I = new _.Quaternion(), b = new _.Quaternion(
326
327
  M[0],
327
328
  M[1],
328
329
  M[2],
329
330
  M[3]
330
- ), A = new _.Quaternion(w[0], w[1], w[2], w[3]), P = z.clone();
331
+ ), A = new _.Quaternion(v[0], v[1], v[2], v[3]), P = b.clone();
331
332
  P.conjugate(), I.copy(A).multiply(P), e[d].quaternion = s.slice();
332
333
  const c = new _.Quaternion(
333
334
  s[0],
@@ -345,7 +346,7 @@ function et(t, m = 0, r = 300) {
345
346
  }
346
347
  }
347
348
  e.push(...X), e.sort((i, n) => i.timeStamp - n.timeStamp);
348
- const Y = t.track.duration * 1e3, Z = Y + S, Q = e[e.length - 1], tt = e.filter(
349
+ const Y = t.track.duration * 1e3, Z = Y + S, Q = e[e.length - 1], nt = e.filter(
349
350
  (i) => i.timeStamp === 0 && Math.abs(i.position[0] - o.position[0]) < 1e-3 && Math.abs(i.position[1] - o.position[1]) < 1e-3 && Math.abs(i.position[2] - o.position[2]) < 1e-3
350
351
  );
351
352
  return console.log(`动画转换完成:
@@ -356,7 +357,7 @@ function et(t, m = 0, r = 300) {
356
357
  - 计算总时间: ${Z}ms (${(Z / 1e3).toFixed(2)}s)
357
358
  - 实际最后时间戳: ${Q == null ? void 0 : Q.timeStamp}ms (${((Q == null ? void 0 : Q.timeStamp) / 1e3).toFixed(2)}s)
358
359
  - 关键帧数量: ${e.length}
359
- - 初始位置关键帧数量: ${tt.length}
360
+ - 初始位置关键帧数量: ${nt.length}
360
361
  - 速度一致性: ${(((Q == null ? void 0 : Q.timeStamp) - S) / 1e3 / t.track.duration * 100).toFixed(1)}% (100%为完全一致)`), {
361
362
  id: t.id,
362
363
  name: t.name || "默认角色",
@@ -366,5 +367,5 @@ function et(t, m = 0, r = 300) {
366
367
  };
367
368
  }
368
369
  export {
369
- et as convertMockToPlayer
370
+ st as convertMockToPlayer
370
371
  };
@@ -23,7 +23,7 @@ let I = class {
23
23
  /**
24
24
  * @realsee/dnalogel 版本号
25
25
  */
26
- r(this, "VERSION", "3.77.4-alpha.2");
26
+ r(this, "VERSION", "3.77.4-alpha.4");
27
27
  r(this, "NAME");
28
28
  r(this, "five");
29
29
  r(this, "workUtil");
@@ -1,6 +1,6 @@
1
1
  function A() {
2
2
  console.debug(
3
- "%c %c@realsee/dnalogel %cv3.77.4-alpha.2",
3
+ "%c %c@realsee/dnalogel %cv3.77.4-alpha.4",
4
4
  [
5
5
  "background: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAkAAAAMCAMAAACHgmeRAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAABLFBMVEUAAAAapPoap/oaqvkbrfkbr/gZnfwZoPsaqfnD4v/E4/8Ylv0clPm93/+/4P/B4f8Yj/683/8Wif+33P8Uhv+x2f8ShP+s1v8Pgf+n0/8Nf/+h0f8Lff8Lff8Nf/9dl/+czv8KfP8KfP+Lxf+Uyv+Xy/+Hwv+Jw/+Mxf+Oxv+RyP8aovsapfoap/oZmfwZm/wZnvsYnPsYkf4YlP0NePsDYfgYcfi43f+63v8Xiv8Xjf4EWfwCV/sWZ/qz2v+02/8Vh/8WiP8EUf8CTf4WXv2u1/+v2P8Thf8Thv8ETf8CR/8VV/+o1f+q1f8Qgv8Rg/8DSv8BRf8UVP+j0v+k0v8OgP8Pgf8DR/8DQv9Nhf+dzv+fz/+Kv/+Vyv+Xy/+azf+Oxv+Qx/+SyP////8MUhLdAAAAK3RSTlMACEWQ2bd98uQECPXxqO7c+Pb49vj2+Pb49vj23Oul8fMHA+TwerXXjEIG2P+bHgAAAAFiS0dEY1y+LaoAAAB+SURBVAjXY2BgZGJmYWVgYGBgY9fW0eVg4ORi4NbTNzDk4eXjZxAwMjYxNTO3EGQQsrSytrG1sxdmEHFwdHJ2cXUTZRBz9/D08vbxFWeQ8PMPCAwKDpFkkAoNC4+IjIqWZpCRlZOPiY2LV2BQVGJQTkhMUlEFWaOmrqGpxQAAyg0S9Dq+VPYAAAAASUVORK5CYII=')",
6
6
  "background-repeat: no-repeat",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@realsee/dnalogel",
3
- "version": "3.77.4-alpha.2",
3
+ "version": "3.77.4-alpha.4",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./libs/index.js",
6
6
  "types": "./libs/index.d.ts",