提交 a468f77c 编写于 作者: S Sami Kolari

fix rotation amount when damping is used

上级 4fdbcc88
......@@ -155,8 +155,17 @@ THREE.OrbitControls = function ( object, domElement ) {
}
spherical.theta += sphericalDelta.theta;
spherical.phi += sphericalDelta.phi;
if ( scope.enableDamping ) {
spherical.theta += sphericalDelta.theta * scope.dampingFactor;
spherical.phi += sphericalDelta.phi * scope.dampingFactor;
} else {
spherical.theta += sphericalDelta.theta;
spherical.phi += sphericalDelta.phi;
}
// restrict theta to be between desired limits
spherical.theta = Math.max( scope.minAzimuthAngle, Math.min( scope.maxAzimuthAngle, spherical.theta ) );
......
......@@ -165,8 +165,17 @@ var OrbitControls = function ( object, domElement ) {
}
spherical.theta += sphericalDelta.theta;
spherical.phi += sphericalDelta.phi;
if ( scope.enableDamping ) {
spherical.theta += sphericalDelta.theta * scope.dampingFactor;
spherical.phi += sphericalDelta.phi * scope.dampingFactor;
} else {
spherical.theta += sphericalDelta.theta;
spherical.phi += sphericalDelta.phi;
}
// restrict theta to be between desired limits
spherical.theta = Math.max( scope.minAzimuthAngle, Math.min( scope.maxAzimuthAngle, spherical.theta ) );
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册