Chase Cam skewed view

This post is for @nehon mostly. It’s a follow-up to my other thread post here: http://hub.jmonkeyengine.org/groups/general-2/forum/topic/chase-cam-1/



nehon, here’s the problem I was talking about.



Here’s the view from with a correct camera placement right after the game has loaded. You can see that it sits on the Y plane. If I rotate the camera left-right or vice-versa, the yellow box stays on the plane.

http://www.danyrioux.com/files/camera_ok.png



Now, here’s the skewed view. Here you see the plane is skewed at an angle after starting the game. If I rotate the camera, everything keeps the same angle of view.

http://www.danyrioux.com/files/camera_wrong.png



Hopefully that will help you out. :slight_smile:

oh ok.I tried to understand what you were talking about, but i didn’t get it.

Are you sure this comes from the camera?

I never noticed such behavior with the chase cam…

Do you change the fov or something?

nehon said:
Are you sure this comes from the camera?

Not at all. But I surmise that since it started to happen after an update to the chaseCam class, the problem probably comes from there.

Do you change the fov or something?

Nope. But even if I would, it wouldn't explain why that behavior happens once in a while. I'd say 1 time out of 3 the plane is correct. The rest of the time it's skewed. Note that I don't reset the camera while the game is running. If the game starts and the camera is skewed, it remains so until the game is restarted. Also, it's not related to one kind of galaxy being generated. I have seen both the ok and the wrong version in all 3 kind of galaxy.

Unfortunately at the moment I can't save/load a game, so I can't say if loading a game would yield different results. ie: Once it would be saved skewed, it would remain skewed.

[java]
private void setCamera() throws InterruptedException, ExecutionException {
Future futSetCamera = this.enqueue(new Callable<Object>() {
@Override
public Object call() throws Exception {
newGUIProgress(0.1f);
cam.setLocation(pShipModel.getLocalTranslation());
flyCam.setEnabled(false);
shipCam = new ChaseCamera(cam, pShipModel, inputManager);
shipCam.setSmoothMotion(false);
shipCam.setTrailingEnabled(false);
newGUIProgress(0.5f);
shipCam.setMaxDistance(250f);
shipCam.setMinDistance(1.3f);
if (!shipCam.isEnabled())
shipCam.setEnabled(true);
newGUIProgress(1f);
return this;
}
});
futSetCamera.get();
}
[/java]

The above is everything pertaining to the camera. There's nothing else.

I’m gonna try to recreate the issue, maybe a cam lookAt issue…

I’m not entirely certain, but I think it started around the time I had to put the setCamera() method into a Future.



It might have happened before that, but it would have been a lot less often since I barely recall. But, I do think seeing it once or twice…



Sorry that I can’t help more than that. :frowning:

I have reworked some parts of the way things are done in my game and since then the camera skewing has stopped. Unfortunately I couldn’t say what exactly has “fixed” it, but I do know that I haven’t touched the camera settings, it’s implementation or initialization.



If the opportunity presents itself, I’ll try to have it behave the way it was before so we can know why and how it can be avoided in the future.