angular-three-rapier 4.0.0-next.8 → 4.0.0-next.81
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/addons/README.md +3 -0
- package/addons/index.d.ts +1 -0
- package/addons/lib/attractor-debug.d.ts +4 -0
- package/addons/lib/attractor.d.ts +51 -0
- package/fesm2022/angular-three-rapier-addons.mjs +154 -0
- package/fesm2022/angular-three-rapier-addons.mjs.map +1 -0
- package/fesm2022/angular-three-rapier.mjs +293 -126
- package/fesm2022/angular-three-rapier.mjs.map +1 -1
- package/index.d.ts +2 -0
- package/lib/colliders.d.ts +15 -15
- package/lib/debug.d.ts +2 -3
- package/lib/instanced-rigid-bodies.d.ts +6 -4
- package/lib/interaction-groups.d.ts +44 -0
- package/lib/joints.d.ts +6 -6
- package/lib/mesh-collider.d.ts +1 -1
- package/lib/physics-step-callback.d.ts +4 -0
- package/lib/physics.d.ts +3 -3
- package/lib/rigid-body.d.ts +7 -6
- package/package.json +6 -2
|
@@ -1,46 +1,113 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { input, viewChild, Component, CUSTOM_ELEMENTS_SCHEMA, ChangeDetectionStrategy,
|
|
2
|
+
import { InjectionToken, input, computed, inject, effect, Directive, viewChild, Component, CUSTOM_ELEMENTS_SCHEMA, ChangeDetectionStrategy, contentChild, TemplateRef, signal, untracked, DestroyRef, model, output, ElementRef, viewChildren } from '@angular/core';
|
|
3
3
|
import { Vector3, Quaternion, EventQueue, ColliderDesc, ActiveEvents, RigidBodyDesc } from '@dimforge/rapier3d-compat';
|
|
4
4
|
import { extend, injectBeforeRender, injectStore, is, pick, vector3, applyProps, getInstanceState, getEmitter, hasListener, resolveRef } from 'angular-three';
|
|
5
5
|
import { mergeInputs } from 'ngxtension/inject-inputs';
|
|
6
6
|
import * as THREE from 'three';
|
|
7
|
-
import { Group, LineSegments, LineBasicMaterial,
|
|
7
|
+
import { Group, LineSegments, LineBasicMaterial, Object3D } from 'three';
|
|
8
8
|
import { NgTemplateOutlet } from '@angular/common';
|
|
9
9
|
import { mergeVertices } from 'three-stdlib';
|
|
10
10
|
import { assertInjector } from 'ngxtension/assert-injector';
|
|
11
11
|
|
|
12
|
+
/**
|
|
13
|
+
* Calculates an InteractionGroup bitmask for use in the `collisionGroups` or `solverGroups`
|
|
14
|
+
* properties of RigidBody or Collider components. The first argument represents a list of
|
|
15
|
+
* groups the entity is in (expressed as numbers from 0 to 15). The second argument is a list
|
|
16
|
+
* of groups that will be filtered against. When it is omitted, all groups are filtered against.
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* A RigidBody that is member of group 0 and will collide with everything from groups 0 and 1:
|
|
20
|
+
*
|
|
21
|
+
* ```tsx
|
|
22
|
+
* <RigidBody collisionGroups={interactionGroups([0], [0, 1])} />
|
|
23
|
+
* ```
|
|
24
|
+
*
|
|
25
|
+
* A RigidBody that is member of groups 0 and 1 and will collide with everything else:
|
|
26
|
+
*
|
|
27
|
+
* ```tsx
|
|
28
|
+
* <RigidBody collisionGroups={interactionGroups([0, 1])} />
|
|
29
|
+
* ```
|
|
30
|
+
*
|
|
31
|
+
* A RigidBody that is member of groups 0 and 1 and will not collide with anything:
|
|
32
|
+
*
|
|
33
|
+
* ```tsx
|
|
34
|
+
* <RigidBody collisionGroups={interactionGroups([0, 1], [])} />
|
|
35
|
+
* ```
|
|
36
|
+
*
|
|
37
|
+
* Please note that Rapier needs interaction filters to evaluate to true between _both_ colliding
|
|
38
|
+
* entities for collision events to trigger.
|
|
39
|
+
*
|
|
40
|
+
* @param memberships Groups the collider is a member of. (Values can range from 0 to 15.)
|
|
41
|
+
* @param filters Groups the interaction group should filter against. (Values can range from 0 to 15.)
|
|
42
|
+
* @returns An InteractionGroup bitmask.
|
|
43
|
+
*/
|
|
44
|
+
function interactionGroups(memberships, filters) {
|
|
45
|
+
return (bitmask(memberships) << 16) + (filters !== undefined ? bitmask(filters) : 0b1111_1111_1111_1111);
|
|
46
|
+
}
|
|
47
|
+
function bitmask(groups) {
|
|
48
|
+
return [groups].flat().reduce((acc, layer) => acc | (1 << layer), 0);
|
|
49
|
+
}
|
|
50
|
+
const COLLISION_GROUPS_HANDLER = new InjectionToken('COLLISION_GROUPS_HANDLER');
|
|
51
|
+
class NgtrInteractionGroups {
|
|
52
|
+
inputs = input.required({ alias: 'interactionGroups' });
|
|
53
|
+
interactionGroups = computed(() => {
|
|
54
|
+
const [memberships, filters] = this.inputs();
|
|
55
|
+
return interactionGroups(memberships, filters);
|
|
56
|
+
});
|
|
57
|
+
constructor() {
|
|
58
|
+
const collisionGroupsHandlerFn = inject(COLLISION_GROUPS_HANDLER, { host: true, optional: true });
|
|
59
|
+
effect(() => {
|
|
60
|
+
if (!collisionGroupsHandlerFn)
|
|
61
|
+
return;
|
|
62
|
+
const handler = collisionGroupsHandlerFn();
|
|
63
|
+
if (!handler)
|
|
64
|
+
return;
|
|
65
|
+
handler(this.interactionGroups());
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.6", ngImport: i0, type: NgtrInteractionGroups, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
69
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.1.6", type: NgtrInteractionGroups, isStandalone: true, selector: "ngt-object3D[interactionGroups]", inputs: { inputs: { classPropertyName: "inputs", publicName: "interactionGroups", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0 });
|
|
70
|
+
}
|
|
71
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.6", ngImport: i0, type: NgtrInteractionGroups, decorators: [{
|
|
72
|
+
type: Directive,
|
|
73
|
+
args: [{ selector: 'ngt-object3D[interactionGroups]' }]
|
|
74
|
+
}], ctorParameters: () => [] });
|
|
75
|
+
|
|
12
76
|
class NgtrDebug {
|
|
13
|
-
|
|
77
|
+
physics = inject(NgtrPhysics);
|
|
14
78
|
lineSegmentsRef = viewChild.required('lineSegments');
|
|
15
79
|
constructor() {
|
|
16
|
-
extend({ Group, LineSegments, LineBasicMaterial
|
|
80
|
+
extend({ Group, LineSegments, LineBasicMaterial });
|
|
17
81
|
injectBeforeRender(() => {
|
|
18
|
-
const
|
|
19
|
-
if (!
|
|
82
|
+
const worldSingleton = this.physics.worldSingleton();
|
|
83
|
+
if (!worldSingleton)
|
|
20
84
|
return;
|
|
21
|
-
const
|
|
22
|
-
|
|
23
|
-
|
|
85
|
+
const lineSegments = this.lineSegmentsRef().nativeElement;
|
|
86
|
+
if (!lineSegments)
|
|
87
|
+
return;
|
|
88
|
+
const buffers = worldSingleton.proxy.debugRender();
|
|
89
|
+
lineSegments.geometry.setAttribute('position', new THREE.BufferAttribute(buffers.vertices, 3));
|
|
90
|
+
lineSegments.geometry.setAttribute('color', new THREE.BufferAttribute(buffers.colors, 4));
|
|
24
91
|
});
|
|
25
92
|
}
|
|
26
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.
|
|
27
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "19.1.
|
|
93
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.6", ngImport: i0, type: NgtrDebug, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
94
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "19.1.6", type: NgtrDebug, isStandalone: true, selector: "ngtr-debug", viewQueries: [{ propertyName: "lineSegmentsRef", first: true, predicate: ["lineSegments"], descendants: true, isSignal: true }], ngImport: i0, template: `
|
|
28
95
|
<ngt-group>
|
|
29
96
|
<ngt-line-segments #lineSegments [frustumCulled]="false">
|
|
30
|
-
<ngt-line-basic-material color="white"
|
|
97
|
+
<ngt-line-basic-material color="white" vertexColors />
|
|
31
98
|
<ngt-buffer-geometry />
|
|
32
99
|
</ngt-line-segments>
|
|
33
100
|
</ngt-group>
|
|
34
101
|
`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
35
102
|
}
|
|
36
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.
|
|
103
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.6", ngImport: i0, type: NgtrDebug, decorators: [{
|
|
37
104
|
type: Component,
|
|
38
105
|
args: [{
|
|
39
106
|
selector: 'ngtr-debug',
|
|
40
107
|
template: `
|
|
41
108
|
<ngt-group>
|
|
42
109
|
<ngt-line-segments #lineSegments [frustumCulled]="false">
|
|
43
|
-
<ngt-line-basic-material color="white"
|
|
110
|
+
<ngt-line-basic-material color="white" vertexColors />
|
|
44
111
|
<ngt-buffer-geometry />
|
|
45
112
|
</ngt-line-segments>
|
|
46
113
|
</ngt-group>
|
|
@@ -83,10 +150,10 @@ class NgtrFrameStepper {
|
|
|
83
150
|
onCleanup(() => cancelAnimationFrame(raf));
|
|
84
151
|
});
|
|
85
152
|
}
|
|
86
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.
|
|
87
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.1.
|
|
153
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.6", ngImport: i0, type: NgtrFrameStepper, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
154
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.1.6", type: NgtrFrameStepper, isStandalone: true, selector: "ngtr-frame-stepper", inputs: { ready: { classPropertyName: "ready", publicName: "ready", isSignal: true, isRequired: false, transformFunction: null }, updatePriority: { classPropertyName: "updatePriority", publicName: "updatePriority", isSignal: true, isRequired: false, transformFunction: null }, stepFn: { classPropertyName: "stepFn", publicName: "stepFn", isSignal: true, isRequired: true, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0 });
|
|
88
155
|
}
|
|
89
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.
|
|
156
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.6", ngImport: i0, type: NgtrFrameStepper, decorators: [{
|
|
90
157
|
type: Directive,
|
|
91
158
|
args: [{ selector: 'ngtr-frame-stepper' }]
|
|
92
159
|
}], ctorParameters: () => [] });
|
|
@@ -193,7 +260,10 @@ function getColliderArgsFromGeometry(geometry, colliders) {
|
|
|
193
260
|
case 'trimesh': {
|
|
194
261
|
const clonedGeometry = geometry.index ? geometry.clone() : mergeVertices(geometry);
|
|
195
262
|
return {
|
|
196
|
-
args: [
|
|
263
|
+
args: [
|
|
264
|
+
clonedGeometry.attributes['position'].array,
|
|
265
|
+
clonedGeometry.index?.array,
|
|
266
|
+
],
|
|
197
267
|
offset: new THREE.Vector3(),
|
|
198
268
|
};
|
|
199
269
|
}
|
|
@@ -218,7 +288,10 @@ function createColliderOptions(object, options, ignoreMeshColliders = true) {
|
|
|
218
288
|
const worldScale = child.getWorldScale(_scale);
|
|
219
289
|
const shape = autoColliderMap[options.colliders || 'cuboid'];
|
|
220
290
|
child.updateWorldMatrix(true, false);
|
|
221
|
-
_matrix4
|
|
291
|
+
_matrix4
|
|
292
|
+
.copy(child.matrixWorld)
|
|
293
|
+
.premultiply(invertedParentMatrixWorld)
|
|
294
|
+
.decompose(_position, _rotation, _scale);
|
|
222
295
|
const rotationEuler = new THREE.Euler().setFromQuaternion(_rotation, 'XYZ');
|
|
223
296
|
const { args, offset } = getColliderArgsFromGeometry(child.geometry, options.colliders || 'cuboid');
|
|
224
297
|
const { mass, linearDamping, angularDamping, canSleep, ccd, gravityScale, softCcdPrediction, ...rest } = options;
|
|
@@ -267,10 +340,10 @@ class NgtrPhysicsFallback {
|
|
|
267
340
|
static ngTemplateContextGuard(_, ctx) {
|
|
268
341
|
return true;
|
|
269
342
|
}
|
|
270
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.
|
|
271
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.1.
|
|
343
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.6", ngImport: i0, type: NgtrPhysicsFallback, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
344
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.1.6", type: NgtrPhysicsFallback, isStandalone: true, selector: "ng-template[rapierFallback]", ngImport: i0 });
|
|
272
345
|
}
|
|
273
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.
|
|
346
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.6", ngImport: i0, type: NgtrPhysicsFallback, decorators: [{
|
|
274
347
|
type: Directive,
|
|
275
348
|
args: [{ selector: 'ng-template[rapierFallback]' }]
|
|
276
349
|
}] });
|
|
@@ -570,14 +643,14 @@ class NgtrPhysics {
|
|
|
570
643
|
},
|
|
571
644
|
};
|
|
572
645
|
}
|
|
573
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.
|
|
574
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.1.
|
|
646
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.6", ngImport: i0, type: NgtrPhysics, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
647
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.1.6", 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: `
|
|
575
648
|
@let _rapierError = rapierError();
|
|
576
649
|
@let _fallbackContent = fallbackContent();
|
|
577
650
|
|
|
578
651
|
@if (rapierConstruct()) {
|
|
579
652
|
@if (debug()) {
|
|
580
|
-
<ngtr-debug
|
|
653
|
+
<ngtr-debug />
|
|
581
654
|
}
|
|
582
655
|
|
|
583
656
|
<ngtr-frame-stepper
|
|
@@ -591,9 +664,9 @@ class NgtrPhysics {
|
|
|
591
664
|
} @else if (_rapierError && _fallbackContent) {
|
|
592
665
|
<ng-container [ngTemplateOutlet]="_fallbackContent" [ngTemplateOutletContext]="{ error: _rapierError }" />
|
|
593
666
|
}
|
|
594
|
-
`, isInline: true, dependencies: [{ kind: "component", type: NgtrDebug, selector: "ngtr-debug"
|
|
667
|
+
`, isInline: true, dependencies: [{ kind: "component", type: NgtrDebug, selector: "ngtr-debug" }, { 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
668
|
}
|
|
596
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.
|
|
669
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.6", ngImport: i0, type: NgtrPhysics, decorators: [{
|
|
597
670
|
type: Component,
|
|
598
671
|
args: [{
|
|
599
672
|
selector: 'ngtr-physics',
|
|
@@ -603,7 +676,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.4", ngImpor
|
|
|
603
676
|
|
|
604
677
|
@if (rapierConstruct()) {
|
|
605
678
|
@if (debug()) {
|
|
606
|
-
<ngtr-debug
|
|
679
|
+
<ngtr-debug />
|
|
607
680
|
}
|
|
608
681
|
|
|
609
682
|
<ngtr-frame-stepper
|
|
@@ -631,8 +704,8 @@ class NgtrAnyCollider {
|
|
|
631
704
|
rotation = input();
|
|
632
705
|
scale = input([1, 1, 1]);
|
|
633
706
|
quaternion = input();
|
|
634
|
-
userData = input(
|
|
635
|
-
name = input(
|
|
707
|
+
userData = input();
|
|
708
|
+
name = input();
|
|
636
709
|
options = input(colliderDefaultOptions, { transform: mergeInputs(rigidBodyDefaultOptions) });
|
|
637
710
|
object3DParameters = computed(() => {
|
|
638
711
|
const [position, rotation, scale, quaternion, userData, name] = [
|
|
@@ -643,7 +716,7 @@ class NgtrAnyCollider {
|
|
|
643
716
|
this.userData(),
|
|
644
717
|
this.name(),
|
|
645
718
|
];
|
|
646
|
-
const parameters = { position, scale, userData, name };
|
|
719
|
+
const parameters = { position, scale, userData, name: name || `${untracked(this.shape)}-${Date.now()}` };
|
|
647
720
|
if (quaternion) {
|
|
648
721
|
Object.assign(parameters, { quaternion });
|
|
649
722
|
}
|
|
@@ -657,6 +730,7 @@ class NgtrAnyCollider {
|
|
|
657
730
|
});
|
|
658
731
|
// TODO: change this to input required when Angular allows setting hostDirective input
|
|
659
732
|
shape = model(undefined, { alias: 'collider' });
|
|
733
|
+
// NOTE: this will be typed by individual collider
|
|
660
734
|
args = model([]);
|
|
661
735
|
collisionEnter = output();
|
|
662
736
|
collisionExit = output();
|
|
@@ -684,6 +758,8 @@ class NgtrAnyCollider {
|
|
|
684
758
|
this.args(),
|
|
685
759
|
];
|
|
686
760
|
const cloned = args.slice();
|
|
761
|
+
if (cloned.length === 0)
|
|
762
|
+
return [];
|
|
687
763
|
// Heightfield uses a vector
|
|
688
764
|
if (shape === 'heightfield') {
|
|
689
765
|
const s = cloned[3];
|
|
@@ -698,14 +774,23 @@ class NgtrAnyCollider {
|
|
|
698
774
|
return cloned;
|
|
699
775
|
}
|
|
700
776
|
// prefill with some extra
|
|
701
|
-
const scaleArray = [
|
|
777
|
+
const scaleArray = [
|
|
778
|
+
this.worldScale.x,
|
|
779
|
+
this.worldScale.y,
|
|
780
|
+
this.worldScale.z,
|
|
781
|
+
this.worldScale.x,
|
|
782
|
+
this.worldScale.x,
|
|
783
|
+
];
|
|
702
784
|
return cloned.map((arg, index) => scaleArray[index] * arg);
|
|
703
785
|
});
|
|
704
786
|
collider = computed(() => {
|
|
705
787
|
const worldSingleton = this.physics.worldSingleton();
|
|
706
788
|
if (!worldSingleton)
|
|
707
789
|
return null;
|
|
708
|
-
const
|
|
790
|
+
const args = this.scaledArgs();
|
|
791
|
+
if (!args.length)
|
|
792
|
+
return null;
|
|
793
|
+
const [shape, rigidBody] = [this.shape(), this.rigidBody?.rigidBody()];
|
|
709
794
|
// @ts-expect-error - we know the type of the data
|
|
710
795
|
const desc = ColliderDesc[shape](...args);
|
|
711
796
|
if (!desc)
|
|
@@ -897,10 +982,10 @@ class NgtrAnyCollider {
|
|
|
897
982
|
}
|
|
898
983
|
return scaledVerts;
|
|
899
984
|
}
|
|
900
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.
|
|
901
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.1.
|
|
985
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.6", ngImport: i0, type: NgtrAnyCollider, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
986
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.1.6", type: NgtrAnyCollider, isStandalone: true, selector: "ngt-object3D[collider]", 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: "collider", isSignal: true, isRequired: false, transformFunction: null }, args: { classPropertyName: "args", publicName: "args", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { shape: "colliderChange", args: "argsChange", collisionEnter: "collisionEnter", collisionExit: "collisionExit", intersectionEnter: "intersectionEnter", intersectionExit: "intersectionExit", contactForce: "contactForce" }, ngImport: i0 });
|
|
902
987
|
}
|
|
903
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.
|
|
988
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.6", ngImport: i0, type: NgtrAnyCollider, decorators: [{
|
|
904
989
|
type: Directive,
|
|
905
990
|
args: [{ selector: 'ngt-object3D[collider]' }]
|
|
906
991
|
}], ctorParameters: () => [] });
|
|
@@ -921,7 +1006,7 @@ const rigidBodyDefaultOptions = {
|
|
|
921
1006
|
contactSkin: 0,
|
|
922
1007
|
};
|
|
923
1008
|
class NgtrRigidBody {
|
|
924
|
-
type = input(
|
|
1009
|
+
type = input.required({
|
|
925
1010
|
alias: 'rigidBody',
|
|
926
1011
|
transform: (value) => {
|
|
927
1012
|
if (value === '' || value === undefined)
|
|
@@ -930,11 +1015,12 @@ class NgtrRigidBody {
|
|
|
930
1015
|
},
|
|
931
1016
|
});
|
|
932
1017
|
position = input([0, 0, 0]);
|
|
933
|
-
rotation = input(
|
|
1018
|
+
rotation = input();
|
|
934
1019
|
scale = input([1, 1, 1]);
|
|
935
|
-
quaternion = input(
|
|
936
|
-
userData = input(
|
|
1020
|
+
quaternion = input();
|
|
1021
|
+
userData = input();
|
|
937
1022
|
options = input(rigidBodyDefaultOptions, { transform: mergeInputs(rigidBodyDefaultOptions) });
|
|
1023
|
+
anyColliders = viewChildren(NgtrAnyCollider);
|
|
938
1024
|
object3DParameters = computed(() => {
|
|
939
1025
|
const [position, rotation, scale, quaternion, userData] = [
|
|
940
1026
|
this.position(),
|
|
@@ -1007,8 +1093,12 @@ class NgtrRigidBody {
|
|
|
1007
1093
|
const objectInstanceState = getInstanceState(this.objectRef.nativeElement);
|
|
1008
1094
|
if (!objectInstanceState)
|
|
1009
1095
|
return [];
|
|
1010
|
-
// track object's parent and
|
|
1011
|
-
const [parent] = [
|
|
1096
|
+
// track object's parent and children
|
|
1097
|
+
const [parent] = [
|
|
1098
|
+
objectInstanceState.parent(),
|
|
1099
|
+
objectInstanceState.nonObjects(),
|
|
1100
|
+
objectInstanceState.objects(),
|
|
1101
|
+
];
|
|
1012
1102
|
if (!parent || !is.three(parent, 'isObject3D'))
|
|
1013
1103
|
return [];
|
|
1014
1104
|
return createColliderOptions(this.objectRef.nativeElement, options, true);
|
|
@@ -1155,8 +1245,29 @@ class NgtrRigidBody {
|
|
|
1155
1245
|
meshType,
|
|
1156
1246
|
};
|
|
1157
1247
|
}
|
|
1158
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.
|
|
1159
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.1.
|
|
1248
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.6", ngImport: i0, type: NgtrRigidBody, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1249
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.1.6", type: NgtrRigidBody, isStandalone: true, selector: "ngt-object3D[rigidBody]", inputs: { type: { classPropertyName: "type", publicName: "rigidBody", isSignal: true, isRequired: true, 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" }, providers: [
|
|
1250
|
+
{
|
|
1251
|
+
provide: COLLISION_GROUPS_HANDLER,
|
|
1252
|
+
useFactory: (rigidBody) => {
|
|
1253
|
+
return () => {
|
|
1254
|
+
const anyColliders = rigidBody.anyColliders();
|
|
1255
|
+
if (!anyColliders.length)
|
|
1256
|
+
return;
|
|
1257
|
+
const colliders = anyColliders.map((anyCollider) => anyCollider['collider']);
|
|
1258
|
+
return (interactionGroups) => {
|
|
1259
|
+
for (const colliderFn of colliders) {
|
|
1260
|
+
const collider = colliderFn();
|
|
1261
|
+
if (!collider)
|
|
1262
|
+
continue;
|
|
1263
|
+
collider.setCollisionGroups(interactionGroups);
|
|
1264
|
+
}
|
|
1265
|
+
};
|
|
1266
|
+
};
|
|
1267
|
+
},
|
|
1268
|
+
deps: [NgtrRigidBody],
|
|
1269
|
+
},
|
|
1270
|
+
], viewQueries: [{ propertyName: "anyColliders", predicate: NgtrAnyCollider, descendants: true, isSignal: true }], exportAs: ["rigidBody"], ngImport: i0, template: `
|
|
1160
1271
|
<ng-content />
|
|
1161
1272
|
@for (childColliderOption of childColliderOptions(); track $index) {
|
|
1162
1273
|
<ngt-object3D
|
|
@@ -1171,7 +1282,7 @@ class NgtrRigidBody {
|
|
|
1171
1282
|
}
|
|
1172
1283
|
`, isInline: true, dependencies: [{ kind: "directive", type: NgtrAnyCollider, selector: "ngt-object3D[collider]", inputs: ["position", "rotation", "scale", "quaternion", "userData", "name", "options", "collider", "args"], outputs: ["colliderChange", "argsChange", "collisionEnter", "collisionExit", "intersectionEnter", "intersectionExit", "contactForce"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1173
1284
|
}
|
|
1174
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.
|
|
1285
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.6", ngImport: i0, type: NgtrRigidBody, decorators: [{
|
|
1175
1286
|
type: Component,
|
|
1176
1287
|
args: [{
|
|
1177
1288
|
selector: 'ngt-object3D[rigidBody]',
|
|
@@ -1193,6 +1304,28 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.4", ngImpor
|
|
|
1193
1304
|
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
|
1194
1305
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
1195
1306
|
imports: [NgtrAnyCollider],
|
|
1307
|
+
providers: [
|
|
1308
|
+
{
|
|
1309
|
+
provide: COLLISION_GROUPS_HANDLER,
|
|
1310
|
+
useFactory: (rigidBody) => {
|
|
1311
|
+
return () => {
|
|
1312
|
+
const anyColliders = rigidBody.anyColliders();
|
|
1313
|
+
if (!anyColliders.length)
|
|
1314
|
+
return;
|
|
1315
|
+
const colliders = anyColliders.map((anyCollider) => anyCollider['collider']);
|
|
1316
|
+
return (interactionGroups) => {
|
|
1317
|
+
for (const colliderFn of colliders) {
|
|
1318
|
+
const collider = colliderFn();
|
|
1319
|
+
if (!collider)
|
|
1320
|
+
continue;
|
|
1321
|
+
collider.setCollisionGroups(interactionGroups);
|
|
1322
|
+
}
|
|
1323
|
+
};
|
|
1324
|
+
};
|
|
1325
|
+
},
|
|
1326
|
+
deps: [NgtrRigidBody],
|
|
1327
|
+
},
|
|
1328
|
+
],
|
|
1196
1329
|
}]
|
|
1197
1330
|
}], ctorParameters: () => [] });
|
|
1198
1331
|
|
|
@@ -1203,7 +1336,7 @@ const ANY_COLLIDER_HOST_DIRECTIVE = {
|
|
|
1203
1336
|
outputs: ['collisionEnter', 'collisionExit', 'intersectionEnter', 'intersectionExit', 'contactForce'],
|
|
1204
1337
|
};
|
|
1205
1338
|
class NgtrCuboidCollider {
|
|
1206
|
-
args = input.required();
|
|
1339
|
+
args = input.required({ alias: 'cuboidCollider' });
|
|
1207
1340
|
constructor() {
|
|
1208
1341
|
const anyCollider = inject(NgtrAnyCollider, { host: true });
|
|
1209
1342
|
anyCollider.setShape('cuboid');
|
|
@@ -1211,15 +1344,15 @@ class NgtrCuboidCollider {
|
|
|
1211
1344
|
anyCollider.setArgs(this.args());
|
|
1212
1345
|
});
|
|
1213
1346
|
}
|
|
1214
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.
|
|
1215
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.1.
|
|
1347
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.6", ngImport: i0, type: NgtrCuboidCollider, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
1348
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.1.6", type: NgtrCuboidCollider, isStandalone: true, selector: "ngt-object3D[cuboidCollider]", inputs: { args: { classPropertyName: "args", publicName: "cuboidCollider", isSignal: true, isRequired: true, transformFunction: null } }, hostDirectives: [{ directive: NgtrAnyCollider, inputs: ["options", "options", "name", "name", "scale", "scale", "position", "position", "quaternion", "quaternion", "rotation", "rotation", "userData", "userData"], outputs: ["collisionEnter", "collisionEnter", "collisionExit", "collisionExit", "intersectionEnter", "intersectionEnter", "intersectionExit", "intersectionExit", "contactForce", "contactForce"] }], ngImport: i0 });
|
|
1216
1349
|
}
|
|
1217
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.
|
|
1350
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.6", ngImport: i0, type: NgtrCuboidCollider, decorators: [{
|
|
1218
1351
|
type: Directive,
|
|
1219
1352
|
args: [{ selector: 'ngt-object3D[cuboidCollider]', hostDirectives: [ANY_COLLIDER_HOST_DIRECTIVE] }]
|
|
1220
1353
|
}], ctorParameters: () => [] });
|
|
1221
1354
|
class NgtrCapsuleCollider {
|
|
1222
|
-
args = input.required();
|
|
1355
|
+
args = input.required({ alias: 'capsuleCollider' });
|
|
1223
1356
|
constructor() {
|
|
1224
1357
|
const anyCollider = inject(NgtrAnyCollider, { host: true });
|
|
1225
1358
|
anyCollider.setShape('capsule');
|
|
@@ -1227,15 +1360,15 @@ class NgtrCapsuleCollider {
|
|
|
1227
1360
|
anyCollider.setArgs(this.args());
|
|
1228
1361
|
});
|
|
1229
1362
|
}
|
|
1230
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.
|
|
1231
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.1.
|
|
1363
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.6", ngImport: i0, type: NgtrCapsuleCollider, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
1364
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.1.6", type: NgtrCapsuleCollider, isStandalone: true, selector: "ngt-object3D[capsuleCollider]", inputs: { args: { classPropertyName: "args", publicName: "capsuleCollider", isSignal: true, isRequired: true, transformFunction: null } }, hostDirectives: [{ directive: NgtrAnyCollider, inputs: ["options", "options", "name", "name", "scale", "scale", "position", "position", "quaternion", "quaternion", "rotation", "rotation", "userData", "userData"], outputs: ["collisionEnter", "collisionEnter", "collisionExit", "collisionExit", "intersectionEnter", "intersectionEnter", "intersectionExit", "intersectionExit", "contactForce", "contactForce"] }], ngImport: i0 });
|
|
1232
1365
|
}
|
|
1233
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.
|
|
1366
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.6", ngImport: i0, type: NgtrCapsuleCollider, decorators: [{
|
|
1234
1367
|
type: Directive,
|
|
1235
1368
|
args: [{ selector: 'ngt-object3D[capsuleCollider]', hostDirectives: [ANY_COLLIDER_HOST_DIRECTIVE] }]
|
|
1236
1369
|
}], ctorParameters: () => [] });
|
|
1237
1370
|
class NgtrBallCollider {
|
|
1238
|
-
args = input.required();
|
|
1371
|
+
args = input.required({ alias: 'ballCollider' });
|
|
1239
1372
|
constructor() {
|
|
1240
1373
|
const anyCollider = inject(NgtrAnyCollider, { host: true });
|
|
1241
1374
|
anyCollider.setShape('ball');
|
|
@@ -1243,31 +1376,31 @@ class NgtrBallCollider {
|
|
|
1243
1376
|
anyCollider.setArgs(this.args());
|
|
1244
1377
|
});
|
|
1245
1378
|
}
|
|
1246
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.
|
|
1247
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.1.
|
|
1379
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.6", ngImport: i0, type: NgtrBallCollider, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
1380
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.1.6", type: NgtrBallCollider, isStandalone: true, selector: "ngt-object3D[ballCollider]", inputs: { args: { classPropertyName: "args", publicName: "ballCollider", isSignal: true, isRequired: true, transformFunction: null } }, hostDirectives: [{ directive: NgtrAnyCollider, inputs: ["options", "options", "name", "name", "scale", "scale", "position", "position", "quaternion", "quaternion", "rotation", "rotation", "userData", "userData"], outputs: ["collisionEnter", "collisionEnter", "collisionExit", "collisionExit", "intersectionEnter", "intersectionEnter", "intersectionExit", "intersectionExit", "contactForce", "contactForce"] }], ngImport: i0 });
|
|
1248
1381
|
}
|
|
1249
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.
|
|
1382
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.6", ngImport: i0, type: NgtrBallCollider, decorators: [{
|
|
1250
1383
|
type: Directive,
|
|
1251
1384
|
args: [{ selector: 'ngt-object3D[ballCollider]', hostDirectives: [ANY_COLLIDER_HOST_DIRECTIVE] }]
|
|
1252
1385
|
}], ctorParameters: () => [] });
|
|
1253
1386
|
class NgtrConvexHullCollider {
|
|
1254
|
-
args = input.required();
|
|
1387
|
+
args = input.required({ alias: 'convexHullCollider' });
|
|
1255
1388
|
constructor() {
|
|
1256
1389
|
const anyCollider = inject(NgtrAnyCollider, { host: true });
|
|
1257
|
-
anyCollider.setShape('
|
|
1390
|
+
anyCollider.setShape('convexHull');
|
|
1258
1391
|
effect(() => {
|
|
1259
1392
|
anyCollider.setArgs(this.args());
|
|
1260
1393
|
});
|
|
1261
1394
|
}
|
|
1262
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.
|
|
1263
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.1.
|
|
1395
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.6", ngImport: i0, type: NgtrConvexHullCollider, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
1396
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.1.6", type: NgtrConvexHullCollider, isStandalone: true, selector: "ngt-object3D[convexHullCollider]", inputs: { args: { classPropertyName: "args", publicName: "convexHullCollider", isSignal: true, isRequired: true, transformFunction: null } }, hostDirectives: [{ directive: NgtrAnyCollider, inputs: ["options", "options", "name", "name", "scale", "scale", "position", "position", "quaternion", "quaternion", "rotation", "rotation", "userData", "userData"], outputs: ["collisionEnter", "collisionEnter", "collisionExit", "collisionExit", "intersectionEnter", "intersectionEnter", "intersectionExit", "intersectionExit", "contactForce", "contactForce"] }], ngImport: i0 });
|
|
1264
1397
|
}
|
|
1265
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.
|
|
1398
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.6", ngImport: i0, type: NgtrConvexHullCollider, decorators: [{
|
|
1266
1399
|
type: Directive,
|
|
1267
1400
|
args: [{ selector: 'ngt-object3D[convexHullCollider]', hostDirectives: [ANY_COLLIDER_HOST_DIRECTIVE] }]
|
|
1268
1401
|
}], ctorParameters: () => [] });
|
|
1269
1402
|
class NgtrHeightfieldCollider {
|
|
1270
|
-
args = input.required();
|
|
1403
|
+
args = input.required({ alias: 'heightfieldCollider' });
|
|
1271
1404
|
constructor() {
|
|
1272
1405
|
const anyCollider = inject(NgtrAnyCollider, { host: true });
|
|
1273
1406
|
anyCollider.setShape('heightfield');
|
|
@@ -1275,15 +1408,15 @@ class NgtrHeightfieldCollider {
|
|
|
1275
1408
|
anyCollider.setArgs(this.args());
|
|
1276
1409
|
});
|
|
1277
1410
|
}
|
|
1278
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.
|
|
1279
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.1.
|
|
1411
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.6", ngImport: i0, type: NgtrHeightfieldCollider, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
1412
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.1.6", type: NgtrHeightfieldCollider, isStandalone: true, selector: "ngt-object3D[heightfieldCollider]", inputs: { args: { classPropertyName: "args", publicName: "heightfieldCollider", isSignal: true, isRequired: true, transformFunction: null } }, hostDirectives: [{ directive: NgtrAnyCollider, inputs: ["options", "options", "name", "name", "scale", "scale", "position", "position", "quaternion", "quaternion", "rotation", "rotation", "userData", "userData"], outputs: ["collisionEnter", "collisionEnter", "collisionExit", "collisionExit", "intersectionEnter", "intersectionEnter", "intersectionExit", "intersectionExit", "contactForce", "contactForce"] }], ngImport: i0 });
|
|
1280
1413
|
}
|
|
1281
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.
|
|
1414
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.6", ngImport: i0, type: NgtrHeightfieldCollider, decorators: [{
|
|
1282
1415
|
type: Directive,
|
|
1283
1416
|
args: [{ selector: 'ngt-object3D[heightfieldCollider]', hostDirectives: [ANY_COLLIDER_HOST_DIRECTIVE] }]
|
|
1284
1417
|
}], ctorParameters: () => [] });
|
|
1285
1418
|
class NgtrTrimeshCollider {
|
|
1286
|
-
args = input.required();
|
|
1419
|
+
args = input.required({ alias: 'trimeshCollider' });
|
|
1287
1420
|
constructor() {
|
|
1288
1421
|
const anyCollider = inject(NgtrAnyCollider, { host: true });
|
|
1289
1422
|
anyCollider.setShape('trimesh');
|
|
@@ -1291,15 +1424,15 @@ class NgtrTrimeshCollider {
|
|
|
1291
1424
|
anyCollider.setArgs(this.args());
|
|
1292
1425
|
});
|
|
1293
1426
|
}
|
|
1294
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.
|
|
1295
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.1.
|
|
1427
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.6", ngImport: i0, type: NgtrTrimeshCollider, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
1428
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.1.6", type: NgtrTrimeshCollider, isStandalone: true, selector: "ngt-object3D[trimeshCollider]", inputs: { args: { classPropertyName: "args", publicName: "trimeshCollider", isSignal: true, isRequired: true, transformFunction: null } }, hostDirectives: [{ directive: NgtrAnyCollider, inputs: ["options", "options", "name", "name", "scale", "scale", "position", "position", "quaternion", "quaternion", "rotation", "rotation", "userData", "userData"], outputs: ["collisionEnter", "collisionEnter", "collisionExit", "collisionExit", "intersectionEnter", "intersectionEnter", "intersectionExit", "intersectionExit", "contactForce", "contactForce"] }], ngImport: i0 });
|
|
1296
1429
|
}
|
|
1297
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.
|
|
1430
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.6", ngImport: i0, type: NgtrTrimeshCollider, decorators: [{
|
|
1298
1431
|
type: Directive,
|
|
1299
1432
|
args: [{ selector: 'ngt-object3D[trimeshCollider]', hostDirectives: [ANY_COLLIDER_HOST_DIRECTIVE] }]
|
|
1300
1433
|
}], ctorParameters: () => [] });
|
|
1301
1434
|
class NgtrPolylineCollider {
|
|
1302
|
-
args = input.required();
|
|
1435
|
+
args = input.required({ alias: 'polylineCollider' });
|
|
1303
1436
|
constructor() {
|
|
1304
1437
|
const anyCollider = inject(NgtrAnyCollider, { host: true });
|
|
1305
1438
|
anyCollider.setShape('polyline');
|
|
@@ -1307,15 +1440,15 @@ class NgtrPolylineCollider {
|
|
|
1307
1440
|
anyCollider.setArgs(this.args());
|
|
1308
1441
|
});
|
|
1309
1442
|
}
|
|
1310
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.
|
|
1311
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.1.
|
|
1443
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.6", ngImport: i0, type: NgtrPolylineCollider, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
1444
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.1.6", type: NgtrPolylineCollider, isStandalone: true, selector: "ngt-object3D[polylineCollider]", inputs: { args: { classPropertyName: "args", publicName: "polylineCollider", isSignal: true, isRequired: true, transformFunction: null } }, hostDirectives: [{ directive: NgtrAnyCollider, inputs: ["options", "options", "name", "name", "scale", "scale", "position", "position", "quaternion", "quaternion", "rotation", "rotation", "userData", "userData"], outputs: ["collisionEnter", "collisionEnter", "collisionExit", "collisionExit", "intersectionEnter", "intersectionEnter", "intersectionExit", "intersectionExit", "contactForce", "contactForce"] }], ngImport: i0 });
|
|
1312
1445
|
}
|
|
1313
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.
|
|
1446
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.6", ngImport: i0, type: NgtrPolylineCollider, decorators: [{
|
|
1314
1447
|
type: Directive,
|
|
1315
1448
|
args: [{ selector: 'ngt-object3D[polylineCollider]', hostDirectives: [ANY_COLLIDER_HOST_DIRECTIVE] }]
|
|
1316
1449
|
}], ctorParameters: () => [] });
|
|
1317
1450
|
class NgtrRoundCuboidCollider {
|
|
1318
|
-
args = input.required();
|
|
1451
|
+
args = input.required({ alias: 'roundCuboidCollider' });
|
|
1319
1452
|
constructor() {
|
|
1320
1453
|
const anyCollider = inject(NgtrAnyCollider, { host: true });
|
|
1321
1454
|
anyCollider.setShape('roundCuboid');
|
|
@@ -1323,15 +1456,15 @@ class NgtrRoundCuboidCollider {
|
|
|
1323
1456
|
anyCollider.setArgs(this.args());
|
|
1324
1457
|
});
|
|
1325
1458
|
}
|
|
1326
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.
|
|
1327
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.1.
|
|
1459
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.6", ngImport: i0, type: NgtrRoundCuboidCollider, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
1460
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.1.6", type: NgtrRoundCuboidCollider, isStandalone: true, selector: "ngt-object3D[roundCuboidCollider]", inputs: { args: { classPropertyName: "args", publicName: "roundCuboidCollider", isSignal: true, isRequired: true, transformFunction: null } }, hostDirectives: [{ directive: NgtrAnyCollider, inputs: ["options", "options", "name", "name", "scale", "scale", "position", "position", "quaternion", "quaternion", "rotation", "rotation", "userData", "userData"], outputs: ["collisionEnter", "collisionEnter", "collisionExit", "collisionExit", "intersectionEnter", "intersectionEnter", "intersectionExit", "intersectionExit", "contactForce", "contactForce"] }], ngImport: i0 });
|
|
1328
1461
|
}
|
|
1329
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.
|
|
1462
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.6", ngImport: i0, type: NgtrRoundCuboidCollider, decorators: [{
|
|
1330
1463
|
type: Directive,
|
|
1331
1464
|
args: [{ selector: 'ngt-object3D[roundCuboidCollider]', hostDirectives: [ANY_COLLIDER_HOST_DIRECTIVE] }]
|
|
1332
1465
|
}], ctorParameters: () => [] });
|
|
1333
1466
|
class NgtrCylinderCollider {
|
|
1334
|
-
args = input.required();
|
|
1467
|
+
args = input.required({ alias: 'cylinderCollider' });
|
|
1335
1468
|
constructor() {
|
|
1336
1469
|
const anyCollider = inject(NgtrAnyCollider, { host: true });
|
|
1337
1470
|
anyCollider.setShape('cylinder');
|
|
@@ -1339,15 +1472,15 @@ class NgtrCylinderCollider {
|
|
|
1339
1472
|
anyCollider.setArgs(this.args());
|
|
1340
1473
|
});
|
|
1341
1474
|
}
|
|
1342
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.
|
|
1343
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.1.
|
|
1475
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.6", ngImport: i0, type: NgtrCylinderCollider, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
1476
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.1.6", type: NgtrCylinderCollider, isStandalone: true, selector: "ngt-object3D[cylinderCollider]", inputs: { args: { classPropertyName: "args", publicName: "cylinderCollider", isSignal: true, isRequired: true, transformFunction: null } }, hostDirectives: [{ directive: NgtrAnyCollider, inputs: ["options", "options", "name", "name", "scale", "scale", "position", "position", "quaternion", "quaternion", "rotation", "rotation", "userData", "userData"], outputs: ["collisionEnter", "collisionEnter", "collisionExit", "collisionExit", "intersectionEnter", "intersectionEnter", "intersectionExit", "intersectionExit", "contactForce", "contactForce"] }], ngImport: i0 });
|
|
1344
1477
|
}
|
|
1345
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.
|
|
1478
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.6", ngImport: i0, type: NgtrCylinderCollider, decorators: [{
|
|
1346
1479
|
type: Directive,
|
|
1347
1480
|
args: [{ selector: 'ngt-object3D[cylinderCollider]', hostDirectives: [ANY_COLLIDER_HOST_DIRECTIVE] }]
|
|
1348
1481
|
}], ctorParameters: () => [] });
|
|
1349
1482
|
class NgtrRoundCylinderCollider {
|
|
1350
|
-
args = input.required();
|
|
1483
|
+
args = input.required({ alias: 'roundCylinderCollider' });
|
|
1351
1484
|
constructor() {
|
|
1352
1485
|
const anyCollider = inject(NgtrAnyCollider, { host: true });
|
|
1353
1486
|
anyCollider.setShape('roundCylinder');
|
|
@@ -1355,15 +1488,15 @@ class NgtrRoundCylinderCollider {
|
|
|
1355
1488
|
anyCollider.setArgs(this.args());
|
|
1356
1489
|
});
|
|
1357
1490
|
}
|
|
1358
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.
|
|
1359
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.1.
|
|
1491
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.6", ngImport: i0, type: NgtrRoundCylinderCollider, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
1492
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.1.6", type: NgtrRoundCylinderCollider, isStandalone: true, selector: "ngt-object3D[roundCylinderCollider]", inputs: { args: { classPropertyName: "args", publicName: "roundCylinderCollider", isSignal: true, isRequired: true, transformFunction: null } }, hostDirectives: [{ directive: NgtrAnyCollider, inputs: ["options", "options", "name", "name", "scale", "scale", "position", "position", "quaternion", "quaternion", "rotation", "rotation", "userData", "userData"], outputs: ["collisionEnter", "collisionEnter", "collisionExit", "collisionExit", "intersectionEnter", "intersectionEnter", "intersectionExit", "intersectionExit", "contactForce", "contactForce"] }], ngImport: i0 });
|
|
1360
1493
|
}
|
|
1361
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.
|
|
1494
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.6", ngImport: i0, type: NgtrRoundCylinderCollider, decorators: [{
|
|
1362
1495
|
type: Directive,
|
|
1363
1496
|
args: [{ selector: 'ngt-object3D[roundCylinderCollider]', hostDirectives: [ANY_COLLIDER_HOST_DIRECTIVE] }]
|
|
1364
1497
|
}], ctorParameters: () => [] });
|
|
1365
1498
|
class NgtrConeCollider {
|
|
1366
|
-
args = input.required();
|
|
1499
|
+
args = input.required({ alias: 'coneCollider' });
|
|
1367
1500
|
constructor() {
|
|
1368
1501
|
const anyCollider = inject(NgtrAnyCollider, { host: true });
|
|
1369
1502
|
anyCollider.setShape('cone');
|
|
@@ -1371,15 +1504,15 @@ class NgtrConeCollider {
|
|
|
1371
1504
|
anyCollider.setArgs(this.args());
|
|
1372
1505
|
});
|
|
1373
1506
|
}
|
|
1374
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.
|
|
1375
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.1.
|
|
1507
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.6", ngImport: i0, type: NgtrConeCollider, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
1508
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.1.6", type: NgtrConeCollider, isStandalone: true, selector: "ngt-object3D[coneCollider]", inputs: { args: { classPropertyName: "args", publicName: "coneCollider", isSignal: true, isRequired: true, transformFunction: null } }, hostDirectives: [{ directive: NgtrAnyCollider, inputs: ["options", "options", "name", "name", "scale", "scale", "position", "position", "quaternion", "quaternion", "rotation", "rotation", "userData", "userData"], outputs: ["collisionEnter", "collisionEnter", "collisionExit", "collisionExit", "intersectionEnter", "intersectionEnter", "intersectionExit", "intersectionExit", "contactForce", "contactForce"] }], ngImport: i0 });
|
|
1376
1509
|
}
|
|
1377
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.
|
|
1510
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.6", ngImport: i0, type: NgtrConeCollider, decorators: [{
|
|
1378
1511
|
type: Directive,
|
|
1379
1512
|
args: [{ selector: 'ngt-object3D[coneCollider]', hostDirectives: [ANY_COLLIDER_HOST_DIRECTIVE] }]
|
|
1380
1513
|
}], ctorParameters: () => [] });
|
|
1381
1514
|
class NgtrRoundConeCollider {
|
|
1382
|
-
args = input.required();
|
|
1515
|
+
args = input.required({ alias: 'roundConeCollider' });
|
|
1383
1516
|
constructor() {
|
|
1384
1517
|
const anyCollider = inject(NgtrAnyCollider, { host: true });
|
|
1385
1518
|
anyCollider.setShape('roundCone');
|
|
@@ -1387,15 +1520,15 @@ class NgtrRoundConeCollider {
|
|
|
1387
1520
|
anyCollider.setArgs(this.args());
|
|
1388
1521
|
});
|
|
1389
1522
|
}
|
|
1390
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.
|
|
1391
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.1.
|
|
1523
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.6", ngImport: i0, type: NgtrRoundConeCollider, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
1524
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.1.6", type: NgtrRoundConeCollider, isStandalone: true, selector: "ngt-object3D[roundConeCollider]", inputs: { args: { classPropertyName: "args", publicName: "roundConeCollider", isSignal: true, isRequired: true, transformFunction: null } }, hostDirectives: [{ directive: NgtrAnyCollider, inputs: ["options", "options", "name", "name", "scale", "scale", "position", "position", "quaternion", "quaternion", "rotation", "rotation", "userData", "userData"], outputs: ["collisionEnter", "collisionEnter", "collisionExit", "collisionExit", "intersectionEnter", "intersectionEnter", "intersectionExit", "intersectionExit", "contactForce", "contactForce"] }], ngImport: i0 });
|
|
1392
1525
|
}
|
|
1393
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.
|
|
1526
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.6", ngImport: i0, type: NgtrRoundConeCollider, decorators: [{
|
|
1394
1527
|
type: Directive,
|
|
1395
1528
|
args: [{ selector: 'ngt-object3D[roundConeCollider]', hostDirectives: [ANY_COLLIDER_HOST_DIRECTIVE] }]
|
|
1396
1529
|
}], ctorParameters: () => [] });
|
|
1397
1530
|
class NgtrConvexMeshCollider {
|
|
1398
|
-
args = input.required();
|
|
1531
|
+
args = input.required({ alias: 'convexMeshCollider' });
|
|
1399
1532
|
constructor() {
|
|
1400
1533
|
const anyCollider = inject(NgtrAnyCollider, { host: true });
|
|
1401
1534
|
anyCollider.setShape('convexMesh');
|
|
@@ -1403,15 +1536,15 @@ class NgtrConvexMeshCollider {
|
|
|
1403
1536
|
anyCollider.setArgs(this.args());
|
|
1404
1537
|
});
|
|
1405
1538
|
}
|
|
1406
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.
|
|
1407
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.1.
|
|
1539
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.6", ngImport: i0, type: NgtrConvexMeshCollider, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
1540
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.1.6", type: NgtrConvexMeshCollider, isStandalone: true, selector: "ngt-object3D[convexMeshCollider]", inputs: { args: { classPropertyName: "args", publicName: "convexMeshCollider", isSignal: true, isRequired: true, transformFunction: null } }, hostDirectives: [{ directive: NgtrAnyCollider, inputs: ["options", "options", "name", "name", "scale", "scale", "position", "position", "quaternion", "quaternion", "rotation", "rotation", "userData", "userData"], outputs: ["collisionEnter", "collisionEnter", "collisionExit", "collisionExit", "intersectionEnter", "intersectionEnter", "intersectionExit", "intersectionExit", "contactForce", "contactForce"] }], ngImport: i0 });
|
|
1408
1541
|
}
|
|
1409
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.
|
|
1542
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.6", ngImport: i0, type: NgtrConvexMeshCollider, decorators: [{
|
|
1410
1543
|
type: Directive,
|
|
1411
1544
|
args: [{ selector: 'ngt-object3D[convexMeshCollider]', hostDirectives: [ANY_COLLIDER_HOST_DIRECTIVE] }]
|
|
1412
1545
|
}], ctorParameters: () => [] });
|
|
1413
1546
|
class NgtrRoundConvexHullCollider {
|
|
1414
|
-
args = input.required();
|
|
1547
|
+
args = input.required({ alias: 'roundConvexHullCollider' });
|
|
1415
1548
|
constructor() {
|
|
1416
1549
|
const anyCollider = inject(NgtrAnyCollider, { host: true });
|
|
1417
1550
|
anyCollider.setShape('roundConvexHull');
|
|
@@ -1419,15 +1552,15 @@ class NgtrRoundConvexHullCollider {
|
|
|
1419
1552
|
anyCollider.setArgs(this.args());
|
|
1420
1553
|
});
|
|
1421
1554
|
}
|
|
1422
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.
|
|
1423
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.1.
|
|
1555
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.6", ngImport: i0, type: NgtrRoundConvexHullCollider, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
1556
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.1.6", type: NgtrRoundConvexHullCollider, isStandalone: true, selector: "ngt-object3D[roundConvexHullCollider]", inputs: { args: { classPropertyName: "args", publicName: "roundConvexHullCollider", isSignal: true, isRequired: true, transformFunction: null } }, hostDirectives: [{ directive: NgtrAnyCollider, inputs: ["options", "options", "name", "name", "scale", "scale", "position", "position", "quaternion", "quaternion", "rotation", "rotation", "userData", "userData"], outputs: ["collisionEnter", "collisionEnter", "collisionExit", "collisionExit", "intersectionEnter", "intersectionEnter", "intersectionExit", "intersectionExit", "contactForce", "contactForce"] }], ngImport: i0 });
|
|
1424
1557
|
}
|
|
1425
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.
|
|
1558
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.6", ngImport: i0, type: NgtrRoundConvexHullCollider, decorators: [{
|
|
1426
1559
|
type: Directive,
|
|
1427
1560
|
args: [{ selector: 'ngt-object3D[roundConvexHullCollider]', hostDirectives: [ANY_COLLIDER_HOST_DIRECTIVE] }]
|
|
1428
1561
|
}], ctorParameters: () => [] });
|
|
1429
1562
|
class NgtrRoundConvexMeshCollider {
|
|
1430
|
-
args = input.required();
|
|
1563
|
+
args = input.required({ alias: 'roundConvexMeshCollider' });
|
|
1431
1564
|
constructor() {
|
|
1432
1565
|
const anyCollider = inject(NgtrAnyCollider, { host: true });
|
|
1433
1566
|
anyCollider.setShape('roundConvexMesh');
|
|
@@ -1435,10 +1568,10 @@ class NgtrRoundConvexMeshCollider {
|
|
|
1435
1568
|
anyCollider.setArgs(this.args());
|
|
1436
1569
|
});
|
|
1437
1570
|
}
|
|
1438
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.
|
|
1439
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.1.
|
|
1571
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.6", ngImport: i0, type: NgtrRoundConvexMeshCollider, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
1572
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.1.6", type: NgtrRoundConvexMeshCollider, isStandalone: true, selector: "ngt-object3D[roundConvexMeshCollider]", inputs: { args: { classPropertyName: "args", publicName: "roundConvexMeshCollider", isSignal: true, isRequired: true, transformFunction: null } }, hostDirectives: [{ directive: NgtrAnyCollider, inputs: ["options", "options", "name", "name", "scale", "scale", "position", "position", "quaternion", "quaternion", "rotation", "rotation", "userData", "userData"], outputs: ["collisionEnter", "collisionEnter", "collisionExit", "collisionExit", "intersectionEnter", "intersectionEnter", "intersectionExit", "intersectionExit", "contactForce", "contactForce"] }], ngImport: i0 });
|
|
1440
1573
|
}
|
|
1441
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.
|
|
1574
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.6", ngImport: i0, type: NgtrRoundConvexMeshCollider, decorators: [{
|
|
1442
1575
|
type: Directive,
|
|
1443
1576
|
args: [{ selector: 'ngt-object3D[roundConvexMeshCollider]', hostDirectives: [ANY_COLLIDER_HOST_DIRECTIVE] }]
|
|
1444
1577
|
}], ctorParameters: () => [] });
|
|
@@ -1446,11 +1579,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.4", ngImpor
|
|
|
1446
1579
|
const defaultOptions = rigidBodyDefaultOptions;
|
|
1447
1580
|
class NgtrInstancedRigidBodies {
|
|
1448
1581
|
position = input([0, 0, 0]);
|
|
1449
|
-
rotation = input(
|
|
1582
|
+
rotation = input();
|
|
1450
1583
|
scale = input([1, 1, 1]);
|
|
1451
|
-
quaternion = input(
|
|
1452
|
-
userData = input(
|
|
1453
|
-
instances = input(
|
|
1584
|
+
quaternion = input();
|
|
1585
|
+
userData = input();
|
|
1586
|
+
instances = input.required({
|
|
1454
1587
|
alias: 'instancedRigidBodies',
|
|
1455
1588
|
transform: (value) => {
|
|
1456
1589
|
if (value === '')
|
|
@@ -1460,13 +1593,24 @@ class NgtrInstancedRigidBodies {
|
|
|
1460
1593
|
});
|
|
1461
1594
|
options = input(defaultOptions, { transform: mergeInputs(defaultOptions) });
|
|
1462
1595
|
object3DParameters = computed(() => {
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1596
|
+
const [position, rotation, scale, quaternion, userData] = [
|
|
1597
|
+
this.position(),
|
|
1598
|
+
this.rotation(),
|
|
1599
|
+
this.scale(),
|
|
1600
|
+
this.quaternion(),
|
|
1601
|
+
this.userData(),
|
|
1602
|
+
];
|
|
1603
|
+
const parameters = { position, scale, userData };
|
|
1604
|
+
if (quaternion) {
|
|
1605
|
+
Object.assign(parameters, { quaternion });
|
|
1606
|
+
}
|
|
1607
|
+
else if (rotation) {
|
|
1608
|
+
Object.assign(parameters, { rotation });
|
|
1609
|
+
}
|
|
1610
|
+
else {
|
|
1611
|
+
Object.assign(parameters, { rotation: [0, 0, 0] });
|
|
1612
|
+
}
|
|
1613
|
+
return parameters;
|
|
1470
1614
|
});
|
|
1471
1615
|
instanceWrapperRef = viewChild.required('instanceWrapper');
|
|
1472
1616
|
rigidBodyRefs = viewChildren(NgtrRigidBody);
|
|
@@ -1549,8 +1693,8 @@ class NgtrInstancedRigidBodies {
|
|
|
1549
1693
|
instancedMesh.instanceMatrix.setUsage(THREE.DynamicDrawUsage);
|
|
1550
1694
|
});
|
|
1551
1695
|
}
|
|
1552
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.
|
|
1553
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.1.
|
|
1696
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.6", ngImport: i0, type: NgtrInstancedRigidBodies, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1697
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.1.6", type: NgtrInstancedRigidBodies, isStandalone: true, selector: "ngt-object3D[instancedRigidBodies]", 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: "instancedRigidBodies", isSignal: true, isRequired: true, 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: `
|
|
1554
1698
|
<ngt-object3D #instanceWrapper>
|
|
1555
1699
|
<ng-content />
|
|
1556
1700
|
</ngt-object3D>
|
|
@@ -1583,7 +1727,7 @@ class NgtrInstancedRigidBodies {
|
|
|
1583
1727
|
}
|
|
1584
1728
|
`, isInline: true, dependencies: [{ kind: "component", type: NgtrRigidBody, selector: "ngt-object3D[rigidBody]", inputs: ["rigidBody", "position", "rotation", "scale", "quaternion", "userData", "options"], outputs: ["wake", "sleep", "collisionEnter", "collisionExit", "intersectionEnter", "intersectionExit", "contactForce"], exportAs: ["rigidBody"] }, { kind: "directive", type: NgtrAnyCollider, selector: "ngt-object3D[collider]", inputs: ["position", "rotation", "scale", "quaternion", "userData", "name", "options", "collider", "args"], outputs: ["colliderChange", "argsChange", "collisionEnter", "collisionExit", "intersectionEnter", "intersectionExit", "contactForce"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1585
1729
|
}
|
|
1586
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.
|
|
1730
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.6", ngImport: i0, type: NgtrInstancedRigidBodies, decorators: [{
|
|
1587
1731
|
type: Component,
|
|
1588
1732
|
args: [{
|
|
1589
1733
|
selector: 'ngt-object3D[instancedRigidBodies]',
|
|
@@ -1662,11 +1806,15 @@ function createJoint(jointDataFn) {
|
|
|
1662
1806
|
return function _injectJoint(bodyA, bodyB, { injector, data }) {
|
|
1663
1807
|
return assertInjector(_injectJoint, injector, () => {
|
|
1664
1808
|
const physics = inject(NgtrPhysics);
|
|
1809
|
+
let dataFn = data;
|
|
1810
|
+
if (typeof data !== 'function') {
|
|
1811
|
+
dataFn = () => data;
|
|
1812
|
+
}
|
|
1665
1813
|
const jointData = computed(() => {
|
|
1666
1814
|
const rapier = physics.rapier();
|
|
1667
1815
|
if (!rapier)
|
|
1668
1816
|
return null;
|
|
1669
|
-
return jointDataFn(rapier,
|
|
1817
|
+
return jointDataFn(rapier, untracked(dataFn));
|
|
1670
1818
|
});
|
|
1671
1819
|
return injectImpulseJoint(bodyA, bodyB, { injector, data: jointData });
|
|
1672
1820
|
});
|
|
@@ -1733,7 +1881,7 @@ const injectSpringJoint = createJoint((rapier, data) => {
|
|
|
1733
1881
|
});
|
|
1734
1882
|
|
|
1735
1883
|
class NgtrMeshCollider {
|
|
1736
|
-
colliders = input.required({ alias: '
|
|
1884
|
+
colliders = input.required({ alias: 'meshCollider' });
|
|
1737
1885
|
objectRef = inject(ElementRef);
|
|
1738
1886
|
rigidBody = inject(NgtrRigidBody);
|
|
1739
1887
|
childColliderOptions = computed(() => {
|
|
@@ -1752,8 +1900,8 @@ class NgtrMeshCollider {
|
|
|
1752
1900
|
this.objectRef.nativeElement.userData ??= {};
|
|
1753
1901
|
this.objectRef.nativeElement.userData['ngtrRapierType'] = 'MeshCollider';
|
|
1754
1902
|
}
|
|
1755
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.
|
|
1756
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.1.
|
|
1903
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.6", ngImport: i0, type: NgtrMeshCollider, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1904
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.1.6", type: NgtrMeshCollider, isStandalone: true, selector: "ngt-object3D[meshCollider]", inputs: { colliders: { classPropertyName: "colliders", publicName: "meshCollider", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: `
|
|
1757
1905
|
<ng-content />
|
|
1758
1906
|
@for (childColliderOption of childColliderOptions(); track $index) {
|
|
1759
1907
|
<ngt-object3D
|
|
@@ -1768,7 +1916,7 @@ class NgtrMeshCollider {
|
|
|
1768
1916
|
}
|
|
1769
1917
|
`, isInline: true, dependencies: [{ kind: "directive", type: NgtrAnyCollider, selector: "ngt-object3D[collider]", inputs: ["position", "rotation", "scale", "quaternion", "userData", "name", "options", "collider", "args"], outputs: ["colliderChange", "argsChange", "collisionEnter", "collisionExit", "intersectionEnter", "intersectionExit", "contactForce"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1770
1918
|
}
|
|
1771
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.
|
|
1919
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.6", ngImport: i0, type: NgtrMeshCollider, decorators: [{
|
|
1772
1920
|
type: Component,
|
|
1773
1921
|
args: [{
|
|
1774
1922
|
selector: 'ngt-object3D[meshCollider]',
|
|
@@ -1792,9 +1940,28 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.4", ngImpor
|
|
|
1792
1940
|
}]
|
|
1793
1941
|
}], ctorParameters: () => [] });
|
|
1794
1942
|
|
|
1943
|
+
function injectBeforePhysicsStep(callback, injector) {
|
|
1944
|
+
return assertInjector(injectBeforePhysicsStep, injector, () => {
|
|
1945
|
+
const physics = inject(NgtrPhysics);
|
|
1946
|
+
physics.beforeStepCallbacks.add(callback);
|
|
1947
|
+
inject(DestroyRef).onDestroy(() => {
|
|
1948
|
+
physics.beforeStepCallbacks.delete(callback);
|
|
1949
|
+
});
|
|
1950
|
+
});
|
|
1951
|
+
}
|
|
1952
|
+
function injectAfterPhysicsStep(callback, injector) {
|
|
1953
|
+
return assertInjector(injectAfterPhysicsStep, injector, () => {
|
|
1954
|
+
const physics = inject(NgtrPhysics);
|
|
1955
|
+
physics.afterStepCallbacks.add(callback);
|
|
1956
|
+
inject(DestroyRef).onDestroy(() => {
|
|
1957
|
+
physics.afterStepCallbacks.delete(callback);
|
|
1958
|
+
});
|
|
1959
|
+
});
|
|
1960
|
+
}
|
|
1961
|
+
|
|
1795
1962
|
/**
|
|
1796
1963
|
* Generated bundle index. Do not edit.
|
|
1797
1964
|
*/
|
|
1798
1965
|
|
|
1799
|
-
export { NgtrAnyCollider, NgtrBallCollider, NgtrCapsuleCollider, NgtrConeCollider, NgtrConvexHullCollider, NgtrConvexMeshCollider, NgtrCuboidCollider, NgtrCylinderCollider, NgtrHeightfieldCollider, NgtrInstancedRigidBodies, NgtrMeshCollider, NgtrPhysics, NgtrPhysicsFallback, NgtrPolylineCollider, NgtrRigidBody, NgtrRoundConeCollider, NgtrRoundConvexHullCollider, NgtrRoundConvexMeshCollider, NgtrRoundCuboidCollider, NgtrRoundCylinderCollider, NgtrTrimeshCollider, injectFixedJoint, injectPrismaticJoint, injectRevoluteJoint, injectRopeJoint, injectSphericalJoint, injectSpringJoint, rigidBodyDefaultOptions };
|
|
1966
|
+
export { COLLISION_GROUPS_HANDLER, NgtrAnyCollider, NgtrBallCollider, NgtrCapsuleCollider, NgtrConeCollider, NgtrConvexHullCollider, NgtrConvexMeshCollider, NgtrCuboidCollider, NgtrCylinderCollider, NgtrHeightfieldCollider, NgtrInstancedRigidBodies, NgtrInteractionGroups, NgtrMeshCollider, NgtrPhysics, NgtrPhysicsFallback, NgtrPolylineCollider, NgtrRigidBody, NgtrRoundConeCollider, NgtrRoundConvexHullCollider, NgtrRoundConvexMeshCollider, NgtrRoundCuboidCollider, NgtrRoundCylinderCollider, NgtrTrimeshCollider, injectAfterPhysicsStep, injectBeforePhysicsStep, injectFixedJoint, injectPrismaticJoint, injectRevoluteJoint, injectRopeJoint, injectSphericalJoint, injectSpringJoint, interactionGroups, rigidBodyDefaultOptions };
|
|
1800
1967
|
//# sourceMappingURL=angular-three-rapier.mjs.map
|