FreeControl

clay.plugin. FreeControl

# new FreeControl()

Source:
Example
var control = new clay.plugin.FreeControl({
        target: camera,
        domElement: renderer.canvas
    });
    ...
    timeline.on('frame', function(frameTime) {
        control.update(frameTime);
        renderer.render(scene, camera);
    });

Members

# domElement :HTMLElement

Source:

Target dom to bind with mouse events

Type:
  • HTMLElement

# sensitivity :number

Source:

Mouse move sensitivity

Type:
  • number

# speed :number

Source:

Target move speed

Type:
  • number

# target :clay.Node

Source:

Scene node to control, mostly it is a camera

Type:

# timeline :clay.Timeline

Source:
Type:

# up :clay.Vector3

Source:

Up axis

Type:

# verticalMoveLock :boolean

Source:

If lock vertical movement

Type:
  • boolean

Methods

# dispose()

Source:

Dispose control

# init()

Source:

init control

# update(frameTime)

Source:

Control update. Should be invoked every frame

Parameters:
Name Type Description
frameTime number

Frame time