OrbitControl

clay.plugin. OrbitControl

# new OrbitControl()

Source:

Extends

Members

# __uid__ :number

Source:
Inherited From:
Type:
  • number

# _center :clay.Vector3

Source:
Type:

# _mode :String

Source:

Pan or rotate

Type:
  • String

# autoRotateAfterStill

Source:

Start auto rotating after still for the given time

# autoRotateDirection

Source:

Direction of autoRotate. cw or ccw when looking top down.

# autoRotateSpeed

Source:

Degree per second

# damping

Source:

# domElement :HTMLElement

Source:
Type:
  • HTMLElement

# maxAlpha

Source:

Maximum alpha rotation

# maxBeta

Source:

Maximum beta rotation

# maxDistance :number

Source:
Default Value:
  • 2

Maximum distance to the center

Type:
  • number

# maxOrthographicSize

Source:

Only available when camera is orthographic

# minAlpha

Source:

Minimum alpha rotation

# minBeta

Source:

Minimum beta rotation

# minDistance :number

Source:
Default Value:
  • 0.5

Minimum distance to the center

Type:
  • number

# minOrthographicSize

Source:

Only available when camera is orthographic

# orthographicAspect

Source:

Aspect of orthographic camera Only available when camera is orthographic

# panSensitivity

Source:

# rotateSensitivity

Source:

# target :clay.Node

Source:
Type:

# timeline :clay.Timeline

Source:
Type:

# zoomSensitivity

Source:

Methods

# after(name, action, contextopt)

Source:
Inherited From:
Mixes In:

Alias of once('after' + name)

Parameters:
Name Type Attributes Description
name string
action function
context Object <optional>

# animateTo(opts)

Source:
Parameters:
Name Type Description
opts Object
Properties
Name Type Attributes Default Description
distance number
orthographicSize number
alpha number
beta number
center Array.<number>
duration number <optional>
1000
easing number <optional>
'linear'
done number <optional>

# before(name, action, contextopt)

Source:
Inherited From:
Mixes In:

Alias of once('before' + name)

Parameters:
Name Type Attributes Description
name string
action function
context Object <optional>

# dispose()

Source:

Dispose. Mouse event unbinding

# error(action, contextopt)

Source:
Inherited From:
Mixes In:

Alias of on('error')

Parameters:
Name Type Attributes Description
action function
context Object <optional>

# getAlpha()

Source:

Get alpha rotation Alpha angle for top-down rotation. Positive to rotate to top.

Which means camera rotation around x axis.

# getBeta()

Source:

Get beta rotation Beta angle for left-right rotation. Positive to rotate to right.

Which means camera rotation around y axis.

# getCenter() → {Array.<number>}

Source:

Get control center

Returns:
Type
Array.<number>

# getDistance() → {number}

Source:

Get distance

Returns:
Type
number

# getOrthographicSize() → {number}

Source:

Get size of orthographic viewing volume

Returns:
Type
number

# has(name, action) → {boolean}

Source:
Inherited From:
Mixes In:

If registered the event handler

Parameters:
Name Type Description
name string
action function
Returns:
Type
boolean

# init()

Source:

Initialize. Mouse event binding

# off(action, contextopt)

Source:
Inherited From:
Mixes In:

Remove event listener

Parameters:
Name Type Attributes Description
action function
context Object <optional>

# on(name, action, contextopt)

Source:
Inherited From:
Mixes In:

Register event handler

Parameters:
Name Type Attributes Description
name string
action function
context Object <optional>

# once(name, action, contextopt)

Source:
Inherited From:
Mixes In:

Register event, event will only be triggered once and then removed

Parameters:
Name Type Attributes Description
name string
action function
context Object <optional>

# setAlpha(alpha)

Source:

Set alpha rotation angle

Parameters:
Name Type Description
alpha number

# setBeta(beta)

Source:

Set beta rotation angle

Parameters:
Name Type Description
beta number

# setCenter(center)

Source:

Set control center

Parameters:
Name Type Description
center Array.<number>

# setDistance(distance)

Source:

Set distance

Parameters:
Name Type Description
distance number

# setOrthographicSize(size)

Source:

Set size of orthographic viewing volume

Parameters:
Name Type Description
size number

# stopAllAnimation()

Source:

Stop all animations

# success(action, contextopt)

Source:
Inherited From:
Mixes In:

Alias of on('success')

Parameters:
Name Type Attributes Description
action function
context Object <optional>

# trigger(name)

Source:
Inherited From:
Mixes In:

Trigger event

Parameters:
Name Type Description
name string

# update(deltaTime)

Source:

Call update each frame

Parameters:
Name Type Description
deltaTime number

Frame time