From 82fa2ca18ac6acca0f34f8c43f2652fdd9b4a824 Mon Sep 17 00:00:00 2001 From: Alexander Date: Wed, 24 Jul 2024 01:49:20 +0200 Subject: [PATCH 1/2] wip --- src/core/controls/DragControls.vue | 69 ++++++++++++++++++++++++++++++ src/core/controls/index.ts | 2 + 2 files changed, 71 insertions(+) create mode 100644 src/core/controls/DragControls.vue diff --git a/src/core/controls/DragControls.vue b/src/core/controls/DragControls.vue new file mode 100644 index 00000000..4720b6fd --- /dev/null +++ b/src/core/controls/DragControls.vue @@ -0,0 +1,69 @@ + + + \ No newline at end of file diff --git a/src/core/controls/index.ts b/src/core/controls/index.ts index 9ca61e52..820e3714 100644 --- a/src/core/controls/index.ts +++ b/src/core/controls/index.ts @@ -5,6 +5,7 @@ import PointerLockControls from './PointerLockControls.vue' import MapControls from './MapControls.vue' import ScrollControls from './ScrollControls.vue' import CameraControls, { BaseCameraControls } from './CameraControls.vue' +import DragControls from './DragControls.vue' export { OrbitControls, @@ -15,4 +16,5 @@ export { ScrollControls, CameraControls, BaseCameraControls, + DragControls } From 58eb37f5c378f47fc9e7f4c9a57a262954b4e5eb Mon Sep 17 00:00:00 2001 From: Alexander Date: Wed, 24 Jul 2024 01:50:42 +0200 Subject: [PATCH 2/2] wip --- src/core/controls/DragControls.vue | 8 ++++---- src/core/controls/index.ts | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/core/controls/DragControls.vue b/src/core/controls/DragControls.vue index 4720b6fd..ece34835 100644 --- a/src/core/controls/DragControls.vue +++ b/src/core/controls/DragControls.vue @@ -17,7 +17,7 @@ export interface TransformControlsProps { * @memberof OrbitControlsProps * @see https://threejs.org/docs/#examples/en/controls/OrbitControls.domElement */ - domElement?: HTMLElement + domElement?: HTMLElement } withDefaults(defineProps(), { @@ -34,7 +34,7 @@ const controlsRef = ref(null) extend({ DragControls }) watchEffect(() => { - if(controlsRef.value) { + if (controlsRef.value) { addEventListeners() } }) @@ -63,7 +63,7 @@ defineExpose({ value: controlsRef }) :objects="objects" :camera="camera || activeCamera" :mode="mode" - :enabled="enabled" + :enabled="enabled" :args="[objects, camera || activeCamera, domElement || renderer.domElement]" /> - \ No newline at end of file + diff --git a/src/core/controls/index.ts b/src/core/controls/index.ts index 820e3714..0d9b1a67 100644 --- a/src/core/controls/index.ts +++ b/src/core/controls/index.ts @@ -16,5 +16,5 @@ export { ScrollControls, CameraControls, BaseCameraControls, - DragControls + DragControls, }