Skip to content

copper3d / Modules / Controls/Copper3dTrackballControls / Copper3dTrackballControls

Class: Copper3dTrackballControls ​

Controls/Copper3dTrackballControls.Copper3dTrackballControls

Hierarchy ​

Table of contents ​

Constructors ​

Properties ​

Methods ​

Constructors ​

constructor ​

• new Copper3dTrackballControls(object, domElement)

Parameters ​

NameType
objectPerspectiveCamera | OrthographicCamera
domElementHTMLElement

Overrides ​

EventDispatcher<Copper3dTrackballControlsEventMap&gt;.constructor

Defined in ​

src/Controls/Copper3dTrackballControls.ts:132

Properties ​

checkDistances ​

• checkDistances: () => void

Type declaration ​

▸ (): void

Returns ​

void

Defined in ​

src/Controls/Copper3dTrackballControls.ts:125


dispose ​

• dispose: () => void

Type declaration ​

▸ (): void

Returns ​

void

Defined in ​

src/Controls/Copper3dTrackballControls.ts:130


domElement ​

• domElement: HTMLElement

Defined in ​

src/Controls/Copper3dTrackballControls.ts:41


dynamicDampingFactor ​

• dynamicDampingFactor: number

Defined in ​

src/Controls/Copper3dTrackballControls.ts:54


enabled ​

• enabled: boolean

Defined in ​

src/Controls/Copper3dTrackballControls.ts:42


handleResize ​

• handleResize: () => void

Type declaration ​

▸ (): void

Returns ​

void

Defined in ​

src/Controls/Copper3dTrackballControls.ts:119


keys ​

• keys: ["KeyA", "KeyS", "KeyD"]

Defined in ​

src/Controls/Copper3dTrackballControls.ts:103


maxDistance ​

• maxDistance: number

Defined in ​

src/Controls/Copper3dTrackballControls.ts:98


maxZoom ​

• maxZoom: number

Defined in ​

src/Controls/Copper3dTrackballControls.ts:101


minDistance ​

• minDistance: number

Defined in ​

src/Controls/Copper3dTrackballControls.ts:97


minZoom ​

• minZoom: number

Defined in ​

src/Controls/Copper3dTrackballControls.ts:100


mouseButtons ​

• mouseButtons: Object

Type declaration ​

NameType
LEFT-1 | LEFT | RIGHT
MIDDLE-1 | LEFT | MIDDLE | RIGHT
RIGHT-1 | LEFT | RIGHT

Defined in ​

src/Controls/Copper3dTrackballControls.ts:105


noPan ​

• noPan: boolean

Defined in ​

src/Controls/Copper3dTrackballControls.ts:51


noRotate ​

• noRotate: boolean

Defined in ​

src/Controls/Copper3dTrackballControls.ts:49


noZoom ​

• noZoom: boolean

Defined in ​

src/Controls/Copper3dTrackballControls.ts:50


object ​

• object: PerspectiveCamera | OrthographicCamera

Defined in ​

src/Controls/Copper3dTrackballControls.ts:40


panCamera ​

• panCamera: () => void

Type declaration ​

▸ (): void

Returns ​

void

Defined in ​

src/Controls/Copper3dTrackballControls.ts:123


panSpeed ​

• panSpeed: number

Defined in ​

src/Controls/Copper3dTrackballControls.ts:47


position0 ​

• position0: Vector3

Defined in ​

src/Controls/Copper3dTrackballControls.ts:114


reset ​

• reset: () => void

Type declaration ​

▸ (): void

Returns ​

void

Defined in ​

src/Controls/Copper3dTrackballControls.ts:128


rotateCamera ​

• rotateCamera: () => void

Type declaration ​

▸ (): void

Returns ​

void

Defined in ​

src/Controls/Copper3dTrackballControls.ts:121


rotateSpeed ​

• rotateSpeed: number

Defined in ​

src/Controls/Copper3dTrackballControls.ts:45


rotationPivot ​

• rotationPivot: null | Vector3

A world-space point that rotation orbits INSTEAD of target.

panCamera translates target along with the camera, so once the reader has panned, target is wherever they dragged it to and a rotate swings the content through an arc around that empty point rather than turning it on the spot. Snapping target back to the content's centre fixes the axis but throws the pan away, because the camera re-aims at the new target.

With a pivot set, the same rotation is applied to BOTH _eye and target - rotationPivot, which is what keeps the pan. Writing q for the frame's rotation and C for the pivot:

target' = C + q(target - C) eye' = q(eye) position' = target' + eye' = C + q(position - C)

i.e. the whole camera rig rotates rigidly about C. The content turns about its own centre and stays exactly where it was panned to, because the pivot's projection on screen does not move.

null (the default) is the historical behaviour: rotation orbits target. Setting it equal to target is also a no-op, so a viewer that never pans cannot tell the difference.

Defined in ​

src/Controls/Copper3dTrackballControls.ts:95


screen ​

• screen: Object

Type declaration ​

NameType
heightnumber
leftnumber
topnumber
widthnumber

Defined in ​

src/Controls/Copper3dTrackballControls.ts:43


staticMoving ​

• staticMoving: boolean

Defined in ​

src/Controls/Copper3dTrackballControls.ts:53


target ​

• target: Vector3

Defined in ​

src/Controls/Copper3dTrackballControls.ts:111


target0 ​

• target0: Vector3

Defined in ​

src/Controls/Copper3dTrackballControls.ts:113


up0 ​

• up0: Vector3

Defined in ​

src/Controls/Copper3dTrackballControls.ts:115


update ​

• update: () => void

Type declaration ​

▸ (): void

Returns ​

void

Defined in ​

src/Controls/Copper3dTrackballControls.ts:127


updateOnInput ​

• updateOnInput: boolean

Drive the camera from the input handlers as well as from update().

Off by default, which is the historical behaviour: input handlers only record positions, and nothing moves until something calls update(). That is fine under a continuous requestAnimationFrame loop and a deadlock without one -- see the note on update().

Turn it on for on-demand rendering. Leave it off with staticMoving = false: each extra update() advances the damping decay by one step, so input-driven updates make the glide shorter.

Defined in ​

src/Controls/Copper3dTrackballControls.ts:68


zoom0 ​

• zoom0: number

Defined in ​

src/Controls/Copper3dTrackballControls.ts:116


zoomCamera ​

• zoomCamera: () => void

Type declaration ​

▸ (): void

Returns ​

void

Defined in ​

src/Controls/Copper3dTrackballControls.ts:122


zoomSpeed ​

• zoomSpeed: number

Defined in ​

src/Controls/Copper3dTrackballControls.ts:46

Methods ​

addEventListener ​

▸ addEventListener<T>(type, listener): void

Adds a listener to an event type.

Type parameters ​

NameType
Textends keyof Copper3dTrackballControlsEventMap

Parameters ​

NameTypeDescription
typeTThe type of event to listen to.
listenerEventListener<Copper3dTrackballControlsEventMap[T], T, Copper3dTrackballControls>The function that gets called when the event is fired.

Returns ​

void

Inherited from ​

EventDispatcher.addEventListener

Defined in ​

node_modules/@types/three/src/core/EventDispatcher.d.ts:52


dispatchEvent ​

▸ dispatchEvent<T>(event): void

Fire an event type.

Type parameters ​

NameType
Textends keyof Copper3dTrackballControlsEventMap

Parameters ​

NameTypeDescription
eventBaseEvent<T> & Copper3dTrackballControlsEventMap[T]The event that gets fired.

Returns ​

void

Inherited from ​

EventDispatcher.dispatchEvent

Defined in ​

node_modules/@types/three/src/core/EventDispatcher.d.ts:81


hasEventListener ​

▸ hasEventListener<T>(type, listener): boolean

Checks if listener is added to an event type.

Type parameters ​

NameType
Textends keyof Copper3dTrackballControlsEventMap

Parameters ​

NameTypeDescription
typeTThe type of event to listen to.
listenerEventListener<Copper3dTrackballControlsEventMap[T], T, Copper3dTrackballControls>The function that gets called when the event is fired.

Returns ​

boolean

Inherited from ​

EventDispatcher.hasEventListener

Defined in ​

node_modules/@types/three/src/core/EventDispatcher.d.ts:62


removeEventListener ​

▸ removeEventListener<T>(type, listener): void

Removes a listener from an event type.

Type parameters ​

NameType
Textends keyof Copper3dTrackballControlsEventMap

Parameters ​

NameTypeDescription
typeTThe type of the listener that gets removed.
listenerEventListener<Copper3dTrackballControlsEventMap[T], T, Copper3dTrackballControls>The listener function that gets removed.

Returns ​

void

Inherited from ​

EventDispatcher.removeEventListener

Defined in ​

node_modules/@types/three/src/core/EventDispatcher.d.ts:72