UNPKG

@threlte/rapier

Version:

Components and hooks to use the Rapier physics engine in Threlte

9 lines (8 loc) 275 B
import { getContext, setContext } from 'svelte'; const key = Symbol('threlte-rapier-rigidbody-object3d'); export const useParentRigidbodyObject = () => { return getContext(key); }; export const setParentRigidbodyObject = (object3d) => { setContext(key, object3d); };