angular-three-rapier 2.12.0 → 2.13.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/esm2022/lib/colliders.mjs +2 -1
- package/esm2022/lib/frame-stepper.mjs +3 -2
- package/esm2022/lib/instanced-rigid-bodies.mjs +16 -10
- package/esm2022/lib/mesh-collider.mjs +1 -3
- package/esm2022/lib/physics.mjs +17 -12
- package/esm2022/lib/rigid-body.mjs +32 -23
- package/fesm2022/angular-three-rapier.mjs +65 -44
- package/fesm2022/angular-three-rapier.mjs.map +1 -1
- package/lib/instanced-rigid-bodies.d.ts +2 -1
- package/lib/mesh-collider.d.ts +1 -4
- package/lib/physics.d.ts +2 -3
- package/lib/rigid-body.d.ts +3 -1
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { input, viewChild, Component, CUSTOM_ELEMENTS_SCHEMA, ChangeDetectionStrategy, effect, Directive, contentChild, TemplateRef,
|
|
2
|
+
import { input, viewChild, Component, CUSTOM_ELEMENTS_SCHEMA, ChangeDetectionStrategy, effect, Directive, contentChild, TemplateRef, signal, computed, untracked, inject, DestroyRef, model, output, ElementRef, viewChildren } from '@angular/core';
|
|
3
3
|
import { Vector3 as Vector3$1, Quaternion as Quaternion$1, EventQueue, ColliderDesc, ActiveEvents, RigidBodyDesc } from '@dimforge/rapier3d-compat';
|
|
4
|
-
import { extend, injectBeforeRender, injectStore, pick, vector3, getLocalState, getEmitter, hasListener, resolveRef } from 'angular-three';
|
|
4
|
+
import { extend, injectBeforeRender, injectStore, pick, vector3, applyProps, getLocalState, getEmitter, hasListener, resolveRef } from 'angular-three';
|
|
5
5
|
import { mergeInputs } from 'ngxtension/inject-inputs';
|
|
6
6
|
import { Group, LineSegments, LineBasicMaterial, BufferAttribute, Quaternion, Euler, Vector3, Object3D, Matrix4, MathUtils, DynamicDrawUsage } from 'three';
|
|
7
7
|
import { NgTemplateOutlet } from '@angular/common';
|
|
@@ -61,8 +61,9 @@ class NgtrFrameStepper {
|
|
|
61
61
|
const ready = this.ready();
|
|
62
62
|
if (!ready)
|
|
63
63
|
return;
|
|
64
|
-
const [type,
|
|
64
|
+
const [type, stepFn] = [this.type(), this.stepFn()];
|
|
65
65
|
if (type === 'follow') {
|
|
66
|
+
const updatePriority = this.updatePriority();
|
|
66
67
|
const cleanup = store.snapshot.internal.subscribe(({ delta }) => {
|
|
67
68
|
stepFn(delta);
|
|
68
69
|
}, updatePriority, store);
|
|
@@ -279,7 +280,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.11", ngImpo
|
|
|
279
280
|
class NgtrPhysics {
|
|
280
281
|
options = input(defaultOptions$1, { transform: mergeInputs(defaultOptions$1) });
|
|
281
282
|
content = contentChild.required(TemplateRef);
|
|
282
|
-
fallbackContent = contentChild(NgtrPhysicsFallback);
|
|
283
|
+
fallbackContent = contentChild(NgtrPhysicsFallback, { read: TemplateRef });
|
|
283
284
|
updatePriority = pick(this.options, 'updatePriority');
|
|
284
285
|
updateLoop = pick(this.options, 'updateLoop');
|
|
285
286
|
numSolverIterations = pick(this.options, 'numSolverIterations');
|
|
@@ -296,9 +297,8 @@ class NgtrPhysics {
|
|
|
296
297
|
paused = pick(this.options, 'paused');
|
|
297
298
|
debug = pick(this.options, 'debug');
|
|
298
299
|
colliders = pick(this.options, 'colliders');
|
|
299
|
-
|
|
300
|
+
vGravity = vector3(this.options, 'gravity');
|
|
300
301
|
store = injectStore();
|
|
301
|
-
destroyRef = inject(DestroyRef);
|
|
302
302
|
rapierConstruct = signal(null);
|
|
303
303
|
rapierError = signal(null);
|
|
304
304
|
rapier = this.rapierConstruct.asReadonly();
|
|
@@ -307,7 +307,7 @@ class NgtrPhysics {
|
|
|
307
307
|
const rapier = this.rapier();
|
|
308
308
|
if (!rapier)
|
|
309
309
|
return null;
|
|
310
|
-
return createSingletonProxy(() => new rapier.World(untracked(this.
|
|
310
|
+
return createSingletonProxy(() => new rapier.World(untracked(this.vGravity)));
|
|
311
311
|
});
|
|
312
312
|
rigidBodyStates = new Map();
|
|
313
313
|
colliderStates = new Map();
|
|
@@ -333,7 +333,7 @@ class NgtrPhysics {
|
|
|
333
333
|
effect(() => {
|
|
334
334
|
this.updateWorldEffect();
|
|
335
335
|
});
|
|
336
|
-
|
|
336
|
+
inject(DestroyRef).onDestroy(() => {
|
|
337
337
|
const world = this.worldSingleton();
|
|
338
338
|
if (world) {
|
|
339
339
|
world.proxy.free();
|
|
@@ -350,7 +350,7 @@ class NgtrPhysics {
|
|
|
350
350
|
const world = this.worldSingleton();
|
|
351
351
|
if (!world)
|
|
352
352
|
return;
|
|
353
|
-
world.proxy.gravity = this.
|
|
353
|
+
world.proxy.gravity = this.vGravity();
|
|
354
354
|
world.proxy.integrationParameters.numSolverIterations = this.numSolverIterations();
|
|
355
355
|
world.proxy.integrationParameters.numAdditionalFrictionIterations = this.numAdditionalFrictionIterations();
|
|
356
356
|
world.proxy.integrationParameters.numInternalPgsIterations = this.numInternalPgsIterations();
|
|
@@ -574,7 +574,10 @@ class NgtrPhysics {
|
|
|
574
574
|
};
|
|
575
575
|
}
|
|
576
576
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.11", ngImport: i0, type: NgtrPhysics, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
577
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.11", type: NgtrPhysics, isStandalone: true, selector: "ngtr-physics", inputs: { options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null } }, queries: [{ propertyName: "content", first: true, predicate: TemplateRef, descendants: true, isSignal: true }, { propertyName: "fallbackContent", first: true, predicate: NgtrPhysicsFallback, descendants: true, isSignal: true }], ngImport: i0, template: `
|
|
577
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.11", type: NgtrPhysics, isStandalone: true, selector: "ngtr-physics", inputs: { options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null } }, queries: [{ propertyName: "content", first: true, predicate: TemplateRef, descendants: true, isSignal: true }, { propertyName: "fallbackContent", first: true, predicate: NgtrPhysicsFallback, descendants: true, read: TemplateRef, isSignal: true }], ngImport: i0, template: `
|
|
578
|
+
@let _rapierError = rapierError();
|
|
579
|
+
@let _fallbackContent = fallbackContent();
|
|
580
|
+
|
|
578
581
|
@if (rapierConstruct()) {
|
|
579
582
|
@if (debug()) {
|
|
580
583
|
<ngtr-debug [world]="worldSingleton()?.proxy" />
|
|
@@ -588,8 +591,8 @@ class NgtrPhysics {
|
|
|
588
591
|
/>
|
|
589
592
|
|
|
590
593
|
<ng-container [ngTemplateOutlet]="content()" />
|
|
591
|
-
} @else if (
|
|
592
|
-
<ng-container [ngTemplateOutlet]="
|
|
594
|
+
} @else if (_rapierError && _fallbackContent) {
|
|
595
|
+
<ng-container [ngTemplateOutlet]="_fallbackContent" [ngTemplateOutletContext]="{ error: _rapierError }" />
|
|
593
596
|
}
|
|
594
597
|
`, isInline: true, dependencies: [{ kind: "component", type: NgtrDebug, selector: "ngtr-debug", inputs: ["world"] }, { kind: "directive", type: NgtrFrameStepper, selector: "ngtr-frame-stepper", inputs: ["ready", "updatePriority", "stepFn", "type"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
595
598
|
}
|
|
@@ -599,6 +602,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.11", ngImpo
|
|
|
599
602
|
selector: 'ngtr-physics',
|
|
600
603
|
standalone: true,
|
|
601
604
|
template: `
|
|
605
|
+
@let _rapierError = rapierError();
|
|
606
|
+
@let _fallbackContent = fallbackContent();
|
|
607
|
+
|
|
602
608
|
@if (rapierConstruct()) {
|
|
603
609
|
@if (debug()) {
|
|
604
610
|
<ngtr-debug [world]="worldSingleton()?.proxy" />
|
|
@@ -612,8 +618,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.11", ngImpo
|
|
|
612
618
|
/>
|
|
613
619
|
|
|
614
620
|
<ng-container [ngTemplateOutlet]="content()" />
|
|
615
|
-
} @else if (
|
|
616
|
-
<ng-container [ngTemplateOutlet]="
|
|
621
|
+
} @else if (_rapierError && _fallbackContent) {
|
|
622
|
+
<ng-container [ngTemplateOutlet]="_fallbackContent" [ngTemplateOutletContext]="{ error: _rapierError }" />
|
|
617
623
|
}
|
|
618
624
|
`,
|
|
619
625
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
@@ -632,6 +638,16 @@ class NgtrAnyCollider {
|
|
|
632
638
|
userData = input({});
|
|
633
639
|
name = input();
|
|
634
640
|
options = input(colliderDefaultOptions, { transform: mergeInputs(rigidBodyDefaultOptions) });
|
|
641
|
+
object3DParameters = computed(() => {
|
|
642
|
+
return {
|
|
643
|
+
position: this.position(),
|
|
644
|
+
rotation: this.rotation(),
|
|
645
|
+
scale: this.scale(),
|
|
646
|
+
quaternion: this.quaternion(),
|
|
647
|
+
userData: this.userData(),
|
|
648
|
+
name: this.name(),
|
|
649
|
+
};
|
|
650
|
+
});
|
|
635
651
|
// TODO: change this to input required when Angular allows setting hostDirective input
|
|
636
652
|
shape = model(undefined, { alias: 'ngtrCollider' });
|
|
637
653
|
args = model([]);
|
|
@@ -691,6 +707,10 @@ class NgtrAnyCollider {
|
|
|
691
707
|
});
|
|
692
708
|
constructor() {
|
|
693
709
|
extend({ Object3D });
|
|
710
|
+
effect(() => {
|
|
711
|
+
const object3DParameters = this.object3DParameters();
|
|
712
|
+
applyProps(this.objectRef.nativeElement, object3DParameters);
|
|
713
|
+
});
|
|
694
714
|
effect((onCleanup) => {
|
|
695
715
|
const cleanup = this.createColliderStateEffect();
|
|
696
716
|
onCleanup(() => cleanup?.());
|
|
@@ -871,22 +891,11 @@ class NgtrAnyCollider {
|
|
|
871
891
|
return scaledVerts;
|
|
872
892
|
}
|
|
873
893
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.11", ngImport: i0, type: NgtrAnyCollider, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
874
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "18.2.11", type: NgtrAnyCollider, isStandalone: true, selector: "ngt-object3D[ngtrCollider]", inputs: { position: { classPropertyName: "position", publicName: "position", isSignal: true, isRequired: false, transformFunction: null }, rotation: { classPropertyName: "rotation", publicName: "rotation", isSignal: true, isRequired: false, transformFunction: null }, scale: { classPropertyName: "scale", publicName: "scale", isSignal: true, isRequired: false, transformFunction: null }, quaternion: { classPropertyName: "quaternion", publicName: "quaternion", isSignal: true, isRequired: false, transformFunction: null }, userData: { classPropertyName: "userData", publicName: "userData", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null }, shape: { classPropertyName: "shape", publicName: "ngtrCollider", isSignal: true, isRequired: false, transformFunction: null }, args: { classPropertyName: "args", publicName: "args", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { shape: "ngtrColliderChange", args: "argsChange", collisionEnter: "collisionEnter", collisionExit: "collisionExit", intersectionEnter: "intersectionEnter", intersectionExit: "intersectionExit", contactForce: "contactForce" },
|
|
894
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "18.2.11", type: NgtrAnyCollider, isStandalone: true, selector: "ngt-object3D[ngtrCollider]", inputs: { position: { classPropertyName: "position", publicName: "position", isSignal: true, isRequired: false, transformFunction: null }, rotation: { classPropertyName: "rotation", publicName: "rotation", isSignal: true, isRequired: false, transformFunction: null }, scale: { classPropertyName: "scale", publicName: "scale", isSignal: true, isRequired: false, transformFunction: null }, quaternion: { classPropertyName: "quaternion", publicName: "quaternion", isSignal: true, isRequired: false, transformFunction: null }, userData: { classPropertyName: "userData", publicName: "userData", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null }, shape: { classPropertyName: "shape", publicName: "ngtrCollider", isSignal: true, isRequired: false, transformFunction: null }, args: { classPropertyName: "args", publicName: "args", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { shape: "ngtrColliderChange", args: "argsChange", collisionEnter: "collisionEnter", collisionExit: "collisionExit", intersectionEnter: "intersectionEnter", intersectionExit: "intersectionExit", contactForce: "contactForce" }, ngImport: i0 });
|
|
875
895
|
}
|
|
876
896
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.11", ngImport: i0, type: NgtrAnyCollider, decorators: [{
|
|
877
897
|
type: Directive,
|
|
878
|
-
args: [{
|
|
879
|
-
selector: 'ngt-object3D[ngtrCollider]',
|
|
880
|
-
standalone: true,
|
|
881
|
-
host: {
|
|
882
|
-
'[position]': 'position()',
|
|
883
|
-
'[rotation]': 'rotation()',
|
|
884
|
-
'[scale]': 'scale()',
|
|
885
|
-
'[quaternion]': 'quaternion()',
|
|
886
|
-
'[userData]': 'userData()',
|
|
887
|
-
'[name]': 'name()',
|
|
888
|
-
},
|
|
889
|
-
}]
|
|
898
|
+
args: [{ selector: 'ngt-object3D[ngtrCollider]', standalone: true }]
|
|
890
899
|
}], ctorParameters: () => [] });
|
|
891
900
|
const RIGID_BODY_TYPE_MAP = {
|
|
892
901
|
fixed: 1,
|
|
@@ -919,6 +928,15 @@ class NgtrRigidBody {
|
|
|
919
928
|
quaternion = input([0, 0, 0, 1]);
|
|
920
929
|
userData = input({});
|
|
921
930
|
options = input(rigidBodyDefaultOptions, { transform: mergeInputs(rigidBodyDefaultOptions) });
|
|
931
|
+
object3DParameters = computed(() => {
|
|
932
|
+
return {
|
|
933
|
+
position: this.position(),
|
|
934
|
+
rotation: this.rotation(),
|
|
935
|
+
scale: this.scale(),
|
|
936
|
+
quaternion: this.quaternion(),
|
|
937
|
+
userData: this.userData(),
|
|
938
|
+
};
|
|
939
|
+
});
|
|
922
940
|
wake = output();
|
|
923
941
|
sleep = output();
|
|
924
942
|
collisionEnter = output();
|
|
@@ -979,6 +997,10 @@ class NgtrRigidBody {
|
|
|
979
997
|
});
|
|
980
998
|
constructor() {
|
|
981
999
|
extend({ Object3D });
|
|
1000
|
+
effect(() => {
|
|
1001
|
+
const object3DParameters = this.object3DParameters();
|
|
1002
|
+
applyProps(this.objectRef.nativeElement, object3DParameters);
|
|
1003
|
+
});
|
|
982
1004
|
effect((onCleanup) => {
|
|
983
1005
|
const cleanup = this.createRigidBodyStateEffect();
|
|
984
1006
|
onCleanup(() => cleanup?.());
|
|
@@ -1116,7 +1138,7 @@ class NgtrRigidBody {
|
|
|
1116
1138
|
};
|
|
1117
1139
|
}
|
|
1118
1140
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.11", ngImport: i0, type: NgtrRigidBody, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1119
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.11", type: NgtrRigidBody, isStandalone: true, selector: "ngt-object3D[ngtrRigidBody]", inputs: { type: { classPropertyName: "type", publicName: "ngtrRigidBody", isSignal: true, isRequired: false, transformFunction: null }, position: { classPropertyName: "position", publicName: "position", isSignal: true, isRequired: false, transformFunction: null }, rotation: { classPropertyName: "rotation", publicName: "rotation", isSignal: true, isRequired: false, transformFunction: null }, scale: { classPropertyName: "scale", publicName: "scale", isSignal: true, isRequired: false, transformFunction: null }, quaternion: { classPropertyName: "quaternion", publicName: "quaternion", isSignal: true, isRequired: false, transformFunction: null }, userData: { classPropertyName: "userData", publicName: "userData", isSignal: true, isRequired: false, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { wake: "wake", sleep: "sleep", collisionEnter: "collisionEnter", collisionExit: "collisionExit", intersectionEnter: "intersectionEnter", intersectionExit: "intersectionExit", contactForce: "contactForce" },
|
|
1141
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.11", type: NgtrRigidBody, isStandalone: true, selector: "ngt-object3D[ngtrRigidBody]", inputs: { type: { classPropertyName: "type", publicName: "ngtrRigidBody", isSignal: true, isRequired: false, transformFunction: null }, position: { classPropertyName: "position", publicName: "position", isSignal: true, isRequired: false, transformFunction: null }, rotation: { classPropertyName: "rotation", publicName: "rotation", isSignal: true, isRequired: false, transformFunction: null }, scale: { classPropertyName: "scale", publicName: "scale", isSignal: true, isRequired: false, transformFunction: null }, quaternion: { classPropertyName: "quaternion", publicName: "quaternion", isSignal: true, isRequired: false, transformFunction: null }, userData: { classPropertyName: "userData", publicName: "userData", isSignal: true, isRequired: false, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { wake: "wake", sleep: "sleep", collisionEnter: "collisionEnter", collisionExit: "collisionExit", intersectionEnter: "intersectionEnter", intersectionExit: "intersectionExit", contactForce: "contactForce" }, exportAs: ["rigidBody"], ngImport: i0, template: `
|
|
1120
1142
|
<ng-content />
|
|
1121
1143
|
@for (childColliderOption of childColliderOptions(); track $index) {
|
|
1122
1144
|
<ngt-object3D
|
|
@@ -1153,17 +1175,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.11", ngImpo
|
|
|
1153
1175
|
`,
|
|
1154
1176
|
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
|
1155
1177
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
1156
|
-
host: {
|
|
1157
|
-
'[position]': 'position()',
|
|
1158
|
-
'[rotation]': 'rotation()',
|
|
1159
|
-
'[scale]': 'scale()',
|
|
1160
|
-
'[quaternion]': 'quaternion()',
|
|
1161
|
-
'[userData]': 'userData()',
|
|
1162
|
-
},
|
|
1163
1178
|
imports: [NgtrAnyCollider],
|
|
1164
1179
|
}]
|
|
1165
1180
|
}], ctorParameters: () => [] });
|
|
1166
1181
|
|
|
1182
|
+
// NOTE: this is ok to use here since we're not exporting this short-cut
|
|
1167
1183
|
const ANY_COLLIDER_HOST_DIRECTIVE = {
|
|
1168
1184
|
directive: NgtrAnyCollider,
|
|
1169
1185
|
inputs: ['options', 'name', 'scale', 'position', 'quaternion', 'rotation', 'userData'],
|
|
@@ -1531,6 +1547,15 @@ class NgtrInstancedRigidBodies {
|
|
|
1531
1547
|
},
|
|
1532
1548
|
});
|
|
1533
1549
|
options = input(defaultOptions, { transform: mergeInputs(defaultOptions) });
|
|
1550
|
+
object3DParameters = computed(() => {
|
|
1551
|
+
return {
|
|
1552
|
+
position: this.position(),
|
|
1553
|
+
rotation: this.rotation(),
|
|
1554
|
+
scale: this.scale(),
|
|
1555
|
+
quaternion: this.quaternion(),
|
|
1556
|
+
userData: this.userData(),
|
|
1557
|
+
};
|
|
1558
|
+
});
|
|
1534
1559
|
instanceWrapperRef = viewChild.required('instanceWrapper');
|
|
1535
1560
|
rigidBodyRefs = viewChildren(NgtrRigidBody);
|
|
1536
1561
|
physics = inject(NgtrPhysics);
|
|
@@ -1601,6 +1626,10 @@ class NgtrInstancedRigidBodies {
|
|
|
1601
1626
|
});
|
|
1602
1627
|
constructor() {
|
|
1603
1628
|
extend({ Object3D });
|
|
1629
|
+
effect(() => {
|
|
1630
|
+
const object3DParameters = this.object3DParameters();
|
|
1631
|
+
applyProps(this.objectRef.nativeElement, object3DParameters);
|
|
1632
|
+
});
|
|
1604
1633
|
effect(() => {
|
|
1605
1634
|
const instancedMesh = this.instancedMesh();
|
|
1606
1635
|
if (!instancedMesh)
|
|
@@ -1609,7 +1638,7 @@ class NgtrInstancedRigidBodies {
|
|
|
1609
1638
|
});
|
|
1610
1639
|
}
|
|
1611
1640
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.11", ngImport: i0, type: NgtrInstancedRigidBodies, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1612
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.11", type: NgtrInstancedRigidBodies, isStandalone: true, selector: "ngt-object3D[ngtrInstancedRigidBodies]", inputs: { position: { classPropertyName: "position", publicName: "position", isSignal: true, isRequired: false, transformFunction: null }, rotation: { classPropertyName: "rotation", publicName: "rotation", isSignal: true, isRequired: false, transformFunction: null }, scale: { classPropertyName: "scale", publicName: "scale", isSignal: true, isRequired: false, transformFunction: null }, quaternion: { classPropertyName: "quaternion", publicName: "quaternion", isSignal: true, isRequired: false, transformFunction: null }, userData: { classPropertyName: "userData", publicName: "userData", isSignal: true, isRequired: false, transformFunction: null }, instances: { classPropertyName: "instances", publicName: "ngtrInstancedRigidBodies", isSignal: true, isRequired: false, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null } },
|
|
1641
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.11", type: NgtrInstancedRigidBodies, isStandalone: true, selector: "ngt-object3D[ngtrInstancedRigidBodies]", inputs: { position: { classPropertyName: "position", publicName: "position", isSignal: true, isRequired: false, transformFunction: null }, rotation: { classPropertyName: "rotation", publicName: "rotation", isSignal: true, isRequired: false, transformFunction: null }, scale: { classPropertyName: "scale", publicName: "scale", isSignal: true, isRequired: false, transformFunction: null }, quaternion: { classPropertyName: "quaternion", publicName: "quaternion", isSignal: true, isRequired: false, transformFunction: null }, userData: { classPropertyName: "userData", publicName: "userData", isSignal: true, isRequired: false, transformFunction: null }, instances: { classPropertyName: "instances", publicName: "ngtrInstancedRigidBodies", isSignal: true, isRequired: false, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null } }, viewQueries: [{ propertyName: "instanceWrapperRef", first: true, predicate: ["instanceWrapper"], descendants: true, isSignal: true }, { propertyName: "rigidBodyRefs", predicate: NgtrRigidBody, descendants: true, isSignal: true }], exportAs: ["instancedRigidBodies"], ngImport: i0, template: `
|
|
1613
1642
|
<ngt-object3D #instanceWrapper>
|
|
1614
1643
|
<ng-content />
|
|
1615
1644
|
</ngt-object3D>
|
|
@@ -1682,13 +1711,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.11", ngImpo
|
|
|
1682
1711
|
`,
|
|
1683
1712
|
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
|
1684
1713
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
1685
|
-
host: {
|
|
1686
|
-
'[position]': 'position()',
|
|
1687
|
-
'[rotation]': 'rotation()',
|
|
1688
|
-
'[scale]': 'scale()',
|
|
1689
|
-
'[quaternion]': 'quaternion()',
|
|
1690
|
-
'[userData]': 'userData()',
|
|
1691
|
-
},
|
|
1692
1714
|
imports: [NgtrRigidBody, NgtrAnyCollider],
|
|
1693
1715
|
}]
|
|
1694
1716
|
}], ctorParameters: () => [] });
|
|
@@ -1803,7 +1825,6 @@ class NgtrMeshCollider {
|
|
|
1803
1825
|
colliders = input.required({ alias: 'ngtrMeshCollider' });
|
|
1804
1826
|
objectRef = inject(ElementRef);
|
|
1805
1827
|
rigidBody = inject(NgtrRigidBody);
|
|
1806
|
-
physics = inject(NgtrPhysics);
|
|
1807
1828
|
childColliderOptions = computed(() => {
|
|
1808
1829
|
const rigidBodyOptions = this.rigidBody.options();
|
|
1809
1830
|
rigidBodyOptions.colliders = this.colliders();
|