Code: Select all
Ray mouseRay = mCamera->getCameraToViewportRay( e->getX(), e->getY() );
in my application i got a 3rd person camera behind a ship. the node are set up like
controlnode
shipnode (child of controlnode)
cameranode (child of controlnode)
if i start a CameraToViewportRay the rays works with the position and orientation of the camera relative to the controlnode. atm i cant see why that should be usefull, as the picture the camera is producing is also been taken from the derivered position and derivered orientation.as the name "camera to viewport ray" indicates i want to shoot the ray to the viewport, the not derivered orientation and position is not in all cases the viewport (the things i can see, as far as i understand that word) i can see.
maybe i made a mistake in my code, but this behavior was quite irritating to me first. im now using to get the derivered position and orientation of my cameranode (child of controlnode) and place a newcameranode (child of root node) at that settings from wich it seems to work well.