Game Development Community

SetZoomSpeed bug

by Tom Spilman · in Torque Game Engine Advanced · 01/20/2007 (2:15 am) · 2 replies

The zoom speed value doesn't work in TSE and it's the waterblock reflection code that's to blame. Since the reflection code causes processCameraQuery() to be called more than once per frame, the time delta calculation in GameUpdateCameraFov() is wrong. The easy fix is to ignore 0 length deltas...

void GameUpdateCameraFov()
{
   F32 time = F32(Platform::getVirtualMilliseconds());
   F32 delta = time - sLastCameraUpdateTime;

   // need to update fov?
   if(sTargetFov != sCameraFov && delta > 0.0f)
   {
      // snap zoom?
      if(sZoomSpeed == 0)
         sCameraFov = sTargetFov;

Just compare this code to the current implementation and the changes should be clear.

About the author

Tom is a programmer and co-owner of Sickhead Games, LLC.


#1
01/20/2007 (7:07 am)
Works great, thanks Tom. :)
#2
01/21/2007 (12:13 am)
Issue #2564.