Fix for jerky camera orbitmode
by Joel Baxter · in Torque Game Engine · 04/01/2002 (10:56 am) · 22 replies
You've probably noticed that when you die and go into orbit mode around the corpse, the view is very jerky. This is because the position as well as the interpolation factors for the camera are being managed incorrectly, and the camera is setting its transform for every client-side interpolation rather than setting its render transform.
There turned out to be a lot of necessary interconnected changes to make, so in the end I just rewrote most of the relevant camera code. While I was at it, I also implemented the other two camera modes, although I haven't tested them. If anyone wants to examine this code, I've uploaded it to my website. Rather than try to describe all the changes here in the forum, I just commented the files, both with "normal" comments and also with "XXX" comments to mark unusual or dubious spots. Some of the more subtle problems with managing interpolation are also discussed in this thread: www.garagegames.com/index.php?sec=mg&mod=forums&page=result.thread&qt=3276 (that's talking about the Player code specifically, but the ideas are the same).
Now, when in orbit mode around a corpse, you may notice that the view hiccups slightly every now and then. It used to do this in the old code as well; it was just hard to see because of the violently shaking POV. :-) The reason for this hiccup AFAICT is not because the camera code is doing anything bad, but because the corpse object that it is attached to is hiccuping. This very well could be related to the stuff in that thread linked above; or, there's an outside chance it could be some problem with our specific player model. Either way, not a camera problem per se.
Also, before doing these changes I thought that the free-flying camera was not as smooth as it could be. Still feels the same way to me after the changes. Something to investigate later I guess.
There turned out to be a lot of necessary interconnected changes to make, so in the end I just rewrote most of the relevant camera code. While I was at it, I also implemented the other two camera modes, although I haven't tested them. If anyone wants to examine this code, I've uploaded it to my website. Rather than try to describe all the changes here in the forum, I just commented the files, both with "normal" comments and also with "XXX" comments to mark unusual or dubious spots. Some of the more subtle problems with managing interpolation are also discussed in this thread: www.garagegames.com/index.php?sec=mg&mod=forums&page=result.thread&qt=3276 (that's talking about the Player code specifically, but the ideas are the same).
Now, when in orbit mode around a corpse, you may notice that the view hiccups slightly every now and then. It used to do this in the old code as well; it was just hard to see because of the violently shaking POV. :-) The reason for this hiccup AFAICT is not because the camera code is doing anything bad, but because the corpse object that it is attached to is hiccuping. This very well could be related to the stuff in that thread linked above; or, there's an outside chance it could be some problem with our specific player model. Either way, not a camera problem per se.
Also, before doing these changes I thought that the free-flying camera was not as smooth as it could be. Still feels the same way to me after the changes. Something to investigate later I guess.
#22
Go to line 281 where it says:
Change it to read:
10/14/2006 (11:37 am)
engine/game/camera.ccGo to line 281 where it says:
validateEyePoint(1.0f, &mRenderObjToWorld);
Change it to read:
validateEyePoint(1.0f, &mObjToWorld);
Torque Owner Jeff Murray
Default Studio Name
Anyone found a fix for 1.4??