import Quaternion from '@mobilizing/library/js/Mobilizing/renderer/3D/three/types/Quaternion.js'
Quaternion
Extends:
Represents a Quaternion, a way to describe a spatial rotation that is less susceptible to gimbal lock.
This class extends the one from Three.js, API available here : https://threejs.org/docs/index.html#api/en/math/Quaternion
Method Summary
Public Methods | ||
public | ||
public | setFromGyro(compass: *) Can be used in the transform of a perspective camera to produce a "blind camera" effect : move the screen around to frame a part of the current scene like if you were using a camera. |
Private Methods | ||
private | createGyroQuaternion(alpha: Number, beta: Number, gamma: Number, screenOrientation: Object) Creates a Quaternion that matches the device's current orientation. Calculated in radians. |
Public Methods
public setFromGyro(compass: *) source
Can be used in the transform of a perspective camera to produce a "blind camera" effect : move the screen around to frame a part of the current scene like if you were using a camera.
Params:
Name | Type | Attribute | Description |
compass | * |
Private Methods
private createGyroQuaternion(alpha: Number, beta: Number, gamma: Number, screenOrientation: Object) source
Creates a Quaternion that matches the device's current orientation. Calculated in radians.
Params:
Name | Type | Attribute | Description |
alpha | Number | the angle to use for the quaternion creation | |
beta | Number | the angle to use for the quaternion creation | |
gamma | Number | the angle to use for the quaternion creation | |
screenOrientation | Object | orientation of the screen in degree! Can be very different depending on the plateform... |