|
@@ -5,18 +5,54 @@ import { ref, watch, unref, type Ref } from 'vue'
|
|
|
|
|
|
import { useCientos } from './useCientos'
|
|
|
|
|
|
-const props = withDefaults(
|
|
|
- defineProps<{
|
|
|
- makeDefault?: boolean
|
|
|
- camera?: Camera
|
|
|
- domElement?: HTMLElement
|
|
|
- target?: Ref<Vector3>
|
|
|
- enableDamping?: boolean
|
|
|
- }>(),
|
|
|
- {
|
|
|
- makeDefault: false,
|
|
|
- },
|
|
|
-)
|
|
|
+export interface OrbitControlsProps {
|
|
|
+ /**
|
|
|
+ * Whether to make this the default controls.
|
|
|
+ *
|
|
|
+ * @default false
|
|
|
+ * @type {boolean}
|
|
|
+ * @memberof OrbitControlsProps
|
|
|
+ * @see https://threejs.org/docs/#examples/en/controls/OrbitControls
|
|
|
+ */
|
|
|
+ makeDefault?: boolean
|
|
|
+ /**
|
|
|
+ * The camera to control.
|
|
|
+ *
|
|
|
+ * @type {Camera}
|
|
|
+ * @memberof OrbitControlsProps
|
|
|
+ * @see https://threejs.org/docs/#examples/en/controls/OrbitControls
|
|
|
+ */
|
|
|
+ camera?: Camera
|
|
|
+ /**
|
|
|
+ * The dom element to listen to.
|
|
|
+ *
|
|
|
+ * @type {HTMLElement}
|
|
|
+ * @memberof OrbitControlsProps
|
|
|
+ * @see https://threejs.org/docs/#examples/en/controls/OrbitControls
|
|
|
+ */
|
|
|
+ domElement?: HTMLElement
|
|
|
+ /**
|
|
|
+ * The target to orbit around.
|
|
|
+ *
|
|
|
+ * @type {Ref<Vector3>}
|
|
|
+ * @memberof OrbitControlsProps
|
|
|
+ * @see https://threejs.org/docs/#examples/en/controls/OrbitControls
|
|
|
+ */
|
|
|
+ target?: Ref<Vector3>
|
|
|
+ /**
|
|
|
+ * Whether to enable damping.
|
|
|
+ *
|
|
|
+ * @default false
|
|
|
+ * @type {boolean}
|
|
|
+ * @memberof OrbitControlsProps
|
|
|
+ * @see https://threejs.org/docs/#examples/en/controls/OrbitControls
|
|
|
+ */
|
|
|
+ enableDamping?: boolean
|
|
|
+}
|
|
|
+
|
|
|
+const props = withDefaults(defineProps<OrbitControlsProps>(), {
|
|
|
+ makeDefault: false,
|
|
|
+})
|
|
|
|
|
|
const { state, setState, extend } = useCientos()
|
|
|
|