<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[GMan's Mods & Stuff — Movement into cameradirection]]></title>
		<link>https://gprogs.com/viewtopic.php?id=448</link>
		<atom:link href="https://gprogs.com/extern.php?action=feed&amp;tid=448&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in Movement into cameradirection.]]></description>
		<lastBuildDate>Thu, 08 Dec 2011 10:18:58 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Movement into cameradirection]]></title>
			<link>https://gprogs.com/viewtopic.php?pid=1693#p1693</link>
			<description><![CDATA[<div class="codebox"><pre><code>Function movement()
Local vel:vector3df = vector3df.create()
Local inertia:vector3df = vector3df.create()
Local m:matrix4 = New matrix4
vel = _vector3df(0,0,0)
inertia = _vector3df(0,0,0)
 
 
        If receiver.IsKeyDown(EKEY_KEY_W)
        vel = _vector3df(0,0,MOVEMENT_SPEED * frameDeltaTime))
        ElseIf receiver.IsKeyDown(EKEY_KEY_S)
        vel = _vector3df(0,0,-MOVEMENT_SPEED * frameDeltaTime)
        EndIf
 
        If receiver.IsKeyDown(EKEY_KEY_A)
        vel = _vector3df(-(MOVEMENT_SPEED * frameDeltaTime),0,0))
        ElseIf receiver.IsKeyDown(EKEY_KEY_D)
        vel = _vector3df((MOVEMENT_SPEED * frameDeltaTime),0,0))
        EndIf
        m= camera.getabsolutetransformation()   
        m.rotatevect(vel) 
        inertia.PlusEq(vel:vector3df)
        camera.setposition(camera.getposition().plus(inertia))
        camera.UpdateAbsolutePosition())
 
 
        
End Function</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (Infected)]]></author>
			<pubDate>Thu, 08 Dec 2011 10:18:58 +0000</pubDate>
			<guid>https://gprogs.com/viewtopic.php?pid=1693#p1693</guid>
		</item>
		<item>
			<title><![CDATA[Re: Movement into cameradirection]]></title>
			<link>https://gprogs.com/viewtopic.php?pid=1691#p1691</link>
			<description><![CDATA[<p>greetings <img src="https://gprogs.com/img/smilies/smile.png" width="15" height="15" alt="smile" />&nbsp; at the top, try updating the code to:<br /></p><div class="codebox"><pre><code>Local velo:vector3df = Vector3df.Create()</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (gman)]]></author>
			<pubDate>Wed, 07 Dec 2011 23:48:51 +0000</pubDate>
			<guid>https://gprogs.com/viewtopic.php?pid=1691#p1691</guid>
		</item>
		<item>
			<title><![CDATA[Movement into cameradirection]]></title>
			<link>https://gprogs.com/viewtopic.php?pid=1690#p1690</link>
			<description><![CDATA[<p>Hi!<br />Got a problem: i cant move into the direction of the camera.<br />ive searched irrlicht forums, but in this bmaxversion theys solutions wont work at all <img src="https://gprogs.com/img/smilies/hmm.png" width="15" height="15" alt="hmm" /><br />what am i doing wrong?</p><p>Function movement()<br />Local nodePosition:Vector3df = camera.getPosition()<br />Local velo:vector3df</p><br /><p>&nbsp; &nbsp; If receiver.IsKeyDown(EKEY_KEY_W)<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; velo.setZ(nodePosition.getZ() + (MOVEMENT_SPEED * frameDeltaTime))<br />&nbsp; &nbsp; ElseIf receiver.IsKeyDown(EKEY_KEY_S)<br />&nbsp; &nbsp; &nbsp; &nbsp; velo.setZ(nodePosition.getZ() - (MOVEMENT_SPEED * frameDeltaTime))<br />&nbsp; &nbsp; EndIf</p><p>&nbsp; &nbsp; If receiver.IsKeyDown(EKEY_KEY_A)<br />&nbsp; &nbsp; &nbsp; &nbsp; velo.setX(nodePosition.getX() - (MOVEMENT_SPEED * frameDeltaTime))<br />&nbsp; &nbsp; ElseIf receiver.IsKeyDown(EKEY_KEY_D)<br />&nbsp; &nbsp; &nbsp; &nbsp; velo.setX(nodePosition.getX() + (MOVEMENT_SPEED * frameDeltaTime))<br />&nbsp; &nbsp; EndIf<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; Local x:Float,y:Float,z:Float</p><p>&nbsp; &nbsp; Local m:matrix4 = New matrix4<br />&nbsp; &nbsp; m= camera.getabsolutetransformation()<br />&nbsp; &nbsp; m.rotatevect(velo)<br />&nbsp; &nbsp; X=camera.getposition().getX()+velo.getx()<br />&nbsp; &nbsp; Y=camera.getposition().getY()+velo.getY()<br />&nbsp; &nbsp; Z=camera.getposition().getZ()+velo.getZ()<br />&nbsp; &nbsp; camera.setposition(_VECTOR3dF(x,y,z))<br />&nbsp; &nbsp; <br />End Function</p><br /><p>get the error: unhandlet exception: attempt to access field or method of null object at &quot;m.rotatevect(velo)&quot;</p><p>hope anyone can help =/</p>]]></description>
			<author><![CDATA[null@example.com (Infected)]]></author>
			<pubDate>Wed, 07 Dec 2011 18:57:39 +0000</pubDate>
			<guid>https://gprogs.com/viewtopic.php?pid=1690#p1690</guid>
		</item>
	</channel>
</rss>
