OrbitalControls

Lore. OrbitalControls

A class representing orbital controls.

Constructor

new OrbitalControls(renderer, radius, lookAt)

Source:
Properties:
Name Type Attributes Default Description
up Lore.Vector3f

The global up vector.

radius Number

The distance from the camera to the lookat vector.

yRotationLimit Number <optional>
Math.PI

The limit for the vertical rotation.

spherical Lore.SphericalCoords

The spherical coordinates of the camera on the sphere around the lookat vector.

scale Number

The sensitivity scale.

camera Lore.CameraBase

The camera associated with these controls.

Creates an instance of OrbitalControls.

Parameters:
Name Type Description
renderer Lore.Renderer

An instance of a Lore renderer.

radius Lore.Number

The distance of the camera to the lookat vector.

lookAt Lore.Vector3f

The lookat vector.

Methods

limitRotationToHorizon(limit) → {Lore.OrbitalControls}

Source:

Limit the vertical rotation to the horizon (the upper hemisphere).

Parameters:
Name Type Description
limit Boolean

A boolean indicating whether or not to limit the vertical rotation to the horizon.

Returns:

Returns itself.

Type
Lore.OrbitalControls

setBackView() → {Lore.OrbitalControls}

Source:

Set the camera to the back view (locks rotation).

Returns:

Returns itself.

Type
Lore.OrbitalControls

setBottomView() → {Lore.OrbitalControls}

Source:

Set the camera to the bottom view (locks rotation).

Returns:

Returns itself.

Type
Lore.OrbitalControls

setFreeView() → {Lore.OrbitalControls}

Source:

Set the camera to free view (unlocks rotation).

Returns:

Returns itself.

Type
Lore.OrbitalControls

setFrontView() → {Lore.OrbitalControls}

Source:

Set the camera to the front view (locks rotation).

Returns:

Returns itself.

Type
Lore.OrbitalControls

setLeftView() → {Lore.OrbitalControls}

Source:

Set the camera to the left view (locks rotation).

Returns:

Returns itself.

Type
Lore.OrbitalControls

setRadius(radius) → {Lore.OrbitalControls}

Source:

Sets the distance (radius of the sphere) from the lookat vector to the camera.

Parameters:
Name Type Description
radius Number

The radius.

Returns:

Returns itself.

Type
Lore.OrbitalControls

setRightView() → {Lore.OrbitalControls}

Source:

Set the camera to the right view (locks rotation).

Returns:

Returns itself.

Type
Lore.OrbitalControls

setTopView() → {Lore.OrbitalControls}

Source:

Set the camera to the top view (locks rotation).

Returns:

Returns itself.

Type
Lore.OrbitalControls

setView(phi, theta) → {Lore.OrbitalControls}

Source:

Moves the camera around the sphere by spherical coordinates.

Parameters:
Name Type Description
phi Number

The phi component of the spherical coordinates.

theta Number

The theta component of the spherical coordinates.

Returns:

Returns itself.

Type
Lore.OrbitalControls

setZoom(zoom) → {Lore.OrbitalControls}

Source:

Set the zoom to a given value.

Parameters:
Name Type Description
zoom Number

The zoom value.

Returns:

Returns itself.

Type
Lore.OrbitalControls

update(e, source) → {Lore.OrbitalControls}

Source:

Update the camera (on mouse move, touch drag, mousewheel scroll, ...).

Parameters:
Name Type Description
e *

A mouse or touch events data.

source String

The source of the input ('left', 'middle', 'right', 'wheel', ...).

Returns:

Returns itself.

Type
Lore.OrbitalControls

zoomIn() → {Lore.OrbitalControls}

Source:

Zoom in on the lookat vector.

Returns:

Returns itself.

Type
Lore.OrbitalControls

zoomOut() → {Lore.OrbitalControls}

Source:

Zoom out from the lookat vector.

Returns:

Returns itself.

Type
Lore.OrbitalControls