-
Notifications
You must be signed in to change notification settings - Fork 0
MotionManager
Hizuvi edited this page Jul 8, 2021
·
3 revisions
Getting input in an easy way.
Takes input from the device and converts it to rotation and movement. The rotation is how much the device is rotated. On a mobile device this is the tilt, left to right, and on computers this is the mouse's x position. The movement is the acceleration converted to one direction. On computers this the y movement of the mouse. Movement should be smoothed to avoid jitter and small movement from the users hands. This also helps people with disabilities to a certain degree.
const motionManager = new MotionManager();
const rotation = motionManager.rotation; //How rotated the device is
const movement = motionManager.movement; //How much the device moved