I have a simple method that is supposed to make the camera jump to a set location, and uses these two lines of code 9not even sure you need to update but I tired a lot of things):
cam.setLocation(new Vector3f(32f, 0f, -8f));
It doesn’t do anything? I have tried cam.setRotation and that makes it rotate, but I cannot seem to be able to set the location.
you don’t need the update(). Do you have something else which is controlling the camera? CameraNode or ChaseCamera? or have another cam.setLocation somewhere which overwrites this?
My program extends SimpleApplication (is based around the HelloCollision demo), and does not create a separate camera node. The camera is first person, so doesn’t chase anything. In the simple update method, which sets the camera based on the key press/walk direction, it works 100% when setting camera location to player.getPhysicsLocation()
I’ve just noticed a pre entered comment, // We re-use the flyby camera for rotation, while positioning is handled by physics - how would I go about setting the camera in this way? I’m building on this demo:
if your code is small enough, post it here
You sparked me to look further, and I have solved the problem myself! I feel idiotic! Thanks anyway!
Solution is to set the physics location of the invisible player:
[java]player.setPhysicsLocation(new Vector3f(32f, 0f, -8f));[/java]