EDIT: here you go :) this is tested on a regular camera created with addCameraSceneNode(). not sure how it will act with the maya or FPS camera. call this once per game loop passing in the T_irrICameraSceneNode. it will essentially point the camera straight ahead and set the up vector based on its current rotation so you can use the regular ISceneNode rotation commands on it and it will affect where the camera is viewing. with it you can roll the camera simply by rotating the camera node around the Z axis.
' causes the cam to look forward based on current cam orientation
Function updateCam(cam:T_irrICameraSceneNode)
Local m:T_irrMatrix4=T_irrMatrix4.create()
' get the current rotation of the camera
m.setRotationDegrees(cam.getRotation())
' transform the up vector based on the current rotation
Local u:T_irrVector3df=T_irrVector3df.createFromVals(0,1,0)
m.transformVect(u)
cam.setUpVector(u)
' transform the target point based on the current location and rotation
Local v:T_irrVector3df=T_irrVector3df.createFromVals(0,0,100)
m.transformVect(v)
v.PlusEq(cam.getPosition())
cam.setTarget(v)
EndFunction
|