Game Development Community

Advance Camera Jitter

by Marcel Boule · in Torque Game Engine · 03/28/2006 (9:18 pm) · 1 replies

I have applied the suggested patches for fixing the jittering of the Advance Camera.
The advice I followed was to move some code from advanceTime() to interpolateTick(), then in AdvancedCamera::setPosition(), change this:

F32 tInterpolation = 0.333333333;
tPos = pos*tInterpolation + tPos*(1.0-tInterpolation);

to this:

tPos = pos;


Then remove all cases of processAfter(mTargetObject).


This all worked when removing the jitter from first-person view, but the jitter comes back in third-person track mode.

Every change I have made to the Advance Camera files can be completely undone by switching off macros, so it is no problem for me to go back to the base files with none of my changes.

Unfortunately, when I do this, I still have the jitter problem.
So I get a lot of jitter both with this fix and without (however in first-person mode I get jitter without the fix, but none with the fix).





I have made another alteration to the code (which can also be disabled via macros) to change the third-person target mode so it does not need a target object to track but instead takes the player and plots a point 10 meters in front of him (accounting for player rotation) and instead always looks at that position.
The only change to the code needed for this was to have the camera look at that point instead of the "target object" point, and this change would not cause this type of jittering.



In AdvancedCamera::setPosition() it has this comment:

//Interpolate the camera position
//(warning, framerate-dependant, must be improved later)

but I am unable to determine if my problem is related to the framerate.
With my fix, there is no interpolation anyway (see above change).

Has anyone else experienced this or have any clues?





[EDIT]
More information.

The jitter is related to the speed of my camera.
The faster it moves between frames (either rotating or changing position) the greater the jitter.

Happens with interpolation on or off.
Any clues?
Server/client update problem?
[/EDIT]


Thank you.

L. Spiro

#1
04/04/2006 (8:57 pm)
This is very important; I have to send a demo Friday and this really needs to be fixed.
Since this is a problem tied into the camera library and/or the Torque engine (specifically, how the camera works with Torque), it is out of my current scope to fix it without at least some push in the right direction.

Any help is appreciated.

Thank you.