Skip to content

Commit ffb5705

Browse files
committed
add comment
1 parent 0e75b29 commit ffb5705

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

three.js/src/location-based/js/device-orientation-controls.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@ const _q1 = new Quaternion(-Math.sqrt(0.5), 0, 0, Math.sqrt(0.5)); // - PI/2 aro
1717
const _changeEvent = { type: "change" };
1818

1919
class DeviceOrientationControls extends EventDispatcher {
20+
/**
21+
* Create an instance of DeviceOrientationControls.
22+
* @param {Object} object - the object to attach the controls to
23+
* (usually your Three.js camera)
24+
*/
2025
constructor(object) {
2126
super();
2227

@@ -94,6 +99,10 @@ class DeviceOrientationControls extends EventDispatcher {
9499
quaternion.multiply(_q0.setFromAxisAngle(_zee, -orient)); // adjust for screen orientation
95100
};
96101

102+
/**
103+
* Update the device orientation controls.
104+
* Should be called from your three.js rendering/animation function.
105+
*/
97106
this.connect = function () {
98107
onScreenOrientationChangeEvent(); // run once on load
99108

0 commit comments

Comments
 (0)