Only zoom sidebar globe if mouse button is pressed down
This commit is contained in:
parent
2e74b73ba0
commit
09413f5fc7
2 changed files with 3 additions and 3 deletions
|
@ -410,6 +410,7 @@ DAT.Globe = function(container, opts) {
|
|||
}
|
||||
|
||||
function onMouseWheel(event) {
|
||||
if (container.style.cursor != "move") return false;
|
||||
event.preventDefault();
|
||||
if (overRenderer) {
|
||||
if (event.deltaY) {
|
||||
|
@ -471,7 +472,6 @@ DAT.Globe = function(container, opts) {
|
|||
function unload() {
|
||||
running = false
|
||||
container.removeEventListener('mousedown', onMouseDown, false);
|
||||
container.removeEventListener('mousewheel', onMouseWheel, false);
|
||||
if ('onwheel' in document) {
|
||||
container.removeEventListener('wheel', onMouseWheel, false);
|
||||
} else {
|
||||
|
@ -526,7 +526,6 @@ DAT.Globe = function(container, opts) {
|
|||
|
||||
|
||||
|
||||
|
||||
/* ---- plugins/Sidebar/media-globe/three.min.js ---- */
|
||||
|
||||
|
||||
|
@ -1343,4 +1342,4 @@ THREE.MorphBlendMesh.prototype.setAnimationDirectionForward=function(a){if(a=thi
|
|||
THREE.MorphBlendMesh.prototype.setAnimationDuration=function(a,b){var c=this.animationsMap[a];c&&(c.duration=b,c.fps=(c.end-c.start)/c.duration)};THREE.MorphBlendMesh.prototype.setAnimationWeight=function(a,b){var c=this.animationsMap[a];c&&(c.weight=b)};THREE.MorphBlendMesh.prototype.setAnimationTime=function(a,b){var c=this.animationsMap[a];c&&(c.time=b)};THREE.MorphBlendMesh.prototype.getAnimationTime=function(a){var b=0;if(a=this.animationsMap[a])b=a.time;return b};
|
||||
THREE.MorphBlendMesh.prototype.getAnimationDuration=function(a){var b=-1;if(a=this.animationsMap[a])b=a.duration;return b};THREE.MorphBlendMesh.prototype.playAnimation=function(a){var b=this.animationsMap[a];b?(b.time=0,b.active=!0):console.warn("animation["+a+"] undefined")};THREE.MorphBlendMesh.prototype.stopAnimation=function(a){if(a=this.animationsMap[a])a.active=!1};
|
||||
THREE.MorphBlendMesh.prototype.update=function(a){for(var b=0,c=this.animationsList.length;b<c;b++){var d=this.animationsList[b];if(d.active){var e=d.duration/d.length;d.time+=d.direction*a;if(d.mirroredLoop){if(d.time>d.duration||0>d.time)d.direction*=-1,d.time>d.duration&&(d.time=d.duration,d.directionBackwards=!0),0>d.time&&(d.time=0,d.directionBackwards=!1)}else d.time%=d.duration,0>d.time&&(d.time+=d.duration);var f=d.startFrame+THREE.Math.clamp(Math.floor(d.time/e),0,d.length-1),g=d.weight;
|
||||
f!==d.currentFrame&&(this.morphTargetInfluences[d.lastFrame]=0,this.morphTargetInfluences[d.currentFrame]=1*g,this.morphTargetInfluences[f]=0,d.lastFrame=d.currentFrame,d.currentFrame=f);e=d.time%e/e;d.directionBackwards&&(e=1-e);this.morphTargetInfluences[d.currentFrame]=e*g;this.morphTargetInfluences[d.lastFrame]=(1-e)*g}}};
|
||||
f!==d.currentFrame&&(this.morphTargetInfluences[d.lastFrame]=0,this.morphTargetInfluences[d.currentFrame]=1*g,this.morphTargetInfluences[f]=0,d.lastFrame=d.currentFrame,d.currentFrame=f);e=d.time%e/e;d.directionBackwards&&(e=1-e);this.morphTargetInfluences[d.currentFrame]=e*g;this.morphTargetInfluences[d.lastFrame]=(1-e)*g}}};
|
||||
|
|
|
@ -321,6 +321,7 @@ DAT.Globe = function(container, opts) {
|
|||
}
|
||||
|
||||
function onMouseWheel(event) {
|
||||
if (container.style.cursor != "move") return false;
|
||||
event.preventDefault();
|
||||
if (overRenderer) {
|
||||
if (event.deltaY) {
|
||||
|
|
Loading…
Reference in a new issue