@threlte/rapier
Version:
Components and hooks to use the Rapier physics engine in Threlte
13 lines (12 loc) • 310 B
JavaScript
import { Euler, Quaternion } from 'three';
const e = new Euler();
const q = new Quaternion();
/**
* Sets the values of a temporary Euler and returns the quaternion from that
* @param values
* @returns
*/
export const eulerToQuaternion = (values) => {
e.set(...values);
return q.setFromEuler(e);
};