3d move (Irrlicht)

BlitzMax Forums/BlitzMax Programming/3d move (Irrlicht)

Diablo(Posted 2005) [#1]
been trying to get Irrlicht 3de egine to work like blitz 3ds for about 2 days and got fairly far. (most impressive feature: IMouseClick(button:int))

now i'm stuck on a, should be, simple problem, i can't get an 'actor' to move 'forwed' or 'strafft' correctly.

the function goes somthing like this:



the code is above is rubbish but i'm at college and didn't bring the actual code. but the problem is i can't think how to make the 'entity' move Relative to its rotation.

thx for any help.


gman(Posted 2005) [#2]
try this (untested):

Function ib3d_MoveEntity(entity:T_irrISceneNode,x:Float,y:Float,z:Float)
	If (entity=Null Or Not entity.isValid()) Then Throw "Entity does not exist or is invalid" 
	Local dest:T_irrVector3df=T_irrVector3df.createFromVals(x,y,z)
	entity.getRelativeTransformation().transformVect(dest)
	entity.setPosition(dest)
EndFunction



Diablo(Posted 2005) [#3]
cool,thx gman.tho i had to swap the x and z values around to get it to move in the right direction.