Files
BlitzNext/_release/help/commands/3d_commands/EntityYaw.htm
T
2014-12-08 12:43:20 +13:00

78 lines
1.8 KiB
HTML

<html>
<head>
<title>Blitz3D Docs</title>
<link rel=stylesheet href=../css/commands.css type=text/css>
</head>
<body>
<h1>EntityYaw# ( entity[,global] )</h1>
<h1>Parameters</h1>
<table>
<tr>
<td>
entity - name of entity that will have yaw angle returned
<br />
global (optional) - true if the yaw angle returned should be relative to 0 rather than a parent entity's yaw angle. False by default.
</td>
</tr>
</table>
<h1>Description</h1>
<table>
<tr>
<td>
Returns the yaw angle of an entity.
<br />
<br />
The yaw angle is also the y angle of an entity.
</td>
</tr>
</table>
<h1><a href=../3d_examples/EntityYaw.bb>Example</a></h1>
<table>
<tr>
<td>
; EntityYaw Example
<br />
; -----------------
<br />
<br />
Graphics3D 640,480
<br />
SetBuffer BackBuffer()
<br />
<br />
camera=CreateCamera()
<br />
light=CreateLight()
<br />
<br />
cone=CreateCone( 32 )
<br />
PositionEntity cone,0,0,5
<br />
<br />
While Not KeyDown( 1 )
<br />
<br />
pitch#=0
<br />
yaw#=0
<br />
roll#=0
<br />
<br />
If KeyDown( 208 )=True Then pitch#=-1
<br />
If KeyDown( 200 )=True Then pitch#=1
<br />
If KeyDown( 203 )=True Then yaw#=-1
<br />
If KeyDown( 205 )=True Then yaw#=1
<br />
If KeyDown( 45 )=True Then roll#=-1
<br />
If KeyDown( 44 )=True Then roll#=1
<br />
<br />
TurnEntity cone,pitch#,yaw#,roll#
<br />
<br />
RenderWorld
<br />
<br />
Text 0,0,"Use cursor/Z/X keys to turn cone"
<br />
<br />
; Return entity yaw angle of cone
<br />
Text 0,20,"Yaw: "+EntityYaw#( cone )
<br />
<br />
Flip
<br />
<br />
Wend
<br />
<br />
End
</td>
</tr>
</table>
<br>
<a target=_top href=../index.htm>Index</a><br>
<br>
Click <a href=http://www.blitzbasic.co.nz/b3ddocs/command.php?name=EntityYaw&ref=comments target=_blank>here</a> to view the latest version of this page online</body>
</html>