Function __CreatePtrKeyMapArray

au3Irr2

au3Irr2 Function Reference

__CreatePtrKeyMapArray

Helper function: returns pointer to a keymap for _IrrAddFPSCamera.

#Include <au3Irrlicht2.au3>
__CreatePtrKeyMapArray(ByRef $keyStruct, $i_kForward = $KEY_KEY_W, $i_kBackward = $KEY_KEY_S, $i_kLeft = $KEY_KEY_A, $i_kRight = $KEY_KEY_D, $i_kJump = $KEY_SPACE)

 

Parameters

$keyStruct Any variable which is then returned as a a keymap for _IrrAddFPSCamera.
$i_kForward Key for forward movement, default is $KEY_KEY_W
$i_kBackward Key for backward movement, default is $KEY_KEY_S
$i_kLeft Key for left movement, default is $KEY_KEY_A
$i_kRight Key for right movement, default is $KEY_KEY_D
$i_kJump Key for jumping, default is $KEY_SPACE

 

Return Value

Success: Pointer to Dllstruct containing key struct useable by _IrrAddFpsCamera.
Failure: False

 

Remarks

$keyStruct can be set to '0' after call of _IrraddFPSCamera to delete the Dllstruct. Usage with defaults creates WASD keys, e.g.:
_IrrAddFPSCamera (..., __CreatePtrKeyMapArray($keyStruct), 4, ...)

 

Related

_IrraddFPSCamera

 

Example


#include "au3Irrlicht2.au3"

_IrrStart()

local $keyStruct
local $camera = _IrrAddFPSCamera( 0, 150.0, 0.1, -1, _
                __CreatePtrKeyMapArray($keyStruct), 4 )
$keyStruct = 0

local $mesh = _IrrGetMesh( ".\media\capsuleX.obj" )
local $sceneNode = _IrrAddMeshToScene( $mesh )
_IrrSetNodePosition($sceneNode, 0, 0, 5 )

local $texture = _IrrGetTexture(".\media\default_texture.png")
_IrrSetNodeMaterialTexture( $sceneNode, $texture, 0)
_IrrSetNodeMaterialFlag( $sceneNode, $IRR_EMF_LIGHTING, $IRR_OFF )

_IrrSetWindowCaption("Move with mouse + WASD keys - quit with ALT-F4!")
WHILE _IrrRunning()
    _IrrBeginScene(50, 50, 50)
    _IrrDrawScene()
    _IrrEndScene()
WEND

_IrrStop()