eye, look, and up vectors. The coordinates will be manipulated by this object.
The browser window. Used to add listeners for mouse and keyboard events.
Notifies this instance that something is referencing it.
The new value of the reference count.
Returns the name that was assigned by the call to the setLoggingName method.
This should be called whenever the window is resized.
An object is a zombie if it has been released by all who have held references. In some cases it may be possible to recycle a zombie.
Simulates a movement of the mouse in coordinates -1 to +1 in both directions.
Notifies this instance that something is dereferencing it.
The new value of the reference count.
This method is for use within constructors.
Immediately after a call to the super class constructor, make a call to setLoggingName. This will have the effect of refining the name used for reporting reference counts.
This method has the secondary purpose of enabling a tally of the number of classes in the constructor chain. This enables the runtime architecture to verify that destructor chains are consistent with constructor chains, which is a good practice for cleaning up resources.
Notice that this method is intentionally protected to discourage it from being called outside of the constructor.
This will usually be set to the name of the class.
This should be called inside the animation frame to update the camera location. Notice that the movement of the mouse controls is decoupled from the effect. We also want to avoid temporary object creation in this and called methods by recycling variables.
Generated using TypeDoc
Allows a camera to be manipulated using mouse controls.
// The trackball controls a view implementation such as a camera. const camera = new EIGHT.PerspectiveCamera() // Create TrackballControls anytime. const controls = new EIGHT.TrackballControls(camera) // Subscribe to mouse events, usually in the window.onload function. controls.subscribe(canvas) // Update the camera position, usually in the animate function. controls.update() // Stop listening to mouse events. controls.unsubscribe() // Inform the controls they are no longer needed, usually in the window.onunload function. controls.release()
You may decide to update directional lighting to synchronize with the camera.