dxEntityYaw#(entity%,global%)

Parameters

entity - name of entity that will have yaw angle returned
global (optional) - true if the yaw angle returned should be relative to 0 rather than a parent entity's yaw angle. False by default.

Description

Returns the yaw angle of an entity.

The yaw angle is also the y angle of an entity.

Example

; dxEntityYaw Example
; -----------------

dxGraphics3D 640,480
dxSetBuffer dxBackBuffer()

camera=dxCreateCamera()
light=dxCreateLight()

cone=dxCreateCone( 32 )
dxPositionEntity cone,0,0,5

While Not dxKeyDown( 1 )

pitch#=0
yaw#=0
roll#=0

If dxKeyDown( 208 )=True Then pitch#=-1
If dxKeyDown( 200 )=True Then pitch#=1
If dxKeyDown( 203 )=True Then yaw#=-1
If dxKeyDown( 205 )=True Then yaw#=1
If dxKeyDown( 45 )=True Then roll#=-1
If dxKeyDown( 44 )=True Then roll#=1

dxTurnEntity cone,pitch#,yaw#,roll#

dxRenderWorld

dxText 0,0,"Use cursor/Z/X keys to turn cone"

; Return entity yaw angle of cone
dxText 0,20,"Yaw: "+dxEntityYaw#( cone )

dxFlip

Wend

End

Index