kick.components.FPSWalker Class
A simple walker class which can be added to a camera to navigate in a scene.
Constructor
kick.components.FPSWalker
-
config
Parameters:
-
config
Object
Item Index
Methods
Properties
Events
Methods
activated
()
Registers the object on activation
deactivated
()
getGroundHeight
-
x
-
z
Return the height of the ground at position x,z
Parameters:
-
x
Number -
z
Number
Returns:
moveObject
()
Move object based on movement keys (AWSD as default)
render
-
engineUniforms
-
[overwriteMaterial]
Abstract method called every at every rendering of the object. May be undefined.
Parameters:
-
engineUniforms
kick.scene.EngineUniforms -
[overwriteMaterial]
kick.material.Material optional
rotateObject
()
Default behavior is to rotate view whenever mouse in being pressed. The rotation around X axis is clamped to +/- 179 degrees.
setMovementKeys
-
forward_
-
backward_
-
strideLeft_
-
strideRight_
Parameters:
-
forward_
Number -
backward_
Number -
strideLeft_
Number -
strideRight_
Number
toJSON
()
JSON
Returns:
update
()
Properties
aabb
kick.math.Aabb
Defines the axis aligned bounding box used for view frustum culling May be undefined or null.
componentType
String
final
Name of the component componentType = "fpsWalker".
Example:
var fpsWalker = gameObject.fpsWalker;
gameObject
kick.scene.GameObject
The gameObject owning the component. Initially undefined. The value is set when the Component object is added to a GameObject
movementSpeed
Number
Default: 0.1
renderOrder
Number
Default value is 1000
< 1999 default geometry
1999 skybox
2001 - 2999 transparent geometry (sorted back-to-front when rendered)
> 3000 overlay geometry rendered on top
rotateSpeedX
Number
Default: 1.0
rotateSpeedY
Number
Default: 1.0
scriptPriority
Number
Components with largest priority are invoked first. (optional - default 0). Cannot be modified after creation.
Events
componentUpdated
Fire events when components are updated. May be undefined. Must be defined before adding to gameObject.
Event Payload:
-
component
kick.scene.Component