Skip to content

Commit

Permalink
feat(cientos): orbit controls typed
Browse files Browse the repository at this point in the history
  • Loading branch information
alvarosabu committed Mar 6, 2023
1 parent 5f20368 commit e38e699
Showing 1 changed file with 48 additions and 12 deletions.
60 changes: 48 additions & 12 deletions packages/cientos/src/core/OrbitControls.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit e38e699

Please sign in to comment.