|
|
@@ -594,6 +594,67 @@ class OrbitControls extends Controls {
|
|
|
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * Programmatically pan the camera.
|
|
|
+ *
|
|
|
+ * @param {number} deltaX - The horizontal pan amount in pixels.
|
|
|
+ * @param {number} deltaY - The vertical pan amount in pixels.
|
|
|
+ */
|
|
|
+ pan( deltaX, deltaY ) {
|
|
|
+
|
|
|
+ this._pan( deltaX, deltaY );
|
|
|
+ this.update();
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Programmatically dolly in (zoom in for perspective camera).
|
|
|
+ *
|
|
|
+ * @param {number} dollyScale - The dolly scale factor.
|
|
|
+ */
|
|
|
+ dollyIn( dollyScale ) {
|
|
|
+
|
|
|
+ this._dollyIn( dollyScale );
|
|
|
+ this.update();
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Programmatically dolly out (zoom out for perspective camera).
|
|
|
+ *
|
|
|
+ * @param {number} dollyScale - The dolly scale factor.
|
|
|
+ */
|
|
|
+ dollyOut( dollyScale ) {
|
|
|
+
|
|
|
+ this._dollyOut( dollyScale );
|
|
|
+ this.update();
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Programmatically rotate the camera left (around the vertical axis).
|
|
|
+ *
|
|
|
+ * @param {number} angle - The rotation angle in radians.
|
|
|
+ */
|
|
|
+ rotateLeft( angle ) {
|
|
|
+
|
|
|
+ this._rotateLeft( angle );
|
|
|
+ this.update();
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Programmatically rotate the camera up (around the horizontal axis).
|
|
|
+ *
|
|
|
+ * @param {number} angle - The rotation angle in radians.
|
|
|
+ */
|
|
|
+ rotateUp( angle ) {
|
|
|
+
|
|
|
+ this._rotateUp( angle );
|
|
|
+ this.update();
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
update( deltaTime = null ) {
|
|
|
|
|
|
const position = this.object.position;
|