Skip to content

Commit

Permalink
OrbitControls use declared index_in_orbitcontrols by introducing …
Browse files Browse the repository at this point in the history
…`get_index_in_orbitcontrols()` method (#143)

May be useful -> to clarify. If not remove them both, see #145
  • Loading branch information
Vatroslav Vrbanic committed Aug 19, 2022
1 parent 5bc83e9 commit e58921e
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/components/OrbitControls.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,16 @@ svelthree uses svelte-accmod, where accessors are always `true`, regardless of `
/** Display a console warning if the `OrbitControls` component's `cam` attribute was assigned a currently _inactive_ camera (also adss a `CameraHelper` to the assigned Camera). Default is `true`. Set `warn={false}` to hide the warning (_also: no `CameraHelper` be added_). */
export let warn: boolean = true
// TODO clarify why / when we would need this.
let index_in_orbitcontrols: number = undefined
/** Get `OrbitControls` three.js instance's index in the `orbitcontrols`-array (svelthreeStore).
* Can also be obtained via created `orbitcontrols` instance directly: `orbitcontrols_comp_ref.orbitcontrols.userData.index_in_orbitcontrols`
*/
export function get_index_in_orbitcontrols(): number {
return index_in_orbitcontrols
}
export let cam: PerspCamSvelthreeComponent | OrthoCamSvelthreeComponent | PerspectiveCamera | OrthographicCamera =
undefined
export let dom_el: HTMLElement | CanvasSvelthreeComponent = undefined
Expand Down

0 comments on commit e58921e

Please sign in to comment.