Skip to content

Documentation / @ripl/vue-3d / useRiplScene

Function: useRiplScene() ​

useRiplScene(): ShallowRef<Scene<Context<Element, Record<string, unknown>>> | undefined>

Defined in: vue/src/compositions/index.ts:55

Returns the scene provided by the nearest scene component.

Returns ​

ShallowRef<Scene<Context<Element, Record<string, unknown>>> | undefined>

The scene, or undefined when no scene component encloses the caller.

Example ​

ts
const scene = useRiplScene();

const hit = () => scene.value?.query('.segment');