UNPKG

@threlte/xr

Version:

Tools to more easily create VR and AR experiences with Threlte

34 lines (33 loc) 1.14 kB
import { Group } from 'three'; import { type Props } from '@threlte/core'; import type { Snippet } from 'svelte'; interface XROriginProps extends Props<Group> { ref?: Group; children?: Snippet<[{ ref: Group; }]>; } /** * `<XROrigin />` represents the position of the XR user's feet. The XR * camera (headset) is parented to this group, and any `<Controller>` / `<Hand>` * components nested inside attach here instead of the scene root. Transforming * the origin (position, rotation, scale) transforms the user in the scene — * useful for teleportation, dolly rigs, and resizing the user. * * Only one `<XROrigin>` may be mounted within a given `<XR>`. * * ```svelte * <XROrigin position={[0, 0, 5]} rotation.y={Math.PI}> * <Controller left /> * <Controller right /> * <Hand left /> * <Hand right /> * </XROrigin> * ``` * * Without an `<XROrigin>`, controllers and hands continue to attach to the * scene root (existing behaviour, unchanged). */ declare const XrOrigin: import("svelte").Component<XROriginProps, {}, "ref">; type XrOrigin = ReturnType<typeof XrOrigin>; export default XrOrigin;