-
-
Notifications
You must be signed in to change notification settings - Fork 36k
Closed
Description
Description
Calling saveState()
and reset()
on an ArcballControls
instance whose target
is off-origin resets the gizmos position and rotation center to the origin again. The value of target
remains off-origin though.
Reproduction steps
- Add ArcballControls
- Set
target
to some coordinate (away from origin) - Call
update()
to update gizmos to the newtarget
- Call
saveState()
to remember current state - gizmos are centered around
target
as expected - Call
reset()
to restore remembered state - gizmos are centered around origin -> not expected
Code
mesh.position.set(-5, 5, 5); // Move sphere away from origin
const controls = new ArcballControls(camera, canvas, scene);
controls.target.set(-5, 5, 5); // look at center of sphere
controls.update(); // update gizmos
controls.saveState();
console.log(controls.target); // Object { x: -5, y: 5, z: 5 }
console.log(controls._gizmos.position); // Object { x: -5, y: 5, z: 5 }
controls.reset();
console.log(controls.target); // Object { x: -5, y: 5, z: 5 }
console.log(controls._gizmos.position); // Object { x: 0, y: 0, z: 0 }
}
Live example
- jsfiddle with the code above, was used to generate the screenshots below
Screenshots
Version
r176
Device
Desktop
Browser
Firefox
OS
Windows
Mugen87