Game Development Community

StartCameraShake() 1.5 Beta 3

by Christian Rousselle · in Torque Game Builder · 04/23/2007 (4:24 am) · 4 replies

StartCameraShake() does not stop shaking after the given time. Camera seems to shake forever.

#1
04/23/2007 (5:20 am)
You sure about that? We're using it and I haven't noticed any problems.
Note that the time variable is in SECONDS. (so if you thought it was in milliseconds and entered like 1000 it would indeed shake for a while).
#2
04/23/2007 (6:36 am)
Hi,

I ported a project from 1.1.3 to 1.5 Beta 3 and noticed it. After your reply I tested it with an empty project. It seems to be connected to the t2dSceneWindow's mount() function.

I can reproduce it by creating an empty project, putting in a sprite, give it the class 'ShakeTest' and use the following code:

function ShakeTest::onLevelLoaded(%this, %scenegraph)
{
	sceneWindow2D.mount(%this, "0 0", "0", true);

	sceneWindow2D.startCameraShake(5, 1);
}

If I do not use mount() it works fine.
#3
04/26/2007 (6:43 pm)
Actually, I experience that bug in 1.1.3. I have to use stopCameraShake() to stop it.
#4
05/12/2007 (12:16 am)
Been fixed for the next release - bug id #2978

Manual fix:

t2dSceneWindow::processTick() - (t2dSceneWindow.cc [2619])

Camera shake time would not be updated if mounted - wayward else after removed

  // Is Camera Mounted?
  else if ( isCameraMounted() )
  {
    // Yes, so calculate Camera Mount.
    calculateCameraMount( ITickable::smTickSec );
  }
  // [neo - 0002978 - 20070507]
  //else <---- no else we always want to update camera shake even when mounted

  // Is the Camera Shaking?
  if ( mCameraShaking )
    ...