Documentation

Classes

Class CL3D.AnimatorCameraFPS

Special scene node animator for first person shooter cameras.

Extends CL3D.Animator.

Class Overview
CL3D.AnimatorCameraFPS(cam, engine)
Special scene node animator for first person shooter cameras. This scene node animator can be attached to a CL3D.CameraSceneNode to make it act like a first person shooter. By pressing the cursor keys or WASD, the camera will move and by having the mouse button pressed while moving, the camera will look around.
Parameters:
{CL3D.CameraSceneNode} cam
an instance of a CL3D.CameraSceneNode this animator will be attached to. Can be null if the camera is not yet known.
{CL3D.CopperLicht} engine
An instance of the CopperLicht 3d engine, for receiving the mouse and keyboard input.

Field Summary
Field Attributes Field Name and Description
 
Maximal jump speed the user is able to jump with this camera.
 
Maximal vertical angle the user is able to look.
 
Defines if the animator may move the camera
 
Defines if the animator may zoom the camera
 
Maximal movment speed of the camera.
 
Defines if the animator may only move the camera horizontally
 
Maximal rotation speed the user is able to look.
Method Summary
Method Attributes Method Name and Description
 
animateNode(n, timeMs)
Animates the scene node it is attached to and returns true if scene node was modified.
 
Returns the type of the animator.
 
lookAt(target)
Lets the camera look at the specified point.
 
Sets if the camera look direction is moved by the cursor when the mouse is down or not
 
Sets if the animator may move the camera
Methods borrowed from class CL3D.Animator:
createClone, onKeyDown, onKeyUp, onMouseDown, onMouseMove, onMouseUp, onMouseWheel
Field Detail
{Number} JumpSpeed
Maximal jump speed the user is able to jump with this camera.
Default Value:
0

{Number} MaxVerticalAngle
Maximal vertical angle the user is able to look.
Default Value:
88

{Boolean} MayMove
Defines if the animator may move the camera
Default Value:
true

{Boolean} MayZoom
Defines if the animator may zoom the camera
Default Value:
true

{Number} MoveSpeed
Maximal movment speed of the camera.
Default Value:
0.06

{Boolean} NoVerticalMovement
Defines if the animator may only move the camera horizontally
Default Value:
false

{Number} RotateSpeed
Maximal rotation speed the user is able to look.
Default Value:
200.0
Method Detail
animateNode(n, timeMs)
Animates the scene node it is attached to and returns true if scene node was modified.
Parameters:
{CL3D.SceneNode} n
The Scene node which needs to be animated this frame.
{Integer} timeMs
The time in milliseconds since the start of the scene.

getType()
Returns the type of the animator. For the AnimatorCameraFPS, this will return 'camerafps'.

lookAt(target)
Lets the camera look at the specified point.
Parameters:
target
target 3d position of type Vect3d.

{Boolean} setLookByMouseDown(b)
Sets if the camera look direction is moved by the cursor when the mouse is down or not
Parameters:
b

{Boolean} setMayMove(b)
Sets if the animator may move the camera
Parameters:
b

© 2011-2018 N.Gebhardt, Ambiera
Documentation generated by JsDoc Toolkit