angular-three-cannon 1.0.0
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 +7 -0
- package/debug/README.md +3 -0
- package/debug/index.d.ts +1 -0
- package/debug/lib/debug.d.ts +26 -0
- package/esm2020/angular-three-cannon.mjs +5 -0
- package/esm2020/debug/angular-three-cannon-debug.mjs +5 -0
- package/esm2020/debug/index.mjs +2 -0
- package/esm2020/debug/lib/debug.mjs +117 -0
- package/esm2020/index.mjs +4 -0
- package/esm2020/lib/physics.mjs +261 -0
- package/esm2020/lib/store.mjs +21 -0
- package/esm2020/lib/utils.mjs +47 -0
- package/esm2020/services/angular-three-cannon-services.mjs +5 -0
- package/esm2020/services/index.mjs +2 -0
- package/esm2020/services/lib/body.mjs +293 -0
- package/fesm2015/angular-three-cannon-debug.mjs +124 -0
- package/fesm2015/angular-three-cannon-debug.mjs.map +1 -0
- package/fesm2015/angular-three-cannon-services.mjs +299 -0
- package/fesm2015/angular-three-cannon-services.mjs.map +1 -0
- package/fesm2015/angular-three-cannon.mjs +333 -0
- package/fesm2015/angular-three-cannon.mjs.map +1 -0
- package/fesm2020/angular-three-cannon-debug.mjs +124 -0
- package/fesm2020/angular-three-cannon-debug.mjs.map +1 -0
- package/fesm2020/angular-three-cannon-services.mjs +300 -0
- package/fesm2020/angular-three-cannon-services.mjs.map +1 -0
- package/fesm2020/angular-three-cannon.mjs +331 -0
- package/fesm2020/angular-three-cannon.mjs.map +1 -0
- package/index.d.ts +3 -0
- package/lib/physics.d.ts +43 -0
- package/lib/store.d.ts +34 -0
- package/lib/utils.d.ts +16 -0
- package/package.json +56 -0
- package/plugin/README.md +11 -0
- package/plugin/generators.json +19 -0
- package/plugin/package.json +10 -0
- package/plugin/src/generators/init/compat.d.ts +2 -0
- package/plugin/src/generators/init/compat.js +6 -0
- package/plugin/src/generators/init/compat.js.map +1 -0
- package/plugin/src/generators/init/init.d.ts +5 -0
- package/plugin/src/generators/init/init.js +28 -0
- package/plugin/src/generators/init/init.js.map +1 -0
- package/plugin/src/generators/init/schema.json +7 -0
- package/plugin/src/index.d.ts +1 -0
- package/plugin/src/index.js +6 -0
- package/plugin/src/index.js.map +1 -0
- package/services/README.md +3 -0
- package/services/index.d.ts +1 -0
- package/services/lib/body.d.ts +80 -0
|
@@ -0,0 +1,299 @@
|
|
|
1
|
+
import { __rest } from 'tslib';
|
|
2
|
+
import { inject } from '@angular/core';
|
|
3
|
+
import { injectNgtDestroy, injectNgtRef, tapEffect } from 'angular-three';
|
|
4
|
+
import { NgtcUtils, NgtcStore } from 'angular-three-cannon';
|
|
5
|
+
import { NGTC_DEBUG_API } from 'angular-three-cannon/debug';
|
|
6
|
+
import { ReplaySubject, combineLatest, switchMap, isObservable, of } from 'rxjs';
|
|
7
|
+
import * as THREE from 'three';
|
|
8
|
+
|
|
9
|
+
function injectPlane(fn, opts) {
|
|
10
|
+
return injectBody('Plane', fn, () => [], opts);
|
|
11
|
+
}
|
|
12
|
+
function injectBox(fn, opts) {
|
|
13
|
+
const defaultBoxArgs = [1, 1, 1];
|
|
14
|
+
return injectBody('Box', fn, (args = defaultBoxArgs) => args, opts);
|
|
15
|
+
}
|
|
16
|
+
function injectCylinder(fn, opts) {
|
|
17
|
+
return injectBody('Cylinder', fn, (args = []) => args, opts);
|
|
18
|
+
}
|
|
19
|
+
function injectHeightfield(fn, opts) {
|
|
20
|
+
return injectBody('Heightfield', fn, (args) => args, opts);
|
|
21
|
+
}
|
|
22
|
+
function injectParticle(fn, opts) {
|
|
23
|
+
return injectBody('Particle', fn, () => [], opts);
|
|
24
|
+
}
|
|
25
|
+
function injectSphere(fn, opts) {
|
|
26
|
+
return injectBody('Sphere', fn, (args = [1]) => {
|
|
27
|
+
if (!Array.isArray(args))
|
|
28
|
+
throw new Error('injectSphere args must be an array');
|
|
29
|
+
return [args[0]];
|
|
30
|
+
}, opts);
|
|
31
|
+
}
|
|
32
|
+
function injectTrimesh(fn, opts) {
|
|
33
|
+
return injectBody('Trimesh', fn, (args) => args, opts);
|
|
34
|
+
}
|
|
35
|
+
function injectConvexPolyhedron(fn, opts) {
|
|
36
|
+
return injectBody('ConvexPolyhedron', fn, ([vertices, faces, normals, axes, boundingSphereRadius] = []) => [
|
|
37
|
+
vertices && vertices.map(NgtcUtils.makeTriplet),
|
|
38
|
+
faces,
|
|
39
|
+
normals && normals.map(NgtcUtils.makeTriplet),
|
|
40
|
+
axes && axes.map(NgtcUtils.makeTriplet),
|
|
41
|
+
boundingSphereRadius,
|
|
42
|
+
], opts);
|
|
43
|
+
}
|
|
44
|
+
function injectCompoundBody(fn, opts) {
|
|
45
|
+
return injectBody('Compound', fn, (args) => args, opts);
|
|
46
|
+
}
|
|
47
|
+
const temp = new THREE.Object3D();
|
|
48
|
+
function injectBody(type, getPropsFn, argsFn, { ref, waitFor } = {}) {
|
|
49
|
+
let subscription = undefined;
|
|
50
|
+
// a ReplaySubject that would emit once in queueMicrotask call
|
|
51
|
+
const microQueue$ = new ReplaySubject(1);
|
|
52
|
+
// a ReplaySubject that would emit whenever our props emits. This is done so that the consumers can pass in
|
|
53
|
+
// Observable to injectBody if they have reactive props (eg: Input)
|
|
54
|
+
const propsSubject$ = new ReplaySubject(1);
|
|
55
|
+
// an array of streams we want to wait to emit until we decide to give the bodyRef an empty Object3D
|
|
56
|
+
const waits$ = [microQueue$];
|
|
57
|
+
const debugApi = inject(NGTC_DEBUG_API, { skipSelf: true, optional: true });
|
|
58
|
+
const physicsStore = inject(NgtcStore, { skipSelf: true });
|
|
59
|
+
// clean up our streams on destroy
|
|
60
|
+
injectNgtDestroy(() => {
|
|
61
|
+
microQueue$.complete();
|
|
62
|
+
propsSubject$.complete();
|
|
63
|
+
subscription === null || subscription === void 0 ? void 0 : subscription.unsubscribe();
|
|
64
|
+
});
|
|
65
|
+
// give our bodyRef an NgtInjectedRef
|
|
66
|
+
let bodyRef = injectNgtRef();
|
|
67
|
+
// add waitFor if the consumers pass it in
|
|
68
|
+
if (waitFor)
|
|
69
|
+
waits$.push(waitFor);
|
|
70
|
+
// re-assign bodyRef if the consumers pass a ref in
|
|
71
|
+
if (ref)
|
|
72
|
+
bodyRef = ref;
|
|
73
|
+
// fire microQueue$
|
|
74
|
+
queueMicrotask(() => microQueue$.next());
|
|
75
|
+
// when all waits$ emit, we give bodyRef an empty Object3D if it doesn't have one. Physic Object can still be affected
|
|
76
|
+
// by Physics without a visual representation
|
|
77
|
+
combineLatest(waits$).subscribe(() => (bodyRef.nativeElement || (bodyRef.nativeElement = new THREE.Object3D())));
|
|
78
|
+
// start the pipeline as soon as bodyRef has a truthy value
|
|
79
|
+
subscription = bodyRef.$.pipe(switchMap((object) => {
|
|
80
|
+
const { events, refs, worker } = physicsStore.get();
|
|
81
|
+
const currentWorker = worker;
|
|
82
|
+
let objectCount = 1;
|
|
83
|
+
if (object instanceof THREE.InstancedMesh) {
|
|
84
|
+
object.instanceMatrix.setUsage(THREE.DynamicDrawUsage);
|
|
85
|
+
objectCount = object.count;
|
|
86
|
+
}
|
|
87
|
+
// consolidate our uuids into an Array so we can handle them in a more consistent way
|
|
88
|
+
const uuids = object instanceof THREE.InstancedMesh
|
|
89
|
+
? new Array(objectCount).fill(0).map((_, i) => `${object.uuid}/${i}`)
|
|
90
|
+
: [object.uuid];
|
|
91
|
+
// construct an Array<Observable> from getPropsFn
|
|
92
|
+
// so we can react to props changed
|
|
93
|
+
const propsList$ = uuids.map((uuid, index) => {
|
|
94
|
+
const propsResult = getPropsFn(index);
|
|
95
|
+
// TODO we use a propsSubject$ because we want to ensure this propsResult stream is HOT
|
|
96
|
+
// otherwise, tapEffect will remove everything from currentWorker#bodies because the stream completes
|
|
97
|
+
(isObservable(propsResult) ? propsResult : of(propsResult)).subscribe({
|
|
98
|
+
next: (props) => {
|
|
99
|
+
NgtcUtils.prepare(temp, props);
|
|
100
|
+
if (object instanceof THREE.InstancedMesh) {
|
|
101
|
+
object.setMatrixAt(index, temp.matrix);
|
|
102
|
+
object.instanceMatrix.needsUpdate = true;
|
|
103
|
+
}
|
|
104
|
+
refs[uuid] = object;
|
|
105
|
+
debugApi === null || debugApi === void 0 ? void 0 : debugApi.add(uuid, props, type);
|
|
106
|
+
NgtcUtils.setupCollision(events, props, uuid);
|
|
107
|
+
propsSubject$.next(Object.assign(Object.assign({}, props), { args: argsFn(props.args) }));
|
|
108
|
+
},
|
|
109
|
+
error: (error) => {
|
|
110
|
+
console.error(`[NGT Cannon] Error with processing props: ${error}`);
|
|
111
|
+
propsSubject$.error(error);
|
|
112
|
+
},
|
|
113
|
+
});
|
|
114
|
+
return propsSubject$;
|
|
115
|
+
});
|
|
116
|
+
return combineLatest(propsList$).pipe(tapEffect((props) => {
|
|
117
|
+
currentWorker.addBodies({
|
|
118
|
+
props: props.map((_a) => {
|
|
119
|
+
var { onCollide, onCollideBegin, onCollideEnd } = _a, serializableProps = __rest(_a, ["onCollide", "onCollideBegin", "onCollideEnd"]);
|
|
120
|
+
return (Object.assign({ onCollide: Boolean(onCollide), onCollideBegin: Boolean(onCollideBegin), onCollideEnd: Boolean(onCollideEnd) }, serializableProps));
|
|
121
|
+
}),
|
|
122
|
+
type,
|
|
123
|
+
uuid: uuids,
|
|
124
|
+
});
|
|
125
|
+
// clean up CannonWorker whenever props changes/completes
|
|
126
|
+
return () => {
|
|
127
|
+
uuids.forEach((uuid) => {
|
|
128
|
+
delete refs[uuid];
|
|
129
|
+
debugApi === null || debugApi === void 0 ? void 0 : debugApi.remove(uuid);
|
|
130
|
+
delete events[uuid];
|
|
131
|
+
});
|
|
132
|
+
currentWorker.removeBodies({ uuid: uuids });
|
|
133
|
+
};
|
|
134
|
+
}));
|
|
135
|
+
})).subscribe();
|
|
136
|
+
const makeAtomic = (type, index) => {
|
|
137
|
+
const op = `set${NgtcUtils.capitalize(type)}`;
|
|
138
|
+
return {
|
|
139
|
+
set: (value) => {
|
|
140
|
+
const { worker } = physicsStore.get();
|
|
141
|
+
const uuid = NgtcUtils.getUUID(bodyRef, index);
|
|
142
|
+
uuid && worker[op]({ props: value, uuid });
|
|
143
|
+
},
|
|
144
|
+
get subscribe() {
|
|
145
|
+
const { subscriptions, worker } = physicsStore.get();
|
|
146
|
+
return NgtcUtils.subscribe(bodyRef, worker, subscriptions, type, index);
|
|
147
|
+
},
|
|
148
|
+
};
|
|
149
|
+
};
|
|
150
|
+
const makeQuaternion = (index) => {
|
|
151
|
+
const type = 'quaternion';
|
|
152
|
+
return {
|
|
153
|
+
copy: ({ w, x, y, z }) => {
|
|
154
|
+
const { worker } = physicsStore.get();
|
|
155
|
+
const uuid = NgtcUtils.getUUID(bodyRef, index);
|
|
156
|
+
uuid && worker.setQuaternion({ props: [x, y, z, w], uuid });
|
|
157
|
+
},
|
|
158
|
+
set: (x, y, z, w) => {
|
|
159
|
+
const { worker } = physicsStore.get();
|
|
160
|
+
const uuid = NgtcUtils.getUUID(bodyRef, index);
|
|
161
|
+
uuid && worker.setQuaternion({ props: [x, y, z, w], uuid });
|
|
162
|
+
},
|
|
163
|
+
get subscribe() {
|
|
164
|
+
const { subscriptions, worker } = physicsStore.get();
|
|
165
|
+
return NgtcUtils.subscribe(bodyRef, worker, subscriptions, type, index);
|
|
166
|
+
},
|
|
167
|
+
};
|
|
168
|
+
};
|
|
169
|
+
const makeRotation = (index) => {
|
|
170
|
+
return {
|
|
171
|
+
copy: ({ x, y, z }) => {
|
|
172
|
+
const { worker } = physicsStore.get();
|
|
173
|
+
const uuid = NgtcUtils.getUUID(bodyRef, index);
|
|
174
|
+
uuid && worker.setRotation({ props: [x, y, z], uuid });
|
|
175
|
+
},
|
|
176
|
+
set: (x, y, z) => {
|
|
177
|
+
const { worker } = physicsStore.get();
|
|
178
|
+
const uuid = NgtcUtils.getUUID(bodyRef, index);
|
|
179
|
+
uuid && worker.setRotation({ props: [x, y, z], uuid });
|
|
180
|
+
},
|
|
181
|
+
subscribe: (callback) => {
|
|
182
|
+
const { subscriptions, worker } = physicsStore.get();
|
|
183
|
+
const id = NgtcUtils.incrementingId++;
|
|
184
|
+
const target = 'bodies';
|
|
185
|
+
const type = 'quaternion';
|
|
186
|
+
const uuid = NgtcUtils.getUUID(bodyRef, index);
|
|
187
|
+
subscriptions[id] = { [type]: NgtcUtils.quaternionToRotation(callback) };
|
|
188
|
+
uuid && worker.subscribe({ props: { id, target, type }, uuid });
|
|
189
|
+
return () => {
|
|
190
|
+
delete subscriptions[id];
|
|
191
|
+
worker.unsubscribe({ props: id });
|
|
192
|
+
};
|
|
193
|
+
},
|
|
194
|
+
};
|
|
195
|
+
};
|
|
196
|
+
const makeVec = (type, index) => {
|
|
197
|
+
const op = `set${NgtcUtils.capitalize(type)}`;
|
|
198
|
+
return {
|
|
199
|
+
copy: ({ x, y, z }) => {
|
|
200
|
+
const { worker } = physicsStore.get();
|
|
201
|
+
const uuid = NgtcUtils.getUUID(bodyRef, index);
|
|
202
|
+
uuid && worker[op]({ props: [x, y, z], uuid });
|
|
203
|
+
},
|
|
204
|
+
set: (x, y, z) => {
|
|
205
|
+
const { worker } = physicsStore.get();
|
|
206
|
+
const uuid = NgtcUtils.getUUID(bodyRef, index);
|
|
207
|
+
uuid && worker[op]({ props: [x, y, z], uuid });
|
|
208
|
+
},
|
|
209
|
+
get subscribe() {
|
|
210
|
+
const { subscriptions, worker } = physicsStore.get();
|
|
211
|
+
return NgtcUtils.subscribe(bodyRef, worker, subscriptions, type, index);
|
|
212
|
+
},
|
|
213
|
+
};
|
|
214
|
+
};
|
|
215
|
+
const makeRemove = (index) => {
|
|
216
|
+
const { worker } = physicsStore.get();
|
|
217
|
+
const uuid = NgtcUtils.getUUID(bodyRef, index);
|
|
218
|
+
return () => {
|
|
219
|
+
if (uuid)
|
|
220
|
+
worker.removeBodies({ uuid: [uuid] });
|
|
221
|
+
};
|
|
222
|
+
};
|
|
223
|
+
function makeApi(index) {
|
|
224
|
+
return {
|
|
225
|
+
allowSleep: makeAtomic('allowSleep', index),
|
|
226
|
+
angularDamping: makeAtomic('angularDamping', index),
|
|
227
|
+
angularFactor: makeVec('angularFactor', index),
|
|
228
|
+
angularVelocity: makeVec('angularVelocity', index),
|
|
229
|
+
applyForce(force, worldPoint) {
|
|
230
|
+
const { worker } = physicsStore.get();
|
|
231
|
+
const uuid = NgtcUtils.getUUID(bodyRef, index);
|
|
232
|
+
uuid && worker.applyForce({ props: [force, worldPoint], uuid });
|
|
233
|
+
},
|
|
234
|
+
applyImpulse(impulse, worldPoint) {
|
|
235
|
+
const { worker } = physicsStore.get();
|
|
236
|
+
const uuid = NgtcUtils.getUUID(bodyRef, index);
|
|
237
|
+
uuid && worker.applyImpulse({ props: [impulse, worldPoint], uuid });
|
|
238
|
+
},
|
|
239
|
+
applyLocalForce(force, localPoint) {
|
|
240
|
+
const { worker } = physicsStore.get();
|
|
241
|
+
const uuid = NgtcUtils.getUUID(bodyRef, index);
|
|
242
|
+
uuid && worker.applyLocalForce({ props: [force, localPoint], uuid });
|
|
243
|
+
},
|
|
244
|
+
applyLocalImpulse(impulse, localPoint) {
|
|
245
|
+
const { worker } = physicsStore.get();
|
|
246
|
+
const uuid = NgtcUtils.getUUID(bodyRef, index);
|
|
247
|
+
uuid && worker.applyLocalImpulse({ props: [impulse, localPoint], uuid });
|
|
248
|
+
},
|
|
249
|
+
applyTorque(torque) {
|
|
250
|
+
const { worker } = physicsStore.get();
|
|
251
|
+
const uuid = NgtcUtils.getUUID(bodyRef, index);
|
|
252
|
+
uuid && worker.applyTorque({ props: [torque], uuid });
|
|
253
|
+
},
|
|
254
|
+
collisionFilterGroup: makeAtomic('collisionFilterGroup', index),
|
|
255
|
+
collisionFilterMask: makeAtomic('collisionFilterMask', index),
|
|
256
|
+
collisionResponse: makeAtomic('collisionResponse', index),
|
|
257
|
+
fixedRotation: makeAtomic('fixedRotation', index),
|
|
258
|
+
isTrigger: makeAtomic('isTrigger', index),
|
|
259
|
+
linearDamping: makeAtomic('linearDamping', index),
|
|
260
|
+
linearFactor: makeVec('linearFactor', index),
|
|
261
|
+
mass: makeAtomic('mass', index),
|
|
262
|
+
material: makeAtomic('material', index),
|
|
263
|
+
position: makeVec('position', index),
|
|
264
|
+
quaternion: makeQuaternion(index),
|
|
265
|
+
remove: makeRemove(index),
|
|
266
|
+
rotation: makeRotation(index),
|
|
267
|
+
scaleOverride(scale) {
|
|
268
|
+
const { scaleOverrides } = physicsStore.get();
|
|
269
|
+
const uuid = NgtcUtils.getUUID(bodyRef, index);
|
|
270
|
+
if (uuid)
|
|
271
|
+
scaleOverrides[uuid] = new THREE.Vector3(...scale);
|
|
272
|
+
},
|
|
273
|
+
sleep() {
|
|
274
|
+
const { worker } = physicsStore.get();
|
|
275
|
+
const uuid = NgtcUtils.getUUID(bodyRef, index);
|
|
276
|
+
uuid && worker.sleep({ uuid });
|
|
277
|
+
},
|
|
278
|
+
sleepSpeedLimit: makeAtomic('sleepSpeedLimit', index),
|
|
279
|
+
sleepTimeLimit: makeAtomic('sleepTimeLimit', index),
|
|
280
|
+
userData: makeAtomic('userData', index),
|
|
281
|
+
velocity: makeVec('velocity', index),
|
|
282
|
+
wakeUp() {
|
|
283
|
+
const { worker } = physicsStore.get();
|
|
284
|
+
const uuid = NgtcUtils.getUUID(bodyRef, index);
|
|
285
|
+
uuid && worker.wakeUp({ uuid });
|
|
286
|
+
},
|
|
287
|
+
};
|
|
288
|
+
}
|
|
289
|
+
const cache = {};
|
|
290
|
+
const api = Object.assign(Object.assign({}, makeApi(undefined)), { at: (index) => cache[index] || (cache[index] = makeApi(index)) });
|
|
291
|
+
return { ref: bodyRef, api };
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
/**
|
|
295
|
+
* Generated bundle index. Do not edit.
|
|
296
|
+
*/
|
|
297
|
+
|
|
298
|
+
export { injectBox, injectCompoundBody, injectConvexPolyhedron, injectCylinder, injectHeightfield, injectParticle, injectPlane, injectSphere, injectTrimesh };
|
|
299
|
+
//# sourceMappingURL=angular-three-cannon-services.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"angular-three-cannon-services.mjs","sources":["../../../../libs/angular-three-cannon/services/src/lib/body.ts","../../../../libs/angular-three-cannon/services/src/angular-three-cannon-services.ts"],"sourcesContent":["import { inject } from '@angular/core';\nimport {\n AtomicName,\n AtomicProps,\n BodyProps,\n BodyShapeType,\n BoxProps,\n CompoundBodyProps,\n ConvexPolyhedronArgs,\n ConvexPolyhedronProps,\n CylinderProps,\n HeightfieldProps,\n ParticleProps,\n PlaneProps,\n PropValue,\n Quad,\n SetOpName,\n SphereArgs,\n SphereProps,\n TrimeshProps,\n Triplet,\n VectorName,\n} from '@pmndrs/cannon-worker-api';\nimport { injectNgtDestroy, injectNgtRef, NgtInjectedRef, tapEffect } from 'angular-three';\nimport { NgtcStore, NgtcUtils } from 'angular-three-cannon';\nimport { NGTC_DEBUG_API } from 'angular-three-cannon/debug';\nimport { combineLatest, isObservable, Observable, of, ReplaySubject, Subscription, switchMap } from 'rxjs';\nimport * as THREE from 'three';\n\nexport type NgtcAtomicApi<K extends AtomicName> = {\n set: (value: AtomicProps[K]) => void;\n subscribe: (callback: (value: AtomicProps[K]) => void) => () => void;\n};\n\nexport type NgtcQuaternionApi = {\n copy: ({ w, x, y, z }: THREE.Quaternion) => void;\n set: (x: number, y: number, z: number, w: number) => void;\n subscribe: (callback: (value: Quad) => void) => () => void;\n};\n\nexport type NgtcVectorApi = {\n copy: ({ x, y, z }: THREE.Vector3 | THREE.Euler) => void;\n set: (x: number, y: number, z: number) => void;\n subscribe: (callback: (value: Triplet) => void) => () => void;\n};\n\nexport type NgtcWorkerApi = {\n [K in AtomicName]: NgtcAtomicApi<K>;\n} & {\n [K in VectorName]: NgtcVectorApi;\n} & {\n applyForce: (force: Triplet, worldPoint: Triplet) => void;\n applyImpulse: (impulse: Triplet, worldPoint: Triplet) => void;\n applyLocalForce: (force: Triplet, localPoint: Triplet) => void;\n applyLocalImpulse: (impulse: Triplet, localPoint: Triplet) => void;\n applyTorque: (torque: Triplet) => void;\n quaternion: NgtcQuaternionApi;\n rotation: NgtcVectorApi;\n scaleOverride: (scale: Triplet) => void;\n sleep: () => void;\n wakeUp: () => void;\n remove: () => void;\n};\n\nexport interface NgtcBodyPublicApi extends NgtcWorkerApi {\n at: (index: number) => NgtcWorkerApi;\n}\n\nexport interface NgtcBodyReturn<TObject extends THREE.Object3D> {\n ref: NgtInjectedRef<TObject>;\n api: NgtcBodyPublicApi;\n}\n\nexport type NgtcGetByIndex<T extends BodyProps> = (index: number) => T | Observable<T>;\nexport type NgtcArgFn<T> = (args: T) => unknown[];\n\nexport function injectPlane<TObject extends THREE.Object3D>(\n fn: NgtcGetByIndex<PlaneProps>,\n opts?: { ref?: NgtInjectedRef<TObject>; waitFor?: Observable<unknown> }\n) {\n return injectBody<PlaneProps, TObject>('Plane', fn, () => [], opts);\n}\n\nexport function injectBox<TObject extends THREE.Object3D>(\n fn: NgtcGetByIndex<BoxProps>,\n opts?: { ref?: NgtInjectedRef<TObject>; waitFor?: Observable<unknown> }\n) {\n const defaultBoxArgs: Triplet = [1, 1, 1];\n return injectBody<BoxProps, TObject>('Box', fn, (args = defaultBoxArgs): Triplet => args, opts);\n}\n\nexport function injectCylinder<TObject extends THREE.Object3D>(\n fn: NgtcGetByIndex<CylinderProps>,\n opts?: { ref?: NgtInjectedRef<TObject>; waitFor?: Observable<unknown> }\n) {\n return injectBody<CylinderProps, TObject>('Cylinder', fn, (args = [] as []) => args, opts);\n}\n\nexport function injectHeightfield<TObject extends THREE.Object3D>(\n fn: NgtcGetByIndex<HeightfieldProps>,\n opts?: { ref?: NgtInjectedRef<TObject>; waitFor?: Observable<unknown> }\n) {\n return injectBody<HeightfieldProps, TObject>('Heightfield', fn, (args) => args, opts);\n}\n\nexport function injectParticle<TObject extends THREE.Object3D>(\n fn: NgtcGetByIndex<ParticleProps>,\n opts?: { ref?: NgtInjectedRef<TObject>; waitFor?: Observable<unknown> }\n) {\n return injectBody<ParticleProps, TObject>('Particle', fn, () => [], opts);\n}\n\nexport function injectSphere<TObject extends THREE.Object3D>(\n fn: NgtcGetByIndex<SphereProps>,\n opts?: { ref?: NgtInjectedRef<TObject>; waitFor?: Observable<unknown> }\n) {\n return injectBody<SphereProps, TObject>(\n 'Sphere',\n fn,\n (args: SphereArgs = [1]): SphereArgs => {\n if (!Array.isArray(args)) throw new Error('injectSphere args must be an array');\n return [args[0]];\n },\n opts\n );\n}\n\nexport function injectTrimesh<TObject extends THREE.Object3D>(\n fn: NgtcGetByIndex<TrimeshProps>,\n opts?: { ref?: NgtInjectedRef<TObject>; waitFor?: Observable<unknown> }\n) {\n return injectBody<TrimeshProps, TObject>('Trimesh', fn, (args) => args, opts);\n}\n\nexport function injectConvexPolyhedron<TObject extends THREE.Object3D>(\n fn: NgtcGetByIndex<ConvexPolyhedronProps>,\n opts?: { ref?: NgtInjectedRef<TObject>; waitFor?: Observable<unknown> }\n) {\n return injectBody<ConvexPolyhedronProps, TObject>(\n 'ConvexPolyhedron',\n fn,\n ([vertices, faces, normals, axes, boundingSphereRadius] = []): ConvexPolyhedronArgs<Triplet> => [\n vertices && vertices.map(NgtcUtils.makeTriplet),\n faces,\n normals && normals.map(NgtcUtils.makeTriplet),\n axes && axes.map(NgtcUtils.makeTriplet),\n boundingSphereRadius,\n ],\n opts\n );\n}\n\nexport function injectCompoundBody<TObject extends THREE.Object3D>(\n fn: NgtcGetByIndex<CompoundBodyProps>,\n opts?: { ref?: NgtInjectedRef<TObject>; waitFor?: Observable<unknown> }\n) {\n return injectBody<CompoundBodyProps, TObject>('Compound', fn, (args) => args as unknown[], opts);\n}\n\nconst temp = new THREE.Object3D();\n\nfunction injectBody<TBodyProps extends BodyProps, TObject extends THREE.Object3D>(\n type: BodyShapeType,\n getPropsFn: NgtcGetByIndex<TBodyProps>,\n argsFn: NgtcArgFn<TBodyProps['args']>,\n { ref, waitFor }: { ref?: NgtInjectedRef<TObject>; waitFor?: Observable<unknown> } = {}\n): NgtcBodyReturn<TObject> {\n let subscription: Subscription | undefined = undefined;\n\n // a ReplaySubject that would emit once in queueMicrotask call\n const microQueue$ = new ReplaySubject<void>(1);\n // a ReplaySubject that would emit whenever our props emits. This is done so that the consumers can pass in\n // Observable to injectBody if they have reactive props (eg: Input)\n const propsSubject$ = new ReplaySubject<TBodyProps>(1);\n\n // an array of streams we want to wait to emit until we decide to give the bodyRef an empty Object3D\n const waits$ = [microQueue$] as Observable<unknown>[];\n\n const debugApi = inject(NGTC_DEBUG_API, { skipSelf: true, optional: true });\n const physicsStore = inject(NgtcStore, { skipSelf: true });\n\n // clean up our streams on destroy\n injectNgtDestroy(() => {\n microQueue$.complete();\n propsSubject$.complete();\n subscription?.unsubscribe();\n });\n\n // give our bodyRef an NgtInjectedRef\n let bodyRef = injectNgtRef<TObject>();\n\n // add waitFor if the consumers pass it in\n if (waitFor) waits$.push(waitFor);\n // re-assign bodyRef if the consumers pass a ref in\n if (ref) bodyRef = ref;\n\n // fire microQueue$\n queueMicrotask(() => microQueue$.next());\n\n // when all waits$ emit, we give bodyRef an empty Object3D if it doesn't have one. Physic Object can still be affected\n // by Physics without a visual representation\n combineLatest(waits$).subscribe(() => (bodyRef.nativeElement ||= new THREE.Object3D() as TObject));\n\n // start the pipeline as soon as bodyRef has a truthy value\n subscription = bodyRef.$.pipe(\n switchMap((object) => {\n const { events, refs, worker } = physicsStore.get();\n\n const currentWorker = worker;\n let objectCount = 1;\n\n if (object instanceof THREE.InstancedMesh) {\n object.instanceMatrix.setUsage(THREE.DynamicDrawUsage);\n objectCount = object.count;\n }\n\n // consolidate our uuids into an Array so we can handle them in a more consistent way\n const uuids =\n object instanceof THREE.InstancedMesh\n ? new Array(objectCount).fill(0).map((_, i) => `${object.uuid}/${i}`)\n : [object.uuid];\n\n // construct an Array<Observable> from getPropsFn\n // so we can react to props changed\n const propsList$ = uuids.map((uuid, index) => {\n const propsResult = getPropsFn(index);\n // TODO we use a propsSubject$ because we want to ensure this propsResult stream is HOT\n // otherwise, tapEffect will remove everything from currentWorker#bodies because the stream completes\n (isObservable(propsResult) ? propsResult : of(propsResult)).subscribe({\n next: (props) => {\n NgtcUtils.prepare(temp, props);\n if (object instanceof THREE.InstancedMesh) {\n object.setMatrixAt(index, temp.matrix);\n object.instanceMatrix.needsUpdate = true;\n }\n refs[uuid] = object;\n debugApi?.add(uuid, props, type);\n NgtcUtils.setupCollision(events, props, uuid);\n propsSubject$.next({ ...props, args: argsFn(props.args) });\n },\n error: (error) => {\n console.error(`[NGT Cannon] Error with processing props: ${error}`);\n propsSubject$.error(error);\n },\n });\n\n return propsSubject$;\n });\n\n return combineLatest(propsList$).pipe(\n tapEffect((props) => {\n currentWorker.addBodies({\n props: props.map(({ onCollide, onCollideBegin, onCollideEnd, ...serializableProps }) => ({\n onCollide: Boolean(onCollide),\n onCollideBegin: Boolean(onCollideBegin),\n onCollideEnd: Boolean(onCollideEnd),\n ...serializableProps,\n })),\n type,\n uuid: uuids,\n });\n // clean up CannonWorker whenever props changes/completes\n return () => {\n uuids.forEach((uuid) => {\n delete refs[uuid];\n debugApi?.remove(uuid);\n delete events[uuid];\n });\n currentWorker.removeBodies({ uuid: uuids });\n };\n })\n );\n })\n ).subscribe();\n\n const makeAtomic = <T extends AtomicName>(type: T, index?: number) => {\n const op: SetOpName<T> = `set${NgtcUtils.capitalize(type)}`;\n\n return {\n set: (value: PropValue<T>) => {\n const { worker } = physicsStore.get();\n const uuid = NgtcUtils.getUUID(bodyRef, index);\n uuid && worker[op]({ props: value, uuid } as never);\n },\n get subscribe() {\n const { subscriptions, worker } = physicsStore.get();\n return NgtcUtils.subscribe(bodyRef, worker, subscriptions, type, index);\n },\n };\n };\n\n const makeQuaternion = (index?: number) => {\n const type = 'quaternion';\n return {\n copy: ({ w, x, y, z }: THREE.Quaternion) => {\n const { worker } = physicsStore.get();\n const uuid = NgtcUtils.getUUID(bodyRef, index);\n uuid && worker.setQuaternion({ props: [x, y, z, w], uuid });\n },\n set: (x: number, y: number, z: number, w: number) => {\n const { worker } = physicsStore.get();\n const uuid = NgtcUtils.getUUID(bodyRef, index);\n uuid && worker.setQuaternion({ props: [x, y, z, w], uuid });\n },\n get subscribe() {\n const { subscriptions, worker } = physicsStore.get();\n return NgtcUtils.subscribe(bodyRef, worker, subscriptions, type, index);\n },\n };\n };\n\n const makeRotation = (index?: number) => {\n return {\n copy: ({ x, y, z }: THREE.Vector3 | THREE.Euler) => {\n const { worker } = physicsStore.get();\n const uuid = NgtcUtils.getUUID(bodyRef, index);\n uuid && worker.setRotation({ props: [x, y, z], uuid });\n },\n set: (x: number, y: number, z: number) => {\n const { worker } = physicsStore.get();\n const uuid = NgtcUtils.getUUID(bodyRef, index);\n uuid && worker.setRotation({ props: [x, y, z], uuid });\n },\n subscribe: (callback: (value: Triplet) => void) => {\n const { subscriptions, worker } = physicsStore.get();\n const id = NgtcUtils.incrementingId++;\n const target = 'bodies';\n const type = 'quaternion';\n const uuid = NgtcUtils.getUUID(bodyRef, index);\n\n subscriptions[id] = { [type]: NgtcUtils.quaternionToRotation(callback) };\n uuid && worker.subscribe({ props: { id, target, type }, uuid });\n return () => {\n delete subscriptions[id];\n worker.unsubscribe({ props: id });\n };\n },\n };\n };\n\n const makeVec = (type: VectorName, index?: number) => {\n const op: SetOpName<VectorName> = `set${NgtcUtils.capitalize(type)}`;\n return {\n copy: ({ x, y, z }: THREE.Vector3 | THREE.Euler) => {\n const { worker } = physicsStore.get();\n const uuid = NgtcUtils.getUUID(bodyRef, index);\n uuid && worker[op]({ props: [x, y, z], uuid });\n },\n set: (x: number, y: number, z: number) => {\n const { worker } = physicsStore.get();\n const uuid = NgtcUtils.getUUID(bodyRef, index);\n uuid && worker[op]({ props: [x, y, z], uuid });\n },\n get subscribe() {\n const { subscriptions, worker } = physicsStore.get();\n return NgtcUtils.subscribe(bodyRef, worker, subscriptions, type, index);\n },\n };\n };\n\n const makeRemove = (index?: number) => {\n const { worker } = physicsStore.get();\n const uuid = NgtcUtils.getUUID(bodyRef, index);\n return () => {\n if (uuid) worker.removeBodies({ uuid: [uuid] });\n };\n };\n\n function makeApi(index?: number): NgtcWorkerApi {\n return {\n allowSleep: makeAtomic('allowSleep', index),\n angularDamping: makeAtomic('angularDamping', index),\n angularFactor: makeVec('angularFactor', index),\n angularVelocity: makeVec('angularVelocity', index),\n applyForce(force: Triplet, worldPoint: Triplet) {\n const { worker } = physicsStore.get();\n const uuid = NgtcUtils.getUUID(bodyRef, index);\n uuid && worker.applyForce({ props: [force, worldPoint], uuid });\n },\n applyImpulse(impulse: Triplet, worldPoint: Triplet) {\n const { worker } = physicsStore.get();\n const uuid = NgtcUtils.getUUID(bodyRef, index);\n uuid && worker.applyImpulse({ props: [impulse, worldPoint], uuid });\n },\n applyLocalForce(force: Triplet, localPoint: Triplet) {\n const { worker } = physicsStore.get();\n const uuid = NgtcUtils.getUUID(bodyRef, index);\n uuid && worker.applyLocalForce({ props: [force, localPoint], uuid });\n },\n applyLocalImpulse(impulse: Triplet, localPoint: Triplet) {\n const { worker } = physicsStore.get();\n const uuid = NgtcUtils.getUUID(bodyRef, index);\n uuid && worker.applyLocalImpulse({ props: [impulse, localPoint], uuid });\n },\n applyTorque(torque: Triplet) {\n const { worker } = physicsStore.get();\n const uuid = NgtcUtils.getUUID(bodyRef, index);\n uuid && worker.applyTorque({ props: [torque], uuid });\n },\n collisionFilterGroup: makeAtomic('collisionFilterGroup', index),\n collisionFilterMask: makeAtomic('collisionFilterMask', index),\n collisionResponse: makeAtomic('collisionResponse', index),\n fixedRotation: makeAtomic('fixedRotation', index),\n isTrigger: makeAtomic('isTrigger', index),\n linearDamping: makeAtomic('linearDamping', index),\n linearFactor: makeVec('linearFactor', index),\n mass: makeAtomic('mass', index),\n material: makeAtomic('material', index),\n position: makeVec('position', index),\n quaternion: makeQuaternion(index),\n remove: makeRemove(index),\n rotation: makeRotation(index),\n scaleOverride(scale) {\n const { scaleOverrides } = physicsStore.get();\n const uuid = NgtcUtils.getUUID(bodyRef, index);\n if (uuid) scaleOverrides[uuid] = new THREE.Vector3(...scale);\n },\n sleep() {\n const { worker } = physicsStore.get();\n const uuid = NgtcUtils.getUUID(bodyRef, index);\n uuid && worker.sleep({ uuid });\n },\n sleepSpeedLimit: makeAtomic('sleepSpeedLimit', index),\n sleepTimeLimit: makeAtomic('sleepTimeLimit', index),\n userData: makeAtomic('userData', index),\n velocity: makeVec('velocity', index),\n wakeUp() {\n const { worker } = physicsStore.get();\n const uuid = NgtcUtils.getUUID(bodyRef, index);\n uuid && worker.wakeUp({ uuid });\n },\n };\n }\n\n const cache: { [index: number]: NgtcWorkerApi } = {};\n const api = { ...makeApi(undefined), at: (index: number) => cache[index] || (cache[index] = makeApi(index)) };\n return { ref: bodyRef, api };\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;AA4EgB,SAAA,WAAW,CACvB,EAA8B,EAC9B,IAAuE,EAAA;AAEvE,IAAA,OAAO,UAAU,CAAsB,OAAO,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,IAAI,CAAC,CAAC;AACxE,CAAC;AAEe,SAAA,SAAS,CACrB,EAA4B,EAC5B,IAAuE,EAAA;IAEvE,MAAM,cAAc,GAAY,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;AAC1C,IAAA,OAAO,UAAU,CAAoB,KAAK,EAAE,EAAE,EAAE,CAAC,IAAI,GAAG,cAAc,KAAc,IAAI,EAAE,IAAI,CAAC,CAAC;AACpG,CAAC;AAEe,SAAA,cAAc,CAC1B,EAAiC,EACjC,IAAuE,EAAA;AAEvE,IAAA,OAAO,UAAU,CAAyB,UAAU,EAAE,EAAE,EAAE,CAAC,IAAA,GAAO,EAAQ,KAAK,IAAI,EAAE,IAAI,CAAC,CAAC;AAC/F,CAAC;AAEe,SAAA,iBAAiB,CAC7B,EAAoC,EACpC,IAAuE,EAAA;AAEvE,IAAA,OAAO,UAAU,CAA4B,aAAa,EAAE,EAAE,EAAE,CAAC,IAAI,KAAK,IAAI,EAAE,IAAI,CAAC,CAAC;AAC1F,CAAC;AAEe,SAAA,cAAc,C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