Skip to content

Commit

Permalink
feat(controls): add state controls at view init
Browse files Browse the repository at this point in the history
  • Loading branch information
AnthonyGlt committed Sep 24, 2024
1 parent e386637 commit 868889f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Controls/GlobeControls.js
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,8 @@ let previous;
* @property {boolean} enableDamping Enable damping or not (simulates the lag that a real camera
* operator introduces while operating a heavy physical camera). Default is true.
* @property {boolean} dampingMoveFactor the damping move factor. Default is 0.25.
* @property {StateControl~State} stateControl redefining which controls state is triggered by the keyboard/mouse
* event (For example, rewrite the PAN movement to be triggered with the 'left' mouseButton instead of 'right').
*/
class GlobeControls extends THREE.EventDispatcher {
constructor(view, placement, options = {}) {
Expand All @@ -189,7 +191,7 @@ class GlobeControls extends THREE.EventDispatcher {
this.camera = view.camera3D;

// State control
this.states = new StateControl(this.view);
this.states = new StateControl(this.view, options.stateControl);

// this.enabled property has moved to StateControl
Object.defineProperty(this, 'enabled', {
Expand Down

0 comments on commit 868889f

Please sign in to comment.