reze-engine 0.43.0 → 0.50.1
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.
- package/README.md +53 -429
- package/dist/animation.d.ts +26 -0
- package/dist/animation.d.ts.map +1 -1
- package/dist/animation.js +42 -0
- package/dist/camera.d.ts +3 -0
- package/dist/camera.d.ts.map +1 -1
- package/dist/camera.js +33 -8
- package/dist/engine.d.ts +841 -53
- package/dist/engine.d.ts.map +1 -1
- package/dist/engine.js +3498 -451
- package/dist/graph/registry.d.ts +2 -2
- package/dist/graph/registry.d.ts.map +1 -1
- package/dist/graph/registry.js +1 -1
- package/dist/graph/slots.d.ts +0 -1
- package/dist/graph/slots.d.ts.map +1 -1
- package/dist/graph/slots.js +37 -9
- package/dist/hdr.d.ts +18 -0
- package/dist/hdr.d.ts.map +1 -0
- package/dist/hdr.js +162 -0
- package/dist/ibl.d.ts +19 -0
- package/dist/ibl.d.ts.map +1 -0
- package/dist/ibl.js +113 -0
- package/dist/ik-solver.d.ts +2 -1
- package/dist/ik-solver.d.ts.map +1 -1
- package/dist/index.d.ts +5 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +10 -0
- package/dist/math.d.ts +20 -1
- package/dist/math.d.ts.map +1 -1
- package/dist/math.js +23 -16
- package/dist/midi-loader.d.ts +10 -0
- package/dist/midi-loader.d.ts.map +1 -0
- package/dist/midi-loader.js +247 -0
- package/dist/model.d.ts +19 -14
- package/dist/model.d.ts.map +1 -1
- package/dist/model.js +31 -2
- package/dist/param-track.d.ts +48 -0
- package/dist/param-track.d.ts.map +1 -0
- package/dist/param-track.js +80 -0
- package/dist/physics/types.d.ts.map +1 -1
- package/dist/physics/types.js +3 -0
- package/dist/reflection.d.ts +27 -0
- package/dist/reflection.d.ts.map +1 -0
- package/dist/reflection.js +93 -0
- package/dist/shaders/anchor-table.d.ts +56 -0
- package/dist/shaders/anchor-table.d.ts.map +1 -0
- package/dist/shaders/anchor-table.js +128 -0
- package/dist/shaders/cast-api.d.ts +2 -0
- package/dist/shaders/cast-api.d.ts.map +1 -0
- package/dist/shaders/cast-api.js +121 -0
- package/dist/shaders/cast-layout.d.ts +21 -0
- package/dist/shaders/cast-layout.d.ts.map +1 -0
- package/dist/shaders/cast-layout.js +20 -0
- package/dist/shaders/lights.d.ts +79 -0
- package/dist/shaders/lights.d.ts.map +1 -0
- package/dist/shaders/lights.js +269 -0
- package/dist/shaders/lyrics-api.d.ts +39 -0
- package/dist/shaders/lyrics-api.d.ts.map +1 -0
- package/dist/shaders/lyrics-api.js +187 -0
- package/dist/shaders/materials/common.d.ts +2 -4
- package/dist/shaders/materials/common.d.ts.map +1 -1
- package/dist/shaders/materials/common.js +87 -35
- package/dist/shaders/midi-api.d.ts +10 -0
- package/dist/shaders/midi-api.d.ts.map +1 -0
- package/dist/shaders/midi-api.js +114 -0
- package/dist/shaders/passes/composite.d.ts +28 -22
- package/dist/shaders/passes/composite.d.ts.map +1 -1
- package/dist/shaders/passes/composite.js +165 -138
- package/dist/shaders/passes/cull.d.ts +2 -0
- package/dist/shaders/passes/cull.d.ts.map +1 -0
- package/dist/shaders/passes/cull.js +138 -0
- package/dist/shaders/passes/field-blit.d.ts +26 -0
- package/dist/shaders/passes/field-blit.d.ts.map +1 -0
- package/dist/shaders/passes/field-blit.js +65 -0
- package/dist/shaders/passes/grid.d.ts +31 -0
- package/dist/shaders/passes/grid.d.ts.map +1 -0
- package/dist/shaders/passes/grid.js +169 -0
- package/dist/shaders/passes/ground.d.ts +13 -1
- package/dist/shaders/passes/ground.d.ts.map +1 -1
- package/dist/shaders/passes/ground.js +170 -25
- package/dist/shaders/passes/hosted-api.d.ts +57 -0
- package/dist/shaders/passes/hosted-api.d.ts.map +1 -0
- package/dist/shaders/passes/hosted-api.js +166 -0
- package/dist/shaders/passes/id-debug.d.ts +28 -0
- package/dist/shaders/passes/id-debug.d.ts.map +1 -0
- package/dist/shaders/passes/id-debug.js +74 -0
- package/dist/shaders/passes/particles.d.ts +10 -2
- package/dist/shaders/passes/particles.d.ts.map +1 -1
- package/dist/shaders/passes/particles.js +37 -109
- package/dist/shaders/passes/scene-contract.d.ts +128 -0
- package/dist/shaders/passes/scene-contract.d.ts.map +1 -0
- package/dist/shaders/passes/scene-contract.js +207 -0
- package/dist/shaders/passes/sim.d.ts +34 -0
- package/dist/shaders/passes/sim.d.ts.map +1 -0
- package/dist/shaders/passes/sim.js +169 -0
- package/dist/shaders/passes/trails.d.ts +14 -2
- package/dist/shaders/passes/trails.d.ts.map +1 -1
- package/dist/shaders/passes/trails.js +55 -90
- package/dist/shaders/score-api.d.ts +10 -0
- package/dist/shaders/score-api.d.ts.map +1 -0
- package/dist/shaders/score-api.js +114 -0
- package/dist/shadow-cascades.d.ts +45 -0
- package/dist/shadow-cascades.d.ts.map +1 -0
- package/dist/shadow-cascades.js +70 -0
- package/dist/vmd-loader.d.ts +3 -2
- package/dist/vmd-loader.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/animation.ts +41 -0
- package/src/camera.ts +31 -8
- package/src/engine.ts +4015 -556
- package/src/graph/registry.ts +2 -2
- package/src/graph/slots.ts +37 -9
- package/src/hdr.ts +156 -0
- package/src/ibl.ts +115 -0
- package/src/ik-solver.ts +1 -1
- package/src/index.ts +12 -0
- package/src/math.ts +23 -17
- package/src/midi-loader.ts +246 -0
- package/src/model.ts +34 -4
- package/src/param-track.ts +83 -0
- package/src/physics/types.ts +4 -1
- package/src/reflection.ts +94 -0
- package/src/shaders/anchor-table.ts +147 -0
- package/src/shaders/cast-api.ts +123 -0
- package/src/shaders/cast-layout.ts +20 -0
- package/src/shaders/lights.ts +280 -0
- package/src/shaders/lyrics-api.ts +202 -0
- package/src/shaders/materials/common.ts +89 -35
- package/src/shaders/midi-api.ts +116 -0
- package/src/shaders/passes/composite.ts +182 -139
- package/src/shaders/passes/cull.ts +139 -0
- package/src/shaders/passes/grid.ts +178 -0
- package/src/shaders/passes/ground.ts +172 -25
- package/src/shaders/passes/hosted-api.ts +171 -0
- package/src/shaders/passes/id-debug.ts +75 -0
- package/src/shaders/passes/particles.ts +54 -112
- package/src/shaders/passes/scene-contract.ts +266 -0
- package/src/shaders/passes/trails.ts +77 -93
- package/src/shadow-cascades.ts +97 -0
- package/src/vmd-loader.ts +2 -2
package/dist/math.js
CHANGED
|
@@ -616,12 +616,29 @@ export class Mat4 {
|
|
|
616
616
|
static identity() {
|
|
617
617
|
return new Mat4(new Float32Array([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]));
|
|
618
618
|
}
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
619
|
+
/**
|
|
620
|
+
* Perspective for a LEFT-HANDED system (+Z forward), mapping z ∈ [near, far]
|
|
621
|
+
* onto clip z ∈ [0, w] — WebGPU's range, and D3D's.
|
|
622
|
+
*
|
|
623
|
+
* It used to write the OpenGL matrix, which maps onto [-w, w]. That is not a
|
|
624
|
+
* style difference: WebGPU clips everything with z < 0, so half the mapping was
|
|
625
|
+
* being thrown away and the near plane silently sat at TWICE the requested
|
|
626
|
+
* near. With the camera's own floor of 0.5 that put the real clip at 1.0 units
|
|
627
|
+
* — and since most materials draw with no face culling, a close-up did not fade
|
|
628
|
+
* the front of a head, it cut it open and showed the inside of the skull.
|
|
629
|
+
* Reported from the wild as 穿模 on imported camera work, which is exactly
|
|
630
|
+
* where it would show: a wide-angle shot is composed by moving the camera in.
|
|
631
|
+
*
|
|
632
|
+
* REVERSED-Z is this same function with near and far passed the other way
|
|
633
|
+
* round: it maps near → 1 and far → 0, which is worth doing on a float depth
|
|
634
|
+
* buffer because 1/z crowds precision at the near plane and float crowds it at
|
|
635
|
+
* zero, and the two cancel. On a UNORM buffer it is pointless — the precision
|
|
636
|
+
* curve is identical, only mirrored — so the caller decides, and decides on
|
|
637
|
+
* whether it got a float depth format.
|
|
638
|
+
*/
|
|
622
639
|
static perspectiveInto(out, fov, aspect, near, far) {
|
|
623
640
|
const f = 1.0 / Math.tan(fov / 2);
|
|
624
|
-
const rangeInv = 1.0 / (far - near);
|
|
641
|
+
const rangeInv = 1.0 / (far - near);
|
|
625
642
|
out[0] = f / aspect;
|
|
626
643
|
out[1] = 0;
|
|
627
644
|
out[2] = 0;
|
|
@@ -632,11 +649,11 @@ export class Mat4 {
|
|
|
632
649
|
out[7] = 0;
|
|
633
650
|
out[8] = 0;
|
|
634
651
|
out[9] = 0;
|
|
635
|
-
out[10] =
|
|
652
|
+
out[10] = far * rangeInv;
|
|
636
653
|
out[11] = 1; // Z+ forward (LH)
|
|
637
654
|
out[12] = 0;
|
|
638
655
|
out[13] = 0;
|
|
639
|
-
out[14] = -near * far * rangeInv
|
|
656
|
+
out[14] = -near * far * rangeInv;
|
|
640
657
|
out[15] = 0;
|
|
641
658
|
}
|
|
642
659
|
static perspective(fov, aspect, near, far) {
|
|
@@ -1100,16 +1117,6 @@ export const scratchMat4Values = [
|
|
|
1100
1117
|
new Float32Array(16),
|
|
1101
1118
|
new Float32Array(16),
|
|
1102
1119
|
];
|
|
1103
|
-
export const scratchVec3 = [
|
|
1104
|
-
new Vec3(0, 0, 0),
|
|
1105
|
-
new Vec3(0, 0, 0),
|
|
1106
|
-
new Vec3(0, 0, 0),
|
|
1107
|
-
new Vec3(0, 0, 0),
|
|
1108
|
-
new Vec3(0, 0, 0),
|
|
1109
|
-
new Vec3(0, 0, 0),
|
|
1110
|
-
new Vec3(0, 0, 0),
|
|
1111
|
-
new Vec3(0, 0, 0),
|
|
1112
|
-
];
|
|
1113
1120
|
export const scratchQuat = [
|
|
1114
1121
|
new Quat(0, 0, 0, 1),
|
|
1115
1122
|
new Quat(0, 0, 0, 1),
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { MidiNote } from "./engine";
|
|
2
|
+
/**
|
|
3
|
+
* Parse a Standard MIDI File into notes on the scene clock, sorted by onset.
|
|
4
|
+
*
|
|
5
|
+
* Throws only on a file that is not a MIDI file at all; a truncated or partly
|
|
6
|
+
* unreadable track yields the notes it managed rather than nothing, because a
|
|
7
|
+
* score that plays most of a piece is worth more than an exception.
|
|
8
|
+
*/
|
|
9
|
+
export declare function parseMidi(data: ArrayBuffer): MidiNote[];
|
|
10
|
+
//# sourceMappingURL=midi-loader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"midi-loader.d.ts","sourceRoot":"","sources":["../src/midi-loader.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AAkDxC;;;;;;GAMG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,WAAW,GAAG,QAAQ,EAAE,CA6IvD"}
|
|
@@ -0,0 +1,247 @@
|
|
|
1
|
+
// Standard MIDI File → MidiNote[], for setMidiNotes.
|
|
2
|
+
//
|
|
3
|
+
// The engine already parses PMX and VMD; this is the third loader and the
|
|
4
|
+
// smallest, because a score needs four numbers per note and a .mid carries far
|
|
5
|
+
// more than that. Everything not needed to place a note in TIME is skipped:
|
|
6
|
+
// instruments, controllers, pitch bend, lyrics, key signatures.
|
|
7
|
+
//
|
|
8
|
+
// THE TEMPO MAP IS THE WHOLE JOB. A MIDI file measures time in ticks against a
|
|
9
|
+
// tempo that changes as often as the music does — the piano transcription this
|
|
10
|
+
// was written against has 89 tempo changes across four minutes, because rubato
|
|
11
|
+
// is what makes it sound played rather than sequenced. Divide by a single
|
|
12
|
+
// average and every note after the first change lands at the wrong moment, and
|
|
13
|
+
// the drift compounds. So tempo changes are collected across ALL tracks first
|
|
14
|
+
// (format 1 puts them in track 0, but nothing requires that), then ticks are
|
|
15
|
+
// integrated through them segment by segment.
|
|
16
|
+
/** 120 bpm — what the spec says to assume when a file states nothing. */
|
|
17
|
+
const DEFAULT_US_PER_QUARTER = 500000;
|
|
18
|
+
class Reader {
|
|
19
|
+
constructor(d) {
|
|
20
|
+
this.d = d;
|
|
21
|
+
this.offset = 0;
|
|
22
|
+
}
|
|
23
|
+
get remaining() {
|
|
24
|
+
return this.d.byteLength - this.offset;
|
|
25
|
+
}
|
|
26
|
+
u8() {
|
|
27
|
+
return this.d.getUint8(this.offset++);
|
|
28
|
+
}
|
|
29
|
+
u16() {
|
|
30
|
+
const v = this.d.getUint16(this.offset);
|
|
31
|
+
this.offset += 2;
|
|
32
|
+
return v;
|
|
33
|
+
}
|
|
34
|
+
u32() {
|
|
35
|
+
const v = this.d.getUint32(this.offset);
|
|
36
|
+
this.offset += 4;
|
|
37
|
+
return v;
|
|
38
|
+
}
|
|
39
|
+
bytes(n) {
|
|
40
|
+
// Big-endian integer of n bytes — tempo is three of them.
|
|
41
|
+
let v = 0;
|
|
42
|
+
for (let i = 0; i < n; i++)
|
|
43
|
+
v = (v << 8) | this.u8();
|
|
44
|
+
return v;
|
|
45
|
+
}
|
|
46
|
+
/** Variable-length quantity: seven bits per byte, high bit continues. */
|
|
47
|
+
vlq() {
|
|
48
|
+
let v = 0;
|
|
49
|
+
for (;;) {
|
|
50
|
+
const b = this.u8();
|
|
51
|
+
v = (v << 7) | (b & 0x7f);
|
|
52
|
+
if ((b & 0x80) === 0)
|
|
53
|
+
return v;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
tag() {
|
|
57
|
+
return String.fromCharCode(this.u8(), this.u8(), this.u8(), this.u8());
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Parse a Standard MIDI File into notes on the scene clock, sorted by onset.
|
|
62
|
+
*
|
|
63
|
+
* Throws only on a file that is not a MIDI file at all; a truncated or partly
|
|
64
|
+
* unreadable track yields the notes it managed rather than nothing, because a
|
|
65
|
+
* score that plays most of a piece is worth more than an exception.
|
|
66
|
+
*/
|
|
67
|
+
export function parseMidi(data) {
|
|
68
|
+
const r = new Reader(new DataView(data));
|
|
69
|
+
if (r.remaining < 14 || r.tag() !== "MThd")
|
|
70
|
+
throw new Error("not a MIDI file (no MThd header)");
|
|
71
|
+
const headerLength = r.u32();
|
|
72
|
+
const headerEnd = r.offset + headerLength;
|
|
73
|
+
r.u16(); // format: 0, 1 and 2 all parse the same way here — every track is read
|
|
74
|
+
const trackCount = r.u16();
|
|
75
|
+
const division = r.u16();
|
|
76
|
+
r.offset = headerEnd;
|
|
77
|
+
if (division & 0x8000) {
|
|
78
|
+
// SMPTE: ticks are absolute frames, so there is no tempo map to apply.
|
|
79
|
+
// Vanishingly rare for music files and it would silently mis-time
|
|
80
|
+
// everything, so say so rather than pretend.
|
|
81
|
+
throw new Error("SMPTE time division is not supported — export the file with a tick-based division");
|
|
82
|
+
}
|
|
83
|
+
const ticksPerQuarter = division || 480;
|
|
84
|
+
const tempos = [];
|
|
85
|
+
const raw = [];
|
|
86
|
+
for (let t = 0; t < trackCount && r.remaining >= 8; t++) {
|
|
87
|
+
if (r.tag() !== "MTrk")
|
|
88
|
+
break;
|
|
89
|
+
const length = r.u32();
|
|
90
|
+
const end = Math.min(r.offset + length, r.offset + r.remaining);
|
|
91
|
+
let tick = 0;
|
|
92
|
+
// Running status: an event may omit its status byte and inherit the last
|
|
93
|
+
// one. Dropping this reads the file as garbage from the first omission on.
|
|
94
|
+
let status = 0;
|
|
95
|
+
while (r.offset < end) {
|
|
96
|
+
tick += r.vlq();
|
|
97
|
+
let b = r.u8();
|
|
98
|
+
if (b & 0x80) {
|
|
99
|
+
status = b;
|
|
100
|
+
b = r.offset < end ? r.u8() : 0;
|
|
101
|
+
}
|
|
102
|
+
const kind = status & 0xf0;
|
|
103
|
+
if (status === 0xff) {
|
|
104
|
+
const meta = b;
|
|
105
|
+
const len = r.vlq();
|
|
106
|
+
if (meta === 0x51 && len === 3)
|
|
107
|
+
tempos.push({ tick, usPerQuarter: r.bytes(3) });
|
|
108
|
+
else
|
|
109
|
+
r.offset += len;
|
|
110
|
+
}
|
|
111
|
+
else if (status === 0xf0 || status === 0xf7) {
|
|
112
|
+
// A sysex length was already consumed into `b` above only if the status
|
|
113
|
+
// byte was present; re-read defensively from the current position.
|
|
114
|
+
r.offset -= 1;
|
|
115
|
+
r.offset += r.vlq();
|
|
116
|
+
}
|
|
117
|
+
else if (kind === 0xc0 || kind === 0xd0) {
|
|
118
|
+
// Program change / channel pressure: one data byte, already in `b`.
|
|
119
|
+
}
|
|
120
|
+
else if (kind === 0x80 || kind === 0x90) {
|
|
121
|
+
const velocity = r.offset < end ? r.u8() : 0;
|
|
122
|
+
// Note-on at velocity 0 IS a note-off — the common encoding, because it
|
|
123
|
+
// lets a run of notes share one running status byte.
|
|
124
|
+
const on = kind === 0x90 && velocity > 0;
|
|
125
|
+
raw.push({ tick, on, pitch: b, velocity, channel: status & 0x0f });
|
|
126
|
+
}
|
|
127
|
+
else {
|
|
128
|
+
// Everything else with two data bytes: controller, pitch bend, aftertouch.
|
|
129
|
+
if (r.offset < end)
|
|
130
|
+
r.u8();
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
r.offset = end;
|
|
134
|
+
}
|
|
135
|
+
tempos.sort((a, b) => a.tick - b.tick);
|
|
136
|
+
// Ticks → seconds, integrating the tempo map. Walked once in tick order
|
|
137
|
+
// rather than searched per note: the events are already sorted, so this is
|
|
138
|
+
// linear where a per-note scan would be quadratic on a 1500-note file.
|
|
139
|
+
const toSeconds = makeTickClock(tempos, ticksPerQuarter);
|
|
140
|
+
raw.sort((a, b) => a.tick - b.tick || (a.on ? 1 : 0) - (b.on ? 1 : 0));
|
|
141
|
+
const pending = new Map();
|
|
142
|
+
/**
|
|
143
|
+
* Note-offs that found nothing to close, by key, in the order they were read.
|
|
144
|
+
*
|
|
145
|
+
* At the same tick the sort above puts every off AHEAD of every on, which is
|
|
146
|
+
* what makes a restrike pair correctly — the release of the held note is read
|
|
147
|
+
* before the strike that follows it. The cost is a note whose off is at its
|
|
148
|
+
* own onset tick: genuinely zero-length, and its off arrives before the on
|
|
149
|
+
* exists to be closed. Dropping it here left the on unpaired, so the note
|
|
150
|
+
* hung to the end of the file — the one case where the ordering that fixes
|
|
151
|
+
* restrikes creates a note nothing wrote.
|
|
152
|
+
*
|
|
153
|
+
* Kept rather than discarded so the flush below can look again. An off at any
|
|
154
|
+
* OTHER tick really is stray and stays dropped.
|
|
155
|
+
*/
|
|
156
|
+
const orphanOffs = new Map();
|
|
157
|
+
const notes = [];
|
|
158
|
+
for (const e of raw) {
|
|
159
|
+
const key = e.channel * 128 + e.pitch;
|
|
160
|
+
if (e.on) {
|
|
161
|
+
const list = pending.get(key);
|
|
162
|
+
if (list)
|
|
163
|
+
list.push({ tick: e.tick, velocity: e.velocity });
|
|
164
|
+
else
|
|
165
|
+
pending.set(key, [{ tick: e.tick, velocity: e.velocity }]);
|
|
166
|
+
continue;
|
|
167
|
+
}
|
|
168
|
+
// FIFO against the same key: a pedalled passage can restrike a pitch before
|
|
169
|
+
// releasing it, and pairing the newest would leave the older one hanging
|
|
170
|
+
// forever — the note would last the rest of the piece.
|
|
171
|
+
const list = pending.get(key);
|
|
172
|
+
const start = list?.shift();
|
|
173
|
+
if (!start) {
|
|
174
|
+
const seen = orphanOffs.get(key);
|
|
175
|
+
if (seen)
|
|
176
|
+
seen.push(e.tick);
|
|
177
|
+
else
|
|
178
|
+
orphanOffs.set(key, [e.tick]);
|
|
179
|
+
continue;
|
|
180
|
+
}
|
|
181
|
+
const t0 = toSeconds(start.tick);
|
|
182
|
+
notes.push({
|
|
183
|
+
start: t0,
|
|
184
|
+
duration: Math.max(0, toSeconds(e.tick) - t0),
|
|
185
|
+
pitch: e.pitch,
|
|
186
|
+
velocity: start.velocity / 127,
|
|
187
|
+
});
|
|
188
|
+
}
|
|
189
|
+
// Anything still held at the end of the file gets the file's own length, so a
|
|
190
|
+
// missing note-off shows as a long note rather than as a lost one.
|
|
191
|
+
const lastTick = raw.length ? raw[raw.length - 1].tick : 0;
|
|
192
|
+
for (const [key, list] of pending) {
|
|
193
|
+
// The pitch comes back out of the map key. Writing a literal 0 here — as
|
|
194
|
+
// this did — does not lose the note, it MOVES it: every hanging note lands
|
|
195
|
+
// on C-1, which then drags the score's reported pitch range down to it and
|
|
196
|
+
// lays every keyboard out against an octave nothing plays in.
|
|
197
|
+
const pitch = key % 128;
|
|
198
|
+
const orphans = orphanOffs.get(key);
|
|
199
|
+
for (const p of list) {
|
|
200
|
+
const t0 = toSeconds(p.tick);
|
|
201
|
+
// The second look: an off read at this note's OWN tick is its off, seen
|
|
202
|
+
// early because same-tick offs sort first. One off closes one note, so it
|
|
203
|
+
// is consumed — two zero-length strikes of a pitch need two offs.
|
|
204
|
+
const i = orphans ? orphans.indexOf(p.tick) : -1;
|
|
205
|
+
if (i >= 0) {
|
|
206
|
+
orphans.splice(i, 1);
|
|
207
|
+
notes.push({ start: t0, duration: 0, pitch, velocity: p.velocity / 127 });
|
|
208
|
+
continue;
|
|
209
|
+
}
|
|
210
|
+
notes.push({ start: t0, duration: Math.max(0, toSeconds(lastTick) - t0), pitch, velocity: p.velocity / 127 });
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
notes.sort((a, b) => a.start - b.start);
|
|
214
|
+
return notes;
|
|
215
|
+
}
|
|
216
|
+
/** Tick → seconds through the tempo map, as a closure over the segments. */
|
|
217
|
+
function makeTickClock(tempos, ticksPerQuarter) {
|
|
218
|
+
// Precompute the elapsed seconds at each tempo change, so a lookup is a walk
|
|
219
|
+
// over segments rather than a re-integration from zero.
|
|
220
|
+
const marks = [];
|
|
221
|
+
let seconds = 0;
|
|
222
|
+
let lastTick = 0;
|
|
223
|
+
let us = tempos.length && tempos[0].tick === 0 ? tempos[0].usPerQuarter : DEFAULT_US_PER_QUARTER;
|
|
224
|
+
marks.push({ tick: 0, seconds: 0, usPerQuarter: us });
|
|
225
|
+
for (const t of tempos) {
|
|
226
|
+
if (t.tick > lastTick) {
|
|
227
|
+
seconds += ((t.tick - lastTick) * us) / ticksPerQuarter / 1e6;
|
|
228
|
+
lastTick = t.tick;
|
|
229
|
+
}
|
|
230
|
+
us = t.usPerQuarter;
|
|
231
|
+
marks.push({ tick: t.tick, seconds, usPerQuarter: us });
|
|
232
|
+
}
|
|
233
|
+
return (tick) => {
|
|
234
|
+
// Binary search for the last mark at or before `tick`.
|
|
235
|
+
let lo = 0;
|
|
236
|
+
let hi = marks.length - 1;
|
|
237
|
+
while (lo < hi) {
|
|
238
|
+
const mid = (lo + hi + 1) >> 1;
|
|
239
|
+
if (marks[mid].tick <= tick)
|
|
240
|
+
lo = mid;
|
|
241
|
+
else
|
|
242
|
+
hi = mid - 1;
|
|
243
|
+
}
|
|
244
|
+
const m = marks[lo];
|
|
245
|
+
return m.seconds + ((tick - m.tick) * m.usPerQuarter) / ticksPerQuarter / 1e6;
|
|
246
|
+
};
|
|
247
|
+
}
|
package/dist/model.d.ts
CHANGED
|
@@ -134,7 +134,7 @@ export interface Morph {
|
|
|
134
134
|
export interface Morphing {
|
|
135
135
|
morphs: Morph[];
|
|
136
136
|
}
|
|
137
|
-
|
|
137
|
+
interface MorphComputeData {
|
|
138
138
|
basePositions: Float32Array;
|
|
139
139
|
rowStart: Uint32Array;
|
|
140
140
|
colMorph: Uint32Array;
|
|
@@ -143,18 +143,6 @@ export interface MorphComputeData {
|
|
|
143
143
|
vertexCount: number;
|
|
144
144
|
entryCount: number;
|
|
145
145
|
}
|
|
146
|
-
export interface SkeletonRuntime {
|
|
147
|
-
nameIndex: Record<string, number>;
|
|
148
|
-
localRotations: Quat[];
|
|
149
|
-
localTranslations: Vec3[];
|
|
150
|
-
worldMatrices: Mat4[];
|
|
151
|
-
ikChainInfo?: IKChainInfo[];
|
|
152
|
-
ikSolvers?: IKSolver[];
|
|
153
|
-
}
|
|
154
|
-
export interface MorphRuntime {
|
|
155
|
-
nameIndex: Record<string, number>;
|
|
156
|
-
weights: Float32Array;
|
|
157
|
-
}
|
|
158
146
|
export declare class Model {
|
|
159
147
|
private _name;
|
|
160
148
|
get name(): string;
|
|
@@ -361,7 +349,23 @@ export declare class Model {
|
|
|
361
349
|
maxVert: number;
|
|
362
350
|
} | null;
|
|
363
351
|
private buildClipFromVmdKeyFrames;
|
|
364
|
-
|
|
352
|
+
/**
|
|
353
|
+
* Load a VMD as the clip called `name`.
|
|
354
|
+
*
|
|
355
|
+
* `tracks: "morphs"` takes only the expression half and lays it over whatever
|
|
356
|
+
* clip `name` already holds — see AnimationState.setMorphTracks for why an
|
|
357
|
+
* morph file overwrites rather than merges. Everything else about the
|
|
358
|
+
* load is identical, which is the reason it is an option here rather than a
|
|
359
|
+
* second method: the path resolution below (site fetch, blob, or a folder
|
|
360
|
+
* upload's asset reader) is the part nobody should own twice.
|
|
361
|
+
*/
|
|
362
|
+
loadVmd(name: string, urlOrRelative: string, options?: {
|
|
363
|
+
tracks?: "all" | "morphs";
|
|
364
|
+
}): Promise<void>;
|
|
365
|
+
/** Zero the morphs a replaced track set drove and the new one does not, so
|
|
366
|
+
* the face it left behind does not sit frozen under the new morphs.
|
|
367
|
+
* See retiredMorphs for why nothing else clears them. */
|
|
368
|
+
private clearRetiredMorphs;
|
|
365
369
|
loadClip(name: string, clip: AnimationClip): void;
|
|
366
370
|
resetAllBones(): void;
|
|
367
371
|
resetAllMorphs(): void;
|
|
@@ -509,4 +513,5 @@ export declare class Model {
|
|
|
509
513
|
private computeSingleBoneWorldMatrix;
|
|
510
514
|
computeWorldMatrices(): void;
|
|
511
515
|
}
|
|
516
|
+
export {};
|
|
512
517
|
//# sourceMappingURL=model.d.ts.map
|
package/dist/model.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model.d.ts","sourceRoot":"","sources":["../src/model.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAA6C,MAAM,QAAQ,CAAA;AAEpF,OAAO,EAAiB,KAAK,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAChE,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,WAAW,CAAA;AAI5C,OAAO,EACL,aAAa,EACb,oBAAoB,EACpB,iBAAiB,EAEjB,UAAU,EAQX,MAAM,aAAa,CAAA;AAkBpB,MAAM,WAAW,aAAa;IAC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EmE;IACnE,cAAc,IAAI,IAAI;IAQtB,IAAI,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAM3B,oBAAoB,IAAI,iBAAiB;IAazC,OAAO,CAAC,MAAM,CAAC,UAAU;IAWzB,OAAO,CAAC,iBAAiB;IAczB;;;;;;OAMG;IACH,OAAO,CAAC,UAAU,CAAoB;IAEtC;8EAC0E;IAC1E,OAAO,CAAC,eAAe;IAevB;;;;8BAI0B;IAC1B,OAAO,CAAC,mBAAmB;IA2C3B,8FAA8F;IAC9F,OAAO,CAAC,gBAAgB;IAkBxB;;;;;;;;;;;;;;;;;OAiBG;IACH,OAAO,CAAC,cAAc;IAetB,OAAO,CAAC,iBAAiB;IAiCzB;;;;yEAIqE;IACrE,OAAO,CAAC,gBAAgB;IAuIxB;sFACkF;IAClF,OAAO,CAAC,YAAY;IAmDpB;;2EAEuE;IACvE,OAAO,CAAC,cAAc;IA0CtB;;;;;;;;;OASG;IACH,MAAM,IAAI,OAAO;IAiBjB,qDAAqD;IACrD,OAAO,CAAC,eAAe;IAQvB,MAAM,CAAC,SAAS,EAAE,MAAM,EAAE,SAAS,UAAO,GAAG,OAAO;IAgGpD,OAAO,CAAC,aAAa;IAyCrB,OAAO,CAAC,aAAa,CAAyB;IAI9C,OAAO,CAAC,4BAA4B;IAsHpC,oBAAoB,IAAI,IAAI;CAqF7B"}
|
package/dist/model.js
CHANGED
|
@@ -4,7 +4,7 @@ import { joinAssetPath } from "./asset-reader";
|
|
|
4
4
|
import { IKSolverSystem } from "./ik-solver";
|
|
5
5
|
import { VMDLoader } from "./vmd-loader";
|
|
6
6
|
import { VMDWriter } from "./vmd-writer";
|
|
7
|
-
import { AnimationState, FPS, interpolateControlPoints, rawInterpolationToBoneInterpolation, } from "./animation";
|
|
7
|
+
import { AnimationState, FPS, interpolateControlPoints, retiredMorphs, rawInterpolationToBoneInterpolation, } from "./animation";
|
|
8
8
|
const VERTEX_STRIDE = 8;
|
|
9
9
|
// Animation-sampling scratch (applyPoseFromClip → convertVMDTranslationToLocal). These
|
|
10
10
|
// run sequentially and are not reentrant with the world-matrix scratch in math.ts, so
|
|
@@ -1170,7 +1170,17 @@ export class Model {
|
|
|
1170
1170
|
}
|
|
1171
1171
|
return { boneTracks, morphTracks, frameCount: maxFrame };
|
|
1172
1172
|
}
|
|
1173
|
-
|
|
1173
|
+
/**
|
|
1174
|
+
* Load a VMD as the clip called `name`.
|
|
1175
|
+
*
|
|
1176
|
+
* `tracks: "morphs"` takes only the expression half and lays it over whatever
|
|
1177
|
+
* clip `name` already holds — see AnimationState.setMorphTracks for why an
|
|
1178
|
+
* morph file overwrites rather than merges. Everything else about the
|
|
1179
|
+
* load is identical, which is the reason it is an option here rather than a
|
|
1180
|
+
* second method: the path resolution below (site fetch, blob, or a folder
|
|
1181
|
+
* upload's asset reader) is the part nobody should own twice.
|
|
1182
|
+
*/
|
|
1183
|
+
loadVmd(name, urlOrRelative, options) {
|
|
1174
1184
|
const loadBuffer = () => {
|
|
1175
1185
|
const u = urlOrRelative.trim();
|
|
1176
1186
|
const useSiteFetch = u.startsWith("http://") ||
|
|
@@ -1197,6 +1207,13 @@ export class Model {
|
|
|
1197
1207
|
return loadBuffer().then((buf) => {
|
|
1198
1208
|
const vmdKeyFrames = VMDLoader.loadFromBuffer(buf);
|
|
1199
1209
|
const clip = this.buildClipFromVmdKeyFrames(vmdKeyFrames);
|
|
1210
|
+
if (options?.tracks === "morphs") {
|
|
1211
|
+
this.clearRetiredMorphs(name, clip.morphTracks);
|
|
1212
|
+
this.animationState.setMorphTracks(name, clip.morphTracks, clip.frameCount);
|
|
1213
|
+
return;
|
|
1214
|
+
}
|
|
1215
|
+
// A whole new clip retires the old one's morphs for the same reason.
|
|
1216
|
+
this.clearRetiredMorphs(name, clip.morphTracks);
|
|
1200
1217
|
// The IK block lives past every other section, so it is read separately
|
|
1201
1218
|
// rather than threaded through the keyframe grouping.
|
|
1202
1219
|
const ikFrames = VMDLoader.loadIkFromBuffer(buf);
|
|
@@ -1218,6 +1235,18 @@ export class Model {
|
|
|
1218
1235
|
this.animationState.loadAnimation(name, clip);
|
|
1219
1236
|
});
|
|
1220
1237
|
}
|
|
1238
|
+
/** Zero the morphs a replaced track set drove and the new one does not, so
|
|
1239
|
+
* the face it left behind does not sit frozen under the new morphs.
|
|
1240
|
+
* See retiredMorphs for why nothing else clears them. */
|
|
1241
|
+
clearRetiredMorphs(name, next) {
|
|
1242
|
+
for (const morphName of retiredMorphs(this.animationState.getAnimationClip(name), next)) {
|
|
1243
|
+
const idx = this.runtimeMorph.nameIndex[morphName];
|
|
1244
|
+
if (idx === undefined)
|
|
1245
|
+
continue;
|
|
1246
|
+
this.runtimeMorph.weights[idx] = 0;
|
|
1247
|
+
this.morphsDirty = true;
|
|
1248
|
+
}
|
|
1249
|
+
}
|
|
1221
1250
|
loadClip(name, clip) {
|
|
1222
1251
|
this.animationState.loadAnimation(name, clip);
|
|
1223
1252
|
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A material parameter over time.
|
|
3
|
+
*
|
|
4
|
+
* The other half of step 5: dissolve, teleport, a look that changes on a beat.
|
|
5
|
+
* The per-material channel already exists — setStyleParam writes straight into
|
|
6
|
+
* the style uniform — so what was missing was only a way to drive it from the
|
|
7
|
+
* scene clock rather than from whenever a caller happened to fire.
|
|
8
|
+
*
|
|
9
|
+
* WHY THE SAMPLING LIVES HERE, alone in its own file: everything else in this
|
|
10
|
+
* feature needs a GPU, and this does not. Keeping it pure is what lets the
|
|
11
|
+
* interpolation be tested exhaustively in a headless suite, which matters
|
|
12
|
+
* because it is the part with edge cases — the ends, a single key, keys at the
|
|
13
|
+
* same instant.
|
|
14
|
+
*
|
|
15
|
+
* NOT bezier. Bone animation has curves because a VMD carries them and a body
|
|
16
|
+
* needs ease; a material parameter is a dial, and a dial that needs shaping can
|
|
17
|
+
* be shaped by placing more keys. If eased segments are ever wanted, they
|
|
18
|
+
* belong as a property ON a key, not as a second sampler.
|
|
19
|
+
*
|
|
20
|
+
* DETERMINISTIC BY CONSTRUCTION: the value is a pure function of the scene
|
|
21
|
+
* clock, so an offline export stepping frame by frame produces exactly what
|
|
22
|
+
* playback did. Anything read from wall time would not, which is the same rule
|
|
23
|
+
* the score and audio interfaces already follow.
|
|
24
|
+
*/
|
|
25
|
+
/** A parameter value: a scalar, or a vector for the vec3 params. */
|
|
26
|
+
export type ParamValue = number | [number, number, number];
|
|
27
|
+
export type ParamKey = {
|
|
28
|
+
/** Seconds on the SCENE clock — the same clock an export steps. */
|
|
29
|
+
t: number;
|
|
30
|
+
v: ParamValue;
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* The value at `t`.
|
|
34
|
+
*
|
|
35
|
+
* Outside the track it HOLDS rather than extrapolating: a parameter that ran
|
|
36
|
+
* off the end of its keys and kept going would leave the scene somewhere its
|
|
37
|
+
* author never described, and the last key is the last thing they said.
|
|
38
|
+
*
|
|
39
|
+
* Keys must be sorted by `t` — setStyleParamTrack sorts on the way in, so this
|
|
40
|
+
* can binary-search rather than scan, and a track with a thousand keys costs
|
|
41
|
+
* the same per frame as one with four.
|
|
42
|
+
*/
|
|
43
|
+
export declare function sampleParamTrack(keys: ParamKey[], t: number): ParamValue | null;
|
|
44
|
+
/** Whether a freshly sampled value differs from the last one written. Tracks are
|
|
45
|
+
* evaluated every frame and most of them are flat most of the time, so this is
|
|
46
|
+
* what keeps a still scene from writing a uniform per parameter per frame. */
|
|
47
|
+
export declare function paramChanged(a: ParamValue | null, b: ParamValue | null): boolean;
|
|
48
|
+
//# sourceMappingURL=param-track.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"param-track.d.ts","sourceRoot":"","sources":["../src/param-track.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,oEAAoE;AACpE,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAA;AAE1D,MAAM,MAAM,QAAQ,GAAG;IACrB,mEAAmE;IACnE,CAAC,EAAE,MAAM,CAAA;IACT,CAAC,EAAE,UAAU,CAAA;CACd,CAAA;AAID;;;;;;;;;;GAUG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,QAAQ,EAAE,EAAE,CAAC,EAAE,MAAM,GAAG,UAAU,GAAG,IAAI,CA0B/E;AAED;;+EAE+E;AAC/E,wBAAgB,YAAY,CAAC,CAAC,EAAE,UAAU,GAAG,IAAI,EAAE,CAAC,EAAE,UAAU,GAAG,IAAI,GAAG,OAAO,CAIhF"}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A material parameter over time.
|
|
3
|
+
*
|
|
4
|
+
* The other half of step 5: dissolve, teleport, a look that changes on a beat.
|
|
5
|
+
* The per-material channel already exists — setStyleParam writes straight into
|
|
6
|
+
* the style uniform — so what was missing was only a way to drive it from the
|
|
7
|
+
* scene clock rather than from whenever a caller happened to fire.
|
|
8
|
+
*
|
|
9
|
+
* WHY THE SAMPLING LIVES HERE, alone in its own file: everything else in this
|
|
10
|
+
* feature needs a GPU, and this does not. Keeping it pure is what lets the
|
|
11
|
+
* interpolation be tested exhaustively in a headless suite, which matters
|
|
12
|
+
* because it is the part with edge cases — the ends, a single key, keys at the
|
|
13
|
+
* same instant.
|
|
14
|
+
*
|
|
15
|
+
* NOT bezier. Bone animation has curves because a VMD carries them and a body
|
|
16
|
+
* needs ease; a material parameter is a dial, and a dial that needs shaping can
|
|
17
|
+
* be shaped by placing more keys. If eased segments are ever wanted, they
|
|
18
|
+
* belong as a property ON a key, not as a second sampler.
|
|
19
|
+
*
|
|
20
|
+
* DETERMINISTIC BY CONSTRUCTION: the value is a pure function of the scene
|
|
21
|
+
* clock, so an offline export stepping frame by frame produces exactly what
|
|
22
|
+
* playback did. Anything read from wall time would not, which is the same rule
|
|
23
|
+
* the score and audio interfaces already follow.
|
|
24
|
+
*/
|
|
25
|
+
const lerp = (a, b, k) => a + (b - a) * k;
|
|
26
|
+
/**
|
|
27
|
+
* The value at `t`.
|
|
28
|
+
*
|
|
29
|
+
* Outside the track it HOLDS rather than extrapolating: a parameter that ran
|
|
30
|
+
* off the end of its keys and kept going would leave the scene somewhere its
|
|
31
|
+
* author never described, and the last key is the last thing they said.
|
|
32
|
+
*
|
|
33
|
+
* Keys must be sorted by `t` — setStyleParamTrack sorts on the way in, so this
|
|
34
|
+
* can binary-search rather than scan, and a track with a thousand keys costs
|
|
35
|
+
* the same per frame as one with four.
|
|
36
|
+
*/
|
|
37
|
+
export function sampleParamTrack(keys, t) {
|
|
38
|
+
if (keys.length === 0)
|
|
39
|
+
return null;
|
|
40
|
+
if (keys.length === 1 || t <= keys[0].t)
|
|
41
|
+
return keys[0].v;
|
|
42
|
+
const last = keys[keys.length - 1];
|
|
43
|
+
if (t >= last.t)
|
|
44
|
+
return last.v;
|
|
45
|
+
// The last key at or before t.
|
|
46
|
+
let lo = 0;
|
|
47
|
+
let hi = keys.length - 1;
|
|
48
|
+
while (lo < hi) {
|
|
49
|
+
const mid = (lo + hi + 1) >> 1;
|
|
50
|
+
if (keys[mid].t <= t)
|
|
51
|
+
lo = mid;
|
|
52
|
+
else
|
|
53
|
+
hi = mid - 1;
|
|
54
|
+
}
|
|
55
|
+
const a = keys[lo];
|
|
56
|
+
const b = keys[lo + 1];
|
|
57
|
+
const span = b.t - a.t;
|
|
58
|
+
// Two keys at the same instant are a STEP, and the later one wins. Dividing
|
|
59
|
+
// by the zero span would be a NaN written into a uniform every frame.
|
|
60
|
+
if (span <= 0)
|
|
61
|
+
return b.v;
|
|
62
|
+
const k = (t - a.t) / span;
|
|
63
|
+
if (typeof a.v === "number" && typeof b.v === "number")
|
|
64
|
+
return lerp(a.v, b.v, k);
|
|
65
|
+
// Mixed scalar and vector keys are an authoring mistake, not something to
|
|
66
|
+
// guess at: hold the segment's start rather than inventing a conversion.
|
|
67
|
+
if (typeof a.v === "number" || typeof b.v === "number")
|
|
68
|
+
return a.v;
|
|
69
|
+
return [lerp(a.v[0], b.v[0], k), lerp(a.v[1], b.v[1], k), lerp(a.v[2], b.v[2], k)];
|
|
70
|
+
}
|
|
71
|
+
/** Whether a freshly sampled value differs from the last one written. Tracks are
|
|
72
|
+
* evaluated every frame and most of them are flat most of the time, so this is
|
|
73
|
+
* what keeps a still scene from writing a uniform per parameter per frame. */
|
|
74
|
+
export function paramChanged(a, b) {
|
|
75
|
+
if (a === null || b === null)
|
|
76
|
+
return a !== b;
|
|
77
|
+
if (typeof a === "number" || typeof b === "number")
|
|
78
|
+
return a !== b;
|
|
79
|
+
return a[0] !== b[0] || a[1] !== b[1] || a[2] !== b[2];
|
|
80
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/physics/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAEpC,oBAAY,cAAc;IACxB,MAAM,IAAI;IACV,GAAG,IAAI;IACP,OAAO,IAAI;CACZ;AAOD,oBAAY,aAAa;IACvB,MAAM,IAAI,CAAE,wBAAwB;IACpC,OAAO,IAAI;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/physics/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAEpC,oBAAY,cAAc;IACxB,MAAM,IAAI;IACV,GAAG,IAAI;IACP,OAAO,IAAI;CACZ;AAOD,oBAAY,aAAa;IACvB,MAAM,IAAI,CAAE,wBAAwB;IACpC,OAAO,IAAI;IAIX,SAAS,IAAI;CACd;AAED,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,EAAE,MAAM,CAAA;IACnB,SAAS,EAAE,MAAM,CAAA;IACjB,KAAK,EAAE,MAAM,CAAA;IACb,aAAa,EAAE,MAAM,CAAA;IACrB,KAAK,EAAE,cAAc,CAAA;IACrB,IAAI,EAAE,IAAI,CAAA;IACV,aAAa,EAAE,IAAI,CAAA;IACnB,aAAa,EAAE,IAAI,CAAA;IACnB,IAAI,EAAE,MAAM,CAAA;IACZ,aAAa,EAAE,MAAM,CAAA;IACrB,cAAc,EAAE,MAAM,CAAA;IACtB,WAAW,EAAE,MAAM,CAAA;IACnB,QAAQ,EAAE,MAAM,CAAA;IAChB,IAAI,EAAE,aAAa,CAAA;IAGnB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,uBAAuB,EAAE,IAAI,CAAA;IAC7B,gBAAgB,CAAC,EAAE,IAAI,CAAA;CACxB;AAED,MAAM,WAAW,KAAK;IACpB,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,EAAE,MAAM,CAAA;IACnB,IAAI,EAAE,MAAM,CAAA;IACZ,eAAe,EAAE,MAAM,CAAA;IACvB,eAAe,EAAE,MAAM,CAAA;IACvB,QAAQ,EAAE,IAAI,CAAA;IACd,QAAQ,EAAE,IAAI,CAAA;IACd,WAAW,EAAE,IAAI,CAAA;IACjB,WAAW,EAAE,IAAI,CAAA;IACjB,WAAW,EAAE,IAAI,CAAA;IACjB,WAAW,EAAE,IAAI,CAAA;IACjB,cAAc,EAAE,IAAI,CAAA;IACpB,cAAc,EAAE,IAAI,CAAA;CACrB"}
|
package/dist/physics/types.js
CHANGED
|
@@ -13,5 +13,8 @@ export var RigidbodyType;
|
|
|
13
13
|
(function (RigidbodyType) {
|
|
14
14
|
RigidbodyType[RigidbodyType["Static"] = 0] = "Static";
|
|
15
15
|
RigidbodyType[RigidbodyType["Dynamic"] = 1] = "Dynamic";
|
|
16
|
+
// The loader no longer emits this — it maps mode 2 to Dynamic, which is the
|
|
17
|
+
// fix above. The member stays because the physics step still names it when
|
|
18
|
+
// asking "does this body follow its bone", and a host may set it directly.
|
|
16
19
|
RigidbodyType[RigidbodyType["Kinematic"] = 2] = "Kinematic";
|
|
17
20
|
})(RigidbodyType || (RigidbodyType = {}));
|