# new GamepadControl()
- Source:
Gamepad Control plugin.
Example
init: function(app) {
this._gamepadControl = new clay.plugin.GamepadControl({
target: camera,
onStandardGamepadReady: customCallback
});
},
loop: function(app) {
this._gamepadControl.update(app.frameTime);
}
Members
# lookAroundSpeed :number
- Source:
Look around speed.
Type:
- number
# moveSpeed :number
- Source:
Move speed.
Type:
- number
# target :clay.Node
- Source:
Scene node to control, mostly it is a camera.
Type:
# timeline :clay.Timeline
- Source:
Timeline.
Type:
# up :clay.Vector3
- Source:
Up axis.
Type:
Methods
# dispose()
- Source:
Dispose control.
# init()
- Source:
Init. control.
# onGamepadDisconnected()
- Source:
Function to be called when a gamepad is disconnected.
# onStandardGamepadReady()
- Source:
Function to be called when a standard gamepad is ready to use.
# update(frameTime)
- Source:
Control's update. Should be invoked every frame.
Parameters:
Name | Type | Description |
---|---|---|
frameTime |
number | Frame time. |