Home > three-story-controls > ThreeDOFControls
Control scheme for slight rotation and translation movement in response to mouse movements (designed to be used in conjunction with other control schemes)
Signature:
export declare class ThreeDOFControls implements BaseControls
Implements: BaseControls
Note: CSS property touch-action: none
will probably be needed on listener element
See ThreeDOFControlsProps for all properties that can be passed to the constructor.
const scene = new Scene()
const camera = new PerspectiveCamera(75, window.innerWidth / window.innerHeight, 0.1, 1000)
const cameraRig = new CameraRig(camera, scene)
const controls = new ThreeDOFControls(cameraRig)
controls.enable()
// render loop
function animate(t) {
controls.update(t)
}
Constructor | Modifiers | Description |
---|---|---|
(constructor)(cameraRig, props) | Constructs a new instance of the ThreeDOFControls class |
Property | Modifiers | Type | Description |
---|---|---|---|
cameraRig | CameraRig |
Method | Modifiers | Description |
---|---|---|
disable() | ||
enable() | ||
isEnabled() | ||
update(time) |