Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,10 @@ AFRAME.registerComponent('orbit-controls', {
ROTATE_TO: 6
};

this.camData = {
zoomFactor: 10
}

this.state = this.STATE.NONE;

this.EPS = 0.000001;
Expand Down Expand Up @@ -915,6 +919,11 @@ AFRAME.registerComponent('orbit-controls', {
this.spherical.radius *= this.scale;
this.spherical.radius = Math.max(this.data.minDistance, Math.min(this.data.maxDistance, this.spherical.radius)); // restrict radius to be inside desired limits

if (this.camera) {
this.camData.zoomFactor = this.spherical.radius;
this.camera.userData = this.camData;
}

this.target.add(this.panOffset); // move target to panned location

offset.setFromSpherical(this.spherical);
Expand Down