Skip to content
This repository has been archived by the owner on Feb 10, 2023. It is now read-only.

Commit

Permalink
fix(soba): adjust orbit controls to use NumberInput
Browse files Browse the repository at this point in the history
  • Loading branch information
nartc committed Apr 18, 2022
1 parent 1122e23 commit e48a504
Showing 1 changed file with 30 additions and 28 deletions.
58 changes: 30 additions & 28 deletions libs/soba/controls/src/lib/orbit-controls/orbit-controls.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import {
BooleanInput,
coerceBooleanProperty,
coerceNumberProperty,
NgtInstance,
NgtInstanceState,
NgtVector3,
NumberInput,
provideInstanceRef,
tapEffect,
} from '@angular-three/core';
Expand Down Expand Up @@ -63,64 +65,64 @@ export class NgtSobaOrbitControls extends NgtInstance<
this.set({ enableDamping: coerceBooleanProperty(enableDamping) });
}

@Input() set minDistance(minDistance: number) {
this.set({ minDistance });
@Input() set minDistance(minDistance: NumberInput) {
this.set({ minDistance: coerceNumberProperty(minDistance) });
}

@Input() set maxDistance(maxDistance: number) {
this.set({ maxDistance });
@Input() set maxDistance(maxDistance: NumberInput) {
this.set({ maxDistance: coerceNumberProperty(maxDistance) });
}

@Input() set minZoom(minZoom: number) {
this.set({ minZoom });
@Input() set minZoom(minZoom: NumberInput) {
this.set({ minZoom: coerceNumberProperty(minZoom) });
}

@Input() set maxZoom(maxZoom: number) {
this.set({ maxZoom });
@Input() set maxZoom(maxZoom: NumberInput) {
this.set({ maxZoom: coerceNumberProperty(maxZoom) });
}

@Input() set minPolarAngle(minPolarAngle: number) {
this.set({ minPolarAngle });
@Input() set minPolarAngle(minPolarAngle: NumberInput) {
this.set({ minPolarAngle: coerceNumberProperty(minPolarAngle) });
}

@Input() set maxPolarAngle(maxPolarAngle: number) {
this.set({ maxPolarAngle });
@Input() set maxPolarAngle(maxPolarAngle: NumberInput) {
this.set({ maxPolarAngle: coerceNumberProperty(maxPolarAngle) });
}

@Input() set minAzimuthAngle(minAzimuthAngle: number) {
this.set({ minAzimuthAngle });
@Input() set minAzimuthAngle(minAzimuthAngle: NumberInput) {
this.set({ minAzimuthAngle: coerceNumberProperty(minAzimuthAngle) });
}

@Input() set maxAzimuthAngle(maxAzimuthAngle: number) {
this.set({ maxAzimuthAngle });
@Input() set maxAzimuthAngle(maxAzimuthAngle: NumberInput) {
this.set({ maxAzimuthAngle: coerceNumberProperty(maxAzimuthAngle) });
}

@Input() set dampingFactor(dampingFactor: number) {
this.set({ dampingFactor });
@Input() set dampingFactor(dampingFactor: NumberInput) {
this.set({ dampingFactor: coerceNumberProperty(dampingFactor) });
}

@Input() set enableZoom(enableZoom: BooleanInput) {
this.set({ enableZoom: coerceBooleanProperty(enableZoom) });
}

@Input() set zoomSpeed(zoomSpeed: number) {
this.set({ zoomSpeed });
@Input() set zoomSpeed(zoomSpeed: NumberInput) {
this.set({ zoomSpeed: coerceNumberProperty(zoomSpeed) });
}

@Input() set enableRotate(enableRotate: BooleanInput) {
this.set({ enableRotate: coerceBooleanProperty(enableRotate) });
}

@Input() set rotateSpeed(rotateSpeed: number) {
this.set({ rotateSpeed });
@Input() set rotateSpeed(rotateSpeed: NumberInput) {
this.set({ rotateSpeed: coerceNumberProperty(rotateSpeed) });
}

@Input() set enablePan(enablePan: BooleanInput) {
this.set({ enablePan: coerceBooleanProperty(enablePan) });
}

@Input() set panSpeed(panSpeed: number) {
this.set({ panSpeed });
@Input() set panSpeed(panSpeed: NumberInput) {
this.set({ panSpeed: coerceNumberProperty(panSpeed) });
}

@Input() set screenSpacePanning(screenSpacePanning: BooleanInput) {
Expand All @@ -129,16 +131,16 @@ export class NgtSobaOrbitControls extends NgtInstance<
});
}

@Input() set keyPanSpeed(keyPanSpeed: number) {
this.set({ keyPanSpeed });
@Input() set keyPanSpeed(keyPanSpeed: NumberInput) {
this.set({ keyPanSpeed: coerceNumberProperty(keyPanSpeed) });
}

@Input() set autoRotate(autoRotate: BooleanInput) {
this.set({ autoRotate: coerceBooleanProperty(autoRotate) });
}

@Input() set autoRotateSpeed(autoRotateSpeed: number) {
this.set({ autoRotateSpeed });
@Input() set autoRotateSpeed(autoRotateSpeed: NumberInput) {
this.set({ autoRotateSpeed: coerceNumberProperty(autoRotateSpeed) });
}

@Input() set reverseOrbit(reverseOrbit: BooleanInput) {
Expand Down

0 comments on commit e48a504

Please sign in to comment.