提交 d946b8e0 编写于 作者: W WestLangley

OrbitControls: added reset()

上级 40f145ee
......@@ -103,6 +103,11 @@ THREE.OrbitControls = function ( object, domElement ) {
var state = STATE.NONE;
// for reset
this.target0 = this.target.clone();
this.position0 = this.object.position.clone();
// events
var changeEvent = { type: 'change' };
......@@ -279,6 +284,17 @@ THREE.OrbitControls = function ( object, domElement ) {
};
this.reset = function () {
state = STATE.NONE;
this.target.copy( this.target0 );
this.object.position.copy( this.position0 );
this.update();
};
function getAutoRotationAngle() {
return 2 * Math.PI / 60 / 60 * scope.autoRotateSpeed;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册