Swiftly read device spacial sensors
npm install vibrisse
import { listen, sensors } from "vibrisse";
const api = listen(sensors.RadialAcceleration + sensors.LinearAcceleration, (readings) => {
const radial = readings[sensors.RadialAcceleration];
const linear = readings[sensors.LinearAcceleration];
// ...
});
api.start();
// Later
api.stop();Orientation- Read the gravity and its direction applied to the deviceRadialAcceleration- Read the change in rotation momentum of the deviceLinearAcceleration- Read the change in linear momentum of the deviceRelativeOrientation- Read the change in orientation relative to when the sensor is set up (quaternion)AbsoluteOrientation- Read the change in orientation relative to the Earth (quaternion)