I’m trying to combine the best of two worlds. I want a camera that will follow the players movements such a using a camera node but I also want to be able to make offsets in the rotation and distance like with chase camera.
I tried using a chase camera then manually rotating my camera but the chase camera control over rides my rotations. The only way I could think of to fix this was by rotating the camera in the renderLoop after the camera control is updated but I can’t even remember what I needed to add to my class to get the renderLoop override since the wiki is down.
There has to be a better way to do it without writing a new camera class. Does anyone have any suggestions ?
The chase camera doesn’t follow the targets rotations it only follows the target. I want to use controls like the chase camera to make off sets in the camera’s position but when the player rotates I want the camera to rotate with it.
The chase camera doesn’t rotate with the target like the cameranode. However I can’t use both without one over riding the other.
Imagine if you rotated the camera to the side of the player. Then whenever you rotated the player the camera would rotate with the player while of course still remaining the side perspective. I want to be able to off set the camera then rotate the player but have the offset still remain.
@jojoofu That’s what actually I had to do with my Spaceship “sim” game, I set up a CameraNode just behind the ship and then I set the LookAt at the ship node. From there you can move the CameraNode as you want with move/rotate methods, pretty much like @pspeed said
That was my original thought but if I do that I lose the functionality of the chase cam.
What I did was extend the ChaseCamera class then add a new rotation node. The new node shadows the camera until the turn key is pressed. Once the turn key is pressed it copies the players node movements.
This allows me to use the chase camera functions with my own build in design. Ultimately I think I will end up of having to write my own camera class but this will do for now.
CameraNode camNode = new CameraNode("camNode", cam);
//fatherNode is the node in which you have to attach the camNode
Node cameraHook = (Node)fatherNode.getChild("CameraHook");
then you can move the camNode with move(), rotate around its axis(with rotate()) or rotate around the cameraHook node. It works for me, hope this helps in any way