angular-three-soba 4.0.0-next.96 → 4.0.0-next.97
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/abstractions/lib/catmull-rom-line.d.ts +55 -55
- package/abstractions/lib/edges.d.ts +55 -55
- package/abstractions/lib/line.d.ts +1 -1
- package/cameras/lib/orthographic-camera.d.ts +1 -1
- package/fesm2022/angular-three-soba-abstractions.mjs +2 -6
- package/fesm2022/angular-three-soba-abstractions.mjs.map +1 -1
- package/fesm2022/angular-three-soba-cameras.mjs +8 -8
- package/fesm2022/angular-three-soba-cameras.mjs.map +1 -1
- package/fesm2022/angular-three-soba-gizmos.mjs +87 -117
- package/fesm2022/angular-three-soba-gizmos.mjs.map +1 -1
- package/fesm2022/angular-three-soba-misc.mjs +2 -4
- package/fesm2022/angular-three-soba-misc.mjs.map +1 -1
- package/fesm2022/angular-three-soba-staging.mjs +44 -38
- package/fesm2022/angular-three-soba-staging.mjs.map +1 -1
- package/gizmos/lib/gizmo-helper/gizmo-viewcube.d.ts +4 -2
- package/gizmos/lib/gizmo-helper/gizmo-viewport.d.ts +4 -3
- package/gizmos/lib/pivot-controls/axis-arrow.d.ts +2 -1
- package/gizmos/lib/pivot-controls/axis-rotator.d.ts +1 -1
- package/gizmos/lib/pivot-controls/pivot-controls.d.ts +1 -1
- package/gizmos/lib/pivot-controls/plane-slider.d.ts +2 -1
- package/gizmos/lib/pivot-controls/scaling-sphere.d.ts +2 -1
- package/misc/lib/decal.d.ts +1 -1
- package/package.json +1 -1
- package/staging/lib/accumulative-shadows.d.ts +3 -3
- package/staging/lib/caustics.d.ts +1 -1
- package/staging/lib/center.d.ts +2 -2
- package/staging/lib/contact-shadows.d.ts +1 -1
- package/staging/lib/lightformer.d.ts +1 -1
- package/staging/lib/mask.d.ts +1 -1
- package/staging/lib/sky.d.ts +1 -1
- package/staging/lib/spot-light.d.ts +2 -2
- package/staging/lib/stage.d.ts +5 -5
|
@@ -2,7 +2,7 @@ import { NgTemplateOutlet, DOCUMENT } from '@angular/common';
|
|
|
2
2
|
import * as i0 from '@angular/core';
|
|
3
3
|
import { Directive, input, output, contentChild, TemplateRef, viewChild, computed, effect, Component, CUSTOM_ELEMENTS_SCHEMA, ChangeDetectionStrategy, inject, signal, ElementRef } from '@angular/core';
|
|
4
4
|
import * as i1 from 'angular-three';
|
|
5
|
-
import { pick, injectStore, extend, injectBeforeRender, hasListener, NgtPortalAutoRender, NgtPortal, NgtArgs, getEmitter, omit, getInstanceState, is, resolveRef } from 'angular-three';
|
|
5
|
+
import { pick, injectStore, extend, injectBeforeRender, hasListener, NgtPortalAutoRender, NgtPortal, injectObjectEvents, NgtArgs, getEmitter, omit, getInstanceState, is, resolveRef } from 'angular-three';
|
|
6
6
|
import { NgtsOrthographicCamera } from 'angular-three-soba/cameras';
|
|
7
7
|
import { mergeInputs } from 'ngxtension/inject-inputs';
|
|
8
8
|
import * as THREE from 'three';
|
|
@@ -289,11 +289,23 @@ class FaceCube {
|
|
|
289
289
|
constructor() {
|
|
290
290
|
this.options = input({});
|
|
291
291
|
this.onClick = input();
|
|
292
|
+
this.meshRef = viewChild.required('mesh');
|
|
292
293
|
this.gizmoHelper = inject(NgtsGizmoHelperImpl);
|
|
293
294
|
this.hover = signal(-1);
|
|
294
295
|
this.count = Array.from({ length: 6 });
|
|
295
296
|
this.Math = Math;
|
|
296
297
|
extend({ Mesh, BoxGeometry });
|
|
298
|
+
// TODO: (chau) remove this when event binding syntax no longer trigger cdr
|
|
299
|
+
injectObjectEvents(this.meshRef, {
|
|
300
|
+
pointerout: (ev) => {
|
|
301
|
+
ev.stopPropagation();
|
|
302
|
+
this.hover.set(-1);
|
|
303
|
+
},
|
|
304
|
+
pointermove: (ev) => {
|
|
305
|
+
ev.stopPropagation();
|
|
306
|
+
ev.faceIndex != null && this.hover.set(Math.floor(ev.faceIndex / 2));
|
|
307
|
+
},
|
|
308
|
+
});
|
|
297
309
|
}
|
|
298
310
|
internalOnClick(event) {
|
|
299
311
|
const onClick = this.onClick();
|
|
@@ -305,12 +317,8 @@ class FaceCube {
|
|
|
305
317
|
}
|
|
306
318
|
}
|
|
307
319
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: FaceCube, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
308
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.1", type: FaceCube, isStandalone: true, selector: "viewcube-face-cube", inputs: { options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null }, onClick: { classPropertyName: "onClick", publicName: "onClick", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: `
|
|
309
|
-
<ngt-mesh
|
|
310
|
-
(pointerout)="$any($event).stopPropagation(); hover.set(-1)"
|
|
311
|
-
(pointermove)="$any($event).stopPropagation(); hover.set(Math.floor($any($event).faceIndex / 2))"
|
|
312
|
-
(click)="internalOnClick($any($event))"
|
|
313
|
-
>
|
|
320
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.1", type: FaceCube, isStandalone: true, selector: "viewcube-face-cube", inputs: { options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null }, onClick: { classPropertyName: "onClick", publicName: "onClick", isSignal: true, isRequired: false, transformFunction: null } }, viewQueries: [{ propertyName: "meshRef", first: true, predicate: ["mesh"], descendants: true, isSignal: true }], ngImport: i0, template: `
|
|
321
|
+
<ngt-mesh #mesh (click)="internalOnClick($any($event))">
|
|
314
322
|
<ngt-box-geometry />
|
|
315
323
|
@for (face of count; track $index) {
|
|
316
324
|
<viewcube-face-material [index]="$index" [hover]="hover() === $index" [options]="options()" />
|
|
@@ -323,11 +331,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImpor
|
|
|
323
331
|
args: [{
|
|
324
332
|
selector: 'viewcube-face-cube',
|
|
325
333
|
template: `
|
|
326
|
-
<ngt-mesh
|
|
327
|
-
(pointerout)="$any($event).stopPropagation(); hover.set(-1)"
|
|
328
|
-
(pointermove)="$any($event).stopPropagation(); hover.set(Math.floor($any($event).faceIndex / 2))"
|
|
329
|
-
(click)="internalOnClick($any($event))"
|
|
330
|
-
>
|
|
334
|
+
<ngt-mesh #mesh (click)="internalOnClick($any($event))">
|
|
331
335
|
<ngt-box-geometry />
|
|
332
336
|
@for (face of count; track $index) {
|
|
333
337
|
<viewcube-face-material [index]="$index" [hover]="hover() === $index" [options]="options()" />
|
|
@@ -351,10 +355,22 @@ class EdgeCube {
|
|
|
351
355
|
},
|
|
352
356
|
});
|
|
353
357
|
this.onClick = input();
|
|
358
|
+
this.meshRef = viewChild.required('mesh');
|
|
354
359
|
this.gizmoHelper = inject(NgtsGizmoHelperImpl);
|
|
355
360
|
this.hover = signal(false);
|
|
356
361
|
this.color = computed(() => (this.hover() ? this.hoverColor() : 'white'));
|
|
357
362
|
extend({ Mesh, BoxGeometry, MeshBasicMaterial });
|
|
363
|
+
// TODO: (chau) remove this when event binding syntax no longer trigger cdr
|
|
364
|
+
injectObjectEvents(this.meshRef, {
|
|
365
|
+
pointerout: (ev) => {
|
|
366
|
+
ev.stopPropagation();
|
|
367
|
+
this.hover.set(false);
|
|
368
|
+
},
|
|
369
|
+
pointerover: (ev) => {
|
|
370
|
+
ev.stopPropagation();
|
|
371
|
+
this.hover.set(true);
|
|
372
|
+
},
|
|
373
|
+
});
|
|
358
374
|
}
|
|
359
375
|
internalOnClick(event) {
|
|
360
376
|
const onClick = this.onClick();
|
|
@@ -366,14 +382,8 @@ class EdgeCube {
|
|
|
366
382
|
}
|
|
367
383
|
}
|
|
368
384
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: EdgeCube, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
369
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.
|
|
370
|
-
<ngt-mesh
|
|
371
|
-
[scale]="1.01"
|
|
372
|
-
[position]="position()"
|
|
373
|
-
(pointerout)="$any($event).stopPropagation(); hover.set(false)"
|
|
374
|
-
(pointerover)="$any($event).stopPropagation(); hover.set(true)"
|
|
375
|
-
(click)="internalOnClick($any($event))"
|
|
376
|
-
>
|
|
385
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "19.2.1", type: EdgeCube, isStandalone: true, selector: "viewcube-edge-cube", inputs: { dimensions: { classPropertyName: "dimensions", publicName: "dimensions", isSignal: true, isRequired: true, transformFunction: null }, position: { classPropertyName: "position", publicName: "position", isSignal: true, isRequired: true, transformFunction: null }, hoverColor: { classPropertyName: "hoverColor", publicName: "hoverColor", isSignal: true, isRequired: false, transformFunction: null }, onClick: { classPropertyName: "onClick", publicName: "onClick", isSignal: true, isRequired: false, transformFunction: null } }, viewQueries: [{ propertyName: "meshRef", first: true, predicate: ["mesh"], descendants: true, isSignal: true }], ngImport: i0, template: `
|
|
386
|
+
<ngt-mesh #mesh [scale]="1.01" [position]="position()" (click)="internalOnClick($any($event))">
|
|
377
387
|
<ngt-mesh-basic-material transparent [opacity]="0.6" [color]="color()" [visible]="hover()" />
|
|
378
388
|
<ngt-box-geometry *args="dimensions()" />
|
|
379
389
|
</ngt-mesh>
|
|
@@ -384,13 +394,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImpor
|
|
|
384
394
|
args: [{
|
|
385
395
|
selector: 'viewcube-edge-cube',
|
|
386
396
|
template: `
|
|
387
|
-
<ngt-mesh
|
|
388
|
-
[scale]="1.01"
|
|
389
|
-
[position]="position()"
|
|
390
|
-
(pointerout)="$any($event).stopPropagation(); hover.set(false)"
|
|
391
|
-
(pointerover)="$any($event).stopPropagation(); hover.set(true)"
|
|
392
|
-
(click)="internalOnClick($any($event))"
|
|
393
|
-
>
|
|
397
|
+
<ngt-mesh #mesh [scale]="1.01" [position]="position()" (click)="internalOnClick($any($event))">
|
|
394
398
|
<ngt-mesh-basic-material transparent [opacity]="0.6" [color]="color()" [visible]="hover()" />
|
|
395
399
|
<ngt-box-geometry *args="dimensions()" />
|
|
396
400
|
</ngt-mesh>
|
|
@@ -545,6 +549,7 @@ class AxisHead {
|
|
|
545
549
|
this.disabled = input(false);
|
|
546
550
|
this.font = input('18px Inter var, Arial, sans-serif');
|
|
547
551
|
this.onClick = input();
|
|
552
|
+
this.spriteRef = viewChild.required('sprite');
|
|
548
553
|
this.document = inject(DOCUMENT);
|
|
549
554
|
this.gizmoHelper = inject(NgtsGizmoHelperImpl);
|
|
550
555
|
this.store = injectStore();
|
|
@@ -578,6 +583,12 @@ class AxisHead {
|
|
|
578
583
|
this.active = signal(false);
|
|
579
584
|
this.scale = computed(() => (this.label() ? 1 : 0.75) * (this.active() ? 1.2 : 1) * this.axisHeadScale());
|
|
580
585
|
extend({ Sprite, SpriteMaterial });
|
|
586
|
+
// TODO: (chau) remove this when event binding syntax no longer trigger cdr
|
|
587
|
+
injectObjectEvents(this.spriteRef, {
|
|
588
|
+
pointerover: this.onPointerOver.bind(this),
|
|
589
|
+
pointerout: this.onPointerOut.bind(this),
|
|
590
|
+
pointerdown: this.onPointerDown.bind(this),
|
|
591
|
+
});
|
|
581
592
|
}
|
|
582
593
|
onPointerOver(event) {
|
|
583
594
|
if (this.disabled())
|
|
@@ -603,14 +614,8 @@ class AxisHead {
|
|
|
603
614
|
this.gizmoHelper.tweenCamera(event.object.position);
|
|
604
615
|
}
|
|
605
616
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: AxisHead, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
606
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.
|
|
607
|
-
<ngt-sprite
|
|
608
|
-
[scale]="scale()"
|
|
609
|
-
[position]="position()"
|
|
610
|
-
(pointerover)="onPointerOver($any($event))"
|
|
611
|
-
(pointerout)="onPointerOut($any($event))"
|
|
612
|
-
(pointerdown)="onPointerDown($any($event))"
|
|
613
|
-
>
|
|
617
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "19.2.1", type: AxisHead, isStandalone: true, selector: "viewport-axis-head", inputs: { arcStyle: { classPropertyName: "arcStyle", publicName: "arcStyle", isSignal: true, isRequired: true, transformFunction: null }, position: { classPropertyName: "position", publicName: "position", isSignal: true, isRequired: true, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, labelColor: { classPropertyName: "labelColor", publicName: "labelColor", isSignal: true, isRequired: false, transformFunction: null }, axisHeadScale: { classPropertyName: "axisHeadScale", publicName: "axisHeadScale", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, font: { classPropertyName: "font", publicName: "font", isSignal: true, isRequired: false, transformFunction: null }, onClick: { classPropertyName: "onClick", publicName: "onClick", isSignal: true, isRequired: false, transformFunction: null } }, viewQueries: [{ propertyName: "spriteRef", first: true, predicate: ["sprite"], descendants: true, isSignal: true }], ngImport: i0, template: `
|
|
618
|
+
<ngt-sprite #sprite [scale]="scale()" [position]="position()">
|
|
614
619
|
<ngt-sprite-material
|
|
615
620
|
[map]="texture()"
|
|
616
621
|
[alphaTest]="0.3"
|
|
@@ -625,13 +630,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImpor
|
|
|
625
630
|
args: [{
|
|
626
631
|
selector: 'viewport-axis-head',
|
|
627
632
|
template: `
|
|
628
|
-
<ngt-sprite
|
|
629
|
-
[scale]="scale()"
|
|
630
|
-
[position]="position()"
|
|
631
|
-
(pointerover)="onPointerOver($any($event))"
|
|
632
|
-
(pointerout)="onPointerOut($any($event))"
|
|
633
|
-
(pointerdown)="onPointerDown($any($event))"
|
|
634
|
-
>
|
|
633
|
+
<ngt-sprite #sprite [scale]="scale()" [position]="position()">
|
|
635
634
|
<ngt-sprite-material
|
|
636
635
|
[map]="texture()"
|
|
637
636
|
[alphaTest]="0.3"
|
|
@@ -868,6 +867,7 @@ class NgtsAxisArrow {
|
|
|
868
867
|
this.direction = input.required();
|
|
869
868
|
this.axis = input.required();
|
|
870
869
|
this.groupRef = viewChild.required('group');
|
|
870
|
+
this.innerGroupRef = viewChild.required('innerGroup');
|
|
871
871
|
this.annotationRef = viewChild('annotation', { read: ElementRef });
|
|
872
872
|
this.pivotControls = inject(NgtsPivotControls);
|
|
873
873
|
this.store = injectStore();
|
|
@@ -885,6 +885,13 @@ class NgtsAxisArrow {
|
|
|
885
885
|
return new THREE.Matrix4().makeRotationFromQuaternion(quaternion);
|
|
886
886
|
});
|
|
887
887
|
extend({ Group, Mesh, ConeGeometry, CylinderGeometry, MeshBasicMaterial });
|
|
888
|
+
// TODO: (chau) remove this when event binding syntax no longer trigger cdr
|
|
889
|
+
injectObjectEvents(this.innerGroupRef, {
|
|
890
|
+
pointerdown: this.onPointerDown.bind(this),
|
|
891
|
+
pointermove: this.onPointerMove.bind(this),
|
|
892
|
+
pointerup: this.onPointerUp.bind(this),
|
|
893
|
+
pointerout: this.onPointerOut.bind(this),
|
|
894
|
+
});
|
|
888
895
|
}
|
|
889
896
|
onPointerDown(event) {
|
|
890
897
|
const [group, direction, axis, controls, annotation] = [
|
|
@@ -960,16 +967,9 @@ class NgtsAxisArrow {
|
|
|
960
967
|
this.hovered.set(false);
|
|
961
968
|
}
|
|
962
969
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: NgtsAxisArrow, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
963
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.1", type: NgtsAxisArrow, isStandalone: true, selector: "ngts-axis-arrow", inputs: { direction: { classPropertyName: "direction", publicName: "direction", isSignal: true, isRequired: true, transformFunction: null }, axis: { classPropertyName: "axis", publicName: "axis", isSignal: true, isRequired: true, transformFunction: null } }, viewQueries: [{ propertyName: "groupRef", first: true, predicate: ["group"], descendants: true, isSignal: true }, { propertyName: "annotationRef", first: true, predicate: ["annotation"], descendants: true, read: ElementRef, isSignal: true }], ngImport: i0, template: `
|
|
970
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.1", type: NgtsAxisArrow, isStandalone: true, selector: "ngts-axis-arrow", inputs: { direction: { classPropertyName: "direction", publicName: "direction", isSignal: true, isRequired: true, transformFunction: null }, axis: { classPropertyName: "axis", publicName: "axis", isSignal: true, isRequired: true, transformFunction: null } }, viewQueries: [{ propertyName: "groupRef", first: true, predicate: ["group"], descendants: true, isSignal: true }, { propertyName: "innerGroupRef", first: true, predicate: ["innerGroup"], descendants: true, isSignal: true }, { propertyName: "annotationRef", first: true, predicate: ["annotation"], descendants: true, read: ElementRef, isSignal: true }], ngImport: i0, template: `
|
|
964
971
|
<ngt-group #group>
|
|
965
|
-
<ngt-group
|
|
966
|
-
[matrix]="matrixL()"
|
|
967
|
-
[matrixAutoUpdate]="false"
|
|
968
|
-
(pointerdown)="onPointerDown($any($event))"
|
|
969
|
-
(pointerup)="onPointerUp($any($event))"
|
|
970
|
-
(pointermove)="onPointerMove($any($event))"
|
|
971
|
-
(pointerout)="onPointerOut($any($event))"
|
|
972
|
-
>
|
|
972
|
+
<ngt-group #innerGroup [matrix]="matrixL()" [matrixAutoUpdate]="false">
|
|
973
973
|
@if (pivotControls.annotations()) {
|
|
974
974
|
<ngts-html [options]="{ position: [0, -coneLength(), 0] }">
|
|
975
975
|
<div
|
|
@@ -1034,14 +1034,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImpor
|
|
|
1034
1034
|
selector: 'ngts-axis-arrow',
|
|
1035
1035
|
template: `
|
|
1036
1036
|
<ngt-group #group>
|
|
1037
|
-
<ngt-group
|
|
1038
|
-
[matrix]="matrixL()"
|
|
1039
|
-
[matrixAutoUpdate]="false"
|
|
1040
|
-
(pointerdown)="onPointerDown($any($event))"
|
|
1041
|
-
(pointerup)="onPointerUp($any($event))"
|
|
1042
|
-
(pointermove)="onPointerMove($any($event))"
|
|
1043
|
-
(pointerout)="onPointerOut($any($event))"
|
|
1044
|
-
>
|
|
1037
|
+
<ngt-group #innerGroup [matrix]="matrixL()" [matrixAutoUpdate]="false">
|
|
1045
1038
|
@if (pivotControls.annotations()) {
|
|
1046
1039
|
<ngts-html [options]="{ position: [0, -coneLength(), 0] }">
|
|
1047
1040
|
<div
|
|
@@ -1175,6 +1168,13 @@ class NgtsAxisRotator {
|
|
|
1175
1168
|
return points;
|
|
1176
1169
|
});
|
|
1177
1170
|
extend({ Group });
|
|
1171
|
+
// TODO: (chau) remove this when event binding syntax no longer trigger cdr
|
|
1172
|
+
injectObjectEvents(this.groupRef, {
|
|
1173
|
+
pointerdown: this.onPointerDown.bind(this),
|
|
1174
|
+
pointermove: this.onPointerMove.bind(this),
|
|
1175
|
+
pointerup: this.onPointerUp.bind(this),
|
|
1176
|
+
pointerout: this.onPointerOut.bind(this),
|
|
1177
|
+
});
|
|
1178
1178
|
}
|
|
1179
1179
|
onPointerDown(event) {
|
|
1180
1180
|
const [annotation, group, axis, controls] = [
|
|
@@ -1265,15 +1265,7 @@ class NgtsAxisRotator {
|
|
|
1265
1265
|
}
|
|
1266
1266
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: NgtsAxisRotator, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1267
1267
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.1", type: NgtsAxisRotator, isStandalone: true, selector: "ngts-axis-rotator", inputs: { dir1: { classPropertyName: "dir1", publicName: "dir1", isSignal: true, isRequired: true, transformFunction: null }, dir2: { classPropertyName: "dir2", publicName: "dir2", isSignal: true, isRequired: true, transformFunction: null }, axis: { classPropertyName: "axis", publicName: "axis", isSignal: true, isRequired: true, transformFunction: null } }, viewQueries: [{ propertyName: "groupRef", first: true, predicate: ["group"], descendants: true, isSignal: true }, { propertyName: "annotationRef", first: true, predicate: ["annotation"], descendants: true, read: ElementRef, isSignal: true }], ngImport: i0, template: `
|
|
1268
|
-
<ngt-group
|
|
1269
|
-
#group
|
|
1270
|
-
[matrix]="matrixL()"
|
|
1271
|
-
[matrixAutoUpdate]="false"
|
|
1272
|
-
(pointerdown)="onPointerDown($any($event))"
|
|
1273
|
-
(pointermove)="onPointerMove($any($event))"
|
|
1274
|
-
(pointerup)="onPointerUp($any($event))"
|
|
1275
|
-
(pointerout)="onPointerOut($any($event))"
|
|
1276
|
-
>
|
|
1268
|
+
<ngt-group #group [matrix]="matrixL()" [matrixAutoUpdate]="false">
|
|
1277
1269
|
@if (pivotControls.annotations()) {
|
|
1278
1270
|
<ngts-html [options]="{ position: [r(), r(), 0] }">
|
|
1279
1271
|
<div
|
|
@@ -1317,15 +1309,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImpor
|
|
|
1317
1309
|
args: [{
|
|
1318
1310
|
selector: 'ngts-axis-rotator',
|
|
1319
1311
|
template: `
|
|
1320
|
-
<ngt-group
|
|
1321
|
-
#group
|
|
1322
|
-
[matrix]="matrixL()"
|
|
1323
|
-
[matrixAutoUpdate]="false"
|
|
1324
|
-
(pointerdown)="onPointerDown($any($event))"
|
|
1325
|
-
(pointermove)="onPointerMove($any($event))"
|
|
1326
|
-
(pointerup)="onPointerUp($any($event))"
|
|
1327
|
-
(pointerout)="onPointerOut($any($event))"
|
|
1328
|
-
>
|
|
1312
|
+
<ngt-group #group [matrix]="matrixL()" [matrixAutoUpdate]="false">
|
|
1329
1313
|
@if (pivotControls.annotations()) {
|
|
1330
1314
|
<ngts-html [options]="{ position: [r(), r(), 0] }">
|
|
1331
1315
|
<div
|
|
@@ -1397,6 +1381,7 @@ class NgtsPlaneSlider {
|
|
|
1397
1381
|
this.dir2 = input.required();
|
|
1398
1382
|
this.axis = input.required();
|
|
1399
1383
|
this.groupRef = viewChild.required('group');
|
|
1384
|
+
this.meshRef = viewChild.required('mesh');
|
|
1400
1385
|
this.annotationRef = viewChild('annotation', { read: ElementRef });
|
|
1401
1386
|
this.pivotControls = inject(NgtsPivotControls);
|
|
1402
1387
|
this.store = injectStore();
|
|
@@ -1423,6 +1408,13 @@ class NgtsPlaneSlider {
|
|
|
1423
1408
|
];
|
|
1424
1409
|
});
|
|
1425
1410
|
extend({ Group, Mesh, PlaneGeometry, MeshBasicMaterial });
|
|
1411
|
+
// TODO: (chau) remove this when event binding syntax no longer trigger cdr
|
|
1412
|
+
injectObjectEvents(this.meshRef, {
|
|
1413
|
+
pointerdown: this.onPointerDown.bind(this),
|
|
1414
|
+
pointermove: this.onPointerMove.bind(this),
|
|
1415
|
+
pointerup: this.onPointerUp.bind(this),
|
|
1416
|
+
pointerout: this.onPointerOut.bind(this),
|
|
1417
|
+
});
|
|
1426
1418
|
}
|
|
1427
1419
|
onPointerDown(event) {
|
|
1428
1420
|
const [annotation, axis, group, controls] = [
|
|
@@ -1514,7 +1506,7 @@ class NgtsPlaneSlider {
|
|
|
1514
1506
|
this.hovered.set(false);
|
|
1515
1507
|
}
|
|
1516
1508
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: NgtsPlaneSlider, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1517
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.1", type: NgtsPlaneSlider, isStandalone: true, selector: "ngts-plane-slider", inputs: { dir1: { classPropertyName: "dir1", publicName: "dir1", isSignal: true, isRequired: true, transformFunction: null }, dir2: { classPropertyName: "dir2", publicName: "dir2", isSignal: true, isRequired: true, transformFunction: null }, axis: { classPropertyName: "axis", publicName: "axis", isSignal: true, isRequired: true, transformFunction: null } }, viewQueries: [{ propertyName: "groupRef", first: true, predicate: ["group"], descendants: true, isSignal: true }, { propertyName: "annotationRef", first: true, predicate: ["annotation"], descendants: true, read: ElementRef, isSignal: true }], ngImport: i0, template: `
|
|
1509
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.1", type: NgtsPlaneSlider, isStandalone: true, selector: "ngts-plane-slider", inputs: { dir1: { classPropertyName: "dir1", publicName: "dir1", isSignal: true, isRequired: true, transformFunction: null }, dir2: { classPropertyName: "dir2", publicName: "dir2", isSignal: true, isRequired: true, transformFunction: null }, axis: { classPropertyName: "axis", publicName: "axis", isSignal: true, isRequired: true, transformFunction: null } }, viewQueries: [{ propertyName: "groupRef", first: true, predicate: ["group"], descendants: true, isSignal: true }, { propertyName: "meshRef", first: true, predicate: ["mesh"], descendants: true, isSignal: true }, { propertyName: "annotationRef", first: true, predicate: ["annotation"], descendants: true, read: ElementRef, isSignal: true }], ngImport: i0, template: `
|
|
1518
1510
|
<ngt-group #group [matrix]="matrixL()" [matrixAutoUpdate]="false">
|
|
1519
1511
|
@if (pivotControls.annotations()) {
|
|
1520
1512
|
<ngts-html [options]="{ position: [0, 0, 0] }">
|
|
@@ -1527,15 +1519,7 @@ class NgtsPlaneSlider {
|
|
|
1527
1519
|
</ngts-html>
|
|
1528
1520
|
}
|
|
1529
1521
|
<ngt-group [position]="[pos1() * 1.7, pos1() * 1.7, 0]">
|
|
1530
|
-
<ngt-mesh
|
|
1531
|
-
visible
|
|
1532
|
-
[scale]="length()"
|
|
1533
|
-
[userData]="pivotControls.userData()"
|
|
1534
|
-
(pointerdown)="onPointerDown($any($event))"
|
|
1535
|
-
(pointermove)="onPointerMove($any($event))"
|
|
1536
|
-
(pointerup)="onPointerUp($any($event))"
|
|
1537
|
-
(pointerout)="onPointerOut($any($event))"
|
|
1538
|
-
>
|
|
1522
|
+
<ngt-mesh #mesh visible [scale]="length()" [userData]="pivotControls.userData()">
|
|
1539
1523
|
<ngt-plane-geometry />
|
|
1540
1524
|
<ngt-mesh-basic-material
|
|
1541
1525
|
transparent
|
|
@@ -1583,15 +1567,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImpor
|
|
|
1583
1567
|
</ngts-html>
|
|
1584
1568
|
}
|
|
1585
1569
|
<ngt-group [position]="[pos1() * 1.7, pos1() * 1.7, 0]">
|
|
1586
|
-
<ngt-mesh
|
|
1587
|
-
visible
|
|
1588
|
-
[scale]="length()"
|
|
1589
|
-
[userData]="pivotControls.userData()"
|
|
1590
|
-
(pointerdown)="onPointerDown($any($event))"
|
|
1591
|
-
(pointermove)="onPointerMove($any($event))"
|
|
1592
|
-
(pointerup)="onPointerUp($any($event))"
|
|
1593
|
-
(pointerout)="onPointerOut($any($event))"
|
|
1594
|
-
>
|
|
1570
|
+
<ngt-mesh #mesh visible [scale]="length()" [userData]="pivotControls.userData()">
|
|
1595
1571
|
<ngt-plane-geometry />
|
|
1596
1572
|
<ngt-mesh-basic-material
|
|
1597
1573
|
transparent
|
|
@@ -1653,6 +1629,7 @@ class NgtsScalingSphere {
|
|
|
1653
1629
|
this.direction = input.required();
|
|
1654
1630
|
this.axis = input.required();
|
|
1655
1631
|
this.groupRef = viewChild.required('group');
|
|
1632
|
+
this.innerGroupRef = viewChild.required('innerGroup');
|
|
1656
1633
|
this.annotationRef = viewChild('annotation', { read: ElementRef });
|
|
1657
1634
|
this.meshRef = viewChild.required('mesh');
|
|
1658
1635
|
this.pivotControls = inject(NgtsPivotControls);
|
|
@@ -1671,6 +1648,13 @@ class NgtsScalingSphere {
|
|
|
1671
1648
|
});
|
|
1672
1649
|
this.color = computed(() => this.hovered() ? this.pivotControls.hoveredColor() : this.pivotControls.axisColors()[this.axis()]);
|
|
1673
1650
|
extend({ Group, Mesh, SphereGeometry, MeshBasicMaterial });
|
|
1651
|
+
// TODO: (chau) remove this when event binding syntax no longer trigger cdr
|
|
1652
|
+
injectObjectEvents(this.innerGroupRef, {
|
|
1653
|
+
pointerdown: this.onPointerDown.bind(this),
|
|
1654
|
+
pointermove: this.onPointerMove.bind(this),
|
|
1655
|
+
pointerup: this.onPointerUp.bind(this),
|
|
1656
|
+
pointerout: this.onPointerOut.bind(this),
|
|
1657
|
+
});
|
|
1674
1658
|
}
|
|
1675
1659
|
onPointerDown(event) {
|
|
1676
1660
|
const [annotation, controls, fixed, scale, direction, axis, size, group] = [
|
|
@@ -1767,16 +1751,9 @@ class NgtsScalingSphere {
|
|
|
1767
1751
|
this.hovered.set(false);
|
|
1768
1752
|
}
|
|
1769
1753
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: NgtsScalingSphere, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1770
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.1", type: NgtsScalingSphere, isStandalone: true, selector: "ngts-scaling-sphere", inputs: { direction: { classPropertyName: "direction", publicName: "direction", isSignal: true, isRequired: true, transformFunction: null }, axis: { classPropertyName: "axis", publicName: "axis", isSignal: true, isRequired: true, transformFunction: null } }, viewQueries: [{ propertyName: "groupRef", first: true, predicate: ["group"], descendants: true, isSignal: true }, { propertyName: "annotationRef", first: true, predicate: ["annotation"], descendants: true, read: ElementRef, isSignal: true }, { propertyName: "meshRef", first: true, predicate: ["mesh"], descendants: true, isSignal: true }], ngImport: i0, template: `
|
|
1754
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.1", type: NgtsScalingSphere, isStandalone: true, selector: "ngts-scaling-sphere", inputs: { direction: { classPropertyName: "direction", publicName: "direction", isSignal: true, isRequired: true, transformFunction: null }, axis: { classPropertyName: "axis", publicName: "axis", isSignal: true, isRequired: true, transformFunction: null } }, viewQueries: [{ propertyName: "groupRef", first: true, predicate: ["group"], descendants: true, isSignal: true }, { propertyName: "innerGroupRef", first: true, predicate: ["innerGroup"], descendants: true, isSignal: true }, { propertyName: "annotationRef", first: true, predicate: ["annotation"], descendants: true, read: ElementRef, isSignal: true }, { propertyName: "meshRef", first: true, predicate: ["mesh"], descendants: true, isSignal: true }], ngImport: i0, template: `
|
|
1771
1755
|
<ngt-group #group>
|
|
1772
|
-
<ngt-group
|
|
1773
|
-
[matrix]="matrixL()"
|
|
1774
|
-
[matrixAutoUpdate]="false"
|
|
1775
|
-
(pointerdown)="onPointerDown($any($event))"
|
|
1776
|
-
(pointermove)="onPointerMove($any($event))"
|
|
1777
|
-
(pointerup)="onPointerUp($any($event))"
|
|
1778
|
-
(pointerout)="onPointerOut($any($event))"
|
|
1779
|
-
>
|
|
1756
|
+
<ngt-group #innerGroup [matrix]="matrixL()" [matrixAutoUpdate]="false">
|
|
1780
1757
|
@if (pivotControls.annotations()) {
|
|
1781
1758
|
<ngts-html [options]="{ position: [0, position() / 2, 0] }">
|
|
1782
1759
|
<div
|
|
@@ -1813,14 +1790,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImpor
|
|
|
1813
1790
|
selector: 'ngts-scaling-sphere',
|
|
1814
1791
|
template: `
|
|
1815
1792
|
<ngt-group #group>
|
|
1816
|
-
<ngt-group
|
|
1817
|
-
[matrix]="matrixL()"
|
|
1818
|
-
[matrixAutoUpdate]="false"
|
|
1819
|
-
(pointerdown)="onPointerDown($any($event))"
|
|
1820
|
-
(pointermove)="onPointerMove($any($event))"
|
|
1821
|
-
(pointerup)="onPointerUp($any($event))"
|
|
1822
|
-
(pointerout)="onPointerOut($any($event))"
|
|
1823
|
-
>
|
|
1793
|
+
<ngt-group #innerGroup [matrix]="matrixL()" [matrixAutoUpdate]="false">
|
|
1824
1794
|
@if (pivotControls.annotations()) {
|
|
1825
1795
|
<ngts-html [options]="{ position: [0, position() / 2, 0] }">
|
|
1826
1796
|
<div
|
|
@@ -2247,19 +2217,19 @@ class NgtsTransformControls {
|
|
|
2247
2217
|
});
|
|
2248
2218
|
extend({ Group });
|
|
2249
2219
|
effect((onCleanup) => {
|
|
2250
|
-
const cleanup = this.
|
|
2220
|
+
const cleanup = this.updateDefaultControlsEffect();
|
|
2251
2221
|
onCleanup(() => cleanup?.());
|
|
2252
2222
|
});
|
|
2253
2223
|
effect((onCleanup) => {
|
|
2254
|
-
const cleanup = this.
|
|
2224
|
+
const cleanup = this.attachControlsEffect();
|
|
2255
2225
|
onCleanup(() => cleanup?.());
|
|
2256
2226
|
});
|
|
2257
2227
|
effect((onCleanup) => {
|
|
2258
|
-
const cleanup = this.
|
|
2228
|
+
const cleanup = this.disableDefaultControlsEffect();
|
|
2259
2229
|
onCleanup(() => cleanup?.());
|
|
2260
2230
|
});
|
|
2261
2231
|
effect((onCleanup) => {
|
|
2262
|
-
const cleanup = this.
|
|
2232
|
+
const cleanup = this.setupControlsEventsEffect();
|
|
2263
2233
|
onCleanup(() => cleanup?.());
|
|
2264
2234
|
});
|
|
2265
2235
|
}
|