Documentation for addons provided by the project and in the examples folder.
Plugin documentation has been moved to the plugins directory.
enabled = true : booleanWhether the controls are enabled and active.
enableDamping = false : booleanFlag indicating whether residual inertial animation is played after interaction finishes.
constructor(
scene = null : Scene,
camera = null : Camera,
domElement = null : DomElement,
)Takes the scene to raycast against for click events, the camera being animated, and the dom element to listen for clicks on.
attach( domElement : DomElement ) : voidThe dom element to attach to for events.
detach() : voidDetaches from the current dom element.
setCamera( camera : Camera | null ) : voidSets the camera the controls are using.
setScene( scene : Object3D | null ) : voidThe scene to raycast against for control interactions.
update( deltaTime = null ) : voidUpdates the controls. Takes a delta time value in seconds to normalize inertia and damping speeds. Defaults to the time between call to the function.
dispose() : voidDetaches all events and makes the controls unusable.
getPivotPoint( target : Vector3 ) : targetGets the last used interaction point.
updateCameraClipPlanes( camera : Camera ) : voidUpdates the clip planes and position of the given camera so the globe is encapsulated correctly and is positioned appropriately above the terrain. Used when working with the transition manager to make sure both cameras being transitioned are positioned properly.
extends EnvironmentControls
nearMargin = 0.25 : numberThe margin around the globe to include when positioning the camera near plane as a percentage of the max radius of the tileset ellipsoid. Useful for ensuring visualizations and other models are visible around the globe.
Default is 25%.
farMargin = 0 : numberThe margin around the globe to include when positioning the camera far plane as a percentage of the max radius of the tileset ellipsoid. Useful for ensuring visualizations and other models are visible around the globe.
Default is 0%.
constructor(
scene = null : Scene,
camera = null : Camera,
domElement = null : DomElement,
)Takes the same items as EnvironmentControls in addition to the Google globe tiles renderer.
setEllipsoid( ellipsoid: Ellipsoid | null, ellipsoidGroup: Object3D | null ): voidSpecifies the ellipsoid and a group representing the frame of the ellipsoid. Handles to both objects are retained so transformations can be respected.
Helper class for performing a transition animation between a perspective and orthographic camera.
const transition = new CameraTransitionManager( perspCamera, orthoCamera );
toggleButton.addEventListener( 'click', () => transition.toggle() );
// ...
renderer.setAnimationLoop( () => {
// set transition.fixedPoint to point that should remain stable
transition.update();
renderer.render( transition.camera, scene );
} );fixedPoint = ( 0, 0, 0 ) : Vector3The point that will represents the plan that will remain fixed during the animation. This point should be in front of the cameras.
readonly animation : booleanA flag indicating whether the transition is currently animating or not.
mode : 'perspective' | 'orthographicThe current mode of the camera that is active or being transitioned to. Setting this field will immediately change the camera.
durtion = 200 : NumberThe length of time it takes to transition the camera in milliseconds.
readonly camera : CameraThe current camera to render with. Switches between the perspective camera, orthographic camera, and animated transition camera.
orthographicPositionalZoom = true : booleanWhether the orthographic camera position should be updated so be synchronized with the necessary perspective camera position so the orthographic near clip planes do not get into into unexpected configurations.
autoSync = true : booleanWhether to automatically call the "syncCameras" function when so cameras are implicitly positioned correctly for transitioning. Disable this if syncing will happen manually and small adjustments can be made.
easeFunction = x => x : ( alpha: number ) => numberFunction for defining the transition curve between cameras.
constructor( perspectiveCamera : PerspectiveCamera, orthographicCamera : OrthographicCamera )Constructor takes the two cameras to animate between.
update( deltaTime = null : number ) : voidPerforms the transition animation if active. Takes a delta time value in seconds to normalize inertia and damping speeds. Defaults to the time between call to the function.
syncCameras() : voidSynchronizes the two camera positions and views based on the focus point.
toggle() : voidStarts the transition animation.