IrrAddFPSCamera

section index

## NAME

IrrAddFPSCamera - add a basic first person perspective camera to the scene

## SYNOPSIS

*CameraSceneNode.l = IrrAddFPSCamera( [bVerticalMovement.l, rotateSpeed.f, moveSpeed.f, keyMapSize.l, *keyMapArray.IRR_KEYMAP])

## INPUTS

bVerticalMovement.l | - | Setting this to true makes the camera only move within a horizontal plane, and disables vertical movement as known from most ego shooters. Default is 'false', with which it is possible to fly around in space, if no gravity is there.
rotateSpeed.f | - | Speed with wich the camera is rotated. This can be done only with the mouse.
moveSpeed.f | - | Speed with which the camera is moved. Movement is done with the cursor keys.
keyMapSize.l | - | Amount of items in the keymap array.
*keyMapArray.IRR_KEYMAP | - | Optional pointer to an array of a keymap, specifying what keys should be used to move the camera. If this is null, the default keymap is used. You can define actions more then one time in the array, to bind multiple keys to the same action.

## FUNCTION

Adds a camera scene node which is able to be controlled with the mouse and keys like in most first person shooters (FPS). Look with the mouse, move with cursor keys. If you do not like the default key layout, you may want to specify your own.

## EXAMPLE

       Dim keyMap.IRR_KEYMAP(8)

       keyMap[0]\Action  = #IRR_EKA_MOVE_FORWARD;
       keyMap[0]\KeyCode = #IRR_KEY_UP;
       keyMap[1]\Action  = #IRR_EKA_MOVE_FORWARD;
       keyMap[1]\KeyCode = #IRR_KEY_KEY_W;
       keyMap[2]\Action = #IRR_EKA_MOVE_BACKWARD;
       keyMap[2]\KeyCode = #IRR_KEY_DOWN;
       keyMap[3]\Action = #IRR_EKA_MOVE_BACKWARD;
       keyMap[3]\KeyCode = #IRR_KEY_KEY_S;

       keyMap[4]\Action = #IRR_EKA_STRAFE_LEFT;
       keyMap[4]\KeyCode = #IRR_KEY_LEFT;
       keyMap[5]\Action = #IRR_EKA_STRAFE_LEFT;
       keyMap[5]\KeyCode = #IRR_KEY_KEY_A;

       keyMap[6]\Action = #IRR_EKA_STRAFE_RIGHT;
       keyMap[6]\KeyCode = #IRR_KEY_RIGHT;
       keyMap[7]\Action = #IRR_EKA_STRAFE_RIGHT;
       keyMap[7]\KeyCode = #IRR_KEY_KEY_D;

       *camera.l = IrrAddFPSCamera(#False,100,0,500.0,8, @keyMap[0])

## RESULT

Pointer to a FPSCamera-SceneNode