Re: [TuxKart-devel] Patch for smooth camera motion...
Status: Alpha
Brought to you by:
sjbaker
From: Kevin C. <co...@ys...> - 2000-07-13 10:18:02
|
Steve Baker wrote: > Do you think the 0.2 and 0.1's here should actually be somehow > related to the time delta between frames? > > > ! steady_cam.xyz[0] = steady_cam.xyz[0] + 0.2f*diff.xyz[0]; > > ! steady_cam.xyz[1] = steady_cam.xyz[1] + 0.2f*diff.xyz[1]; > > ! steady_cam.xyz[2] = steady_cam.xyz[2] + 0.2f*diff.xyz[2]; > > ! steady_cam.hpr[0] = steady_cam.hpr[0] + 0.1f*diff.hpr[0]; > > ! steady_cam.hpr[1] = steady_cam.hpr[1] + 0.1f*diff.hpr[1]; > > ! steady_cam.hpr[2] = steady_cam.hpr[2] + 0.1f*diff.hpr[2]; > > It seems like this would look different on a high frame rate machine > than on a low rate system. Oh yes, you are absolutely right. The values either need to be scaled proportionally to the time since the last frame, or there needs to be some sort of time based history mechanism (which I presume is what your cart history does). I initially meant to have a look and see if this routine was driven off a timer or off the frame update, and then didn't get round to it. Also, from the code, it looks like there is the possibility (unimplemented?) of flipping the view between karts. My patch will cause the camera to spin erratically through walls if this happens. Kevin |