Game Development Community

Best method to get the current (scene) time

by Alexander Bierbrauer · in Torque Game Builder · 05/19/2006 (9:54 am) · 2 replies

Hey there,

what's the best method to get the scene time ?? something like the win32 api function to get the current tick time. I don't care in what format, seconds, ms or whatever it is. I just need such a function. In the docs is the debug banner mention... there's "SceneTime" but it seems that it is only available when the debug mode is on.

I don't want a timer or scheduler ! Only the current time of T2D in the scene....

#1
05/19/2006 (10:12 am)
You mean the regular SceneTime that is shown in the debug banner? That can be retrieved by t2dSceneGraph::getSceneTime(). Every object has a reference to the scenegraph it is contained in.

Example:
function t2dSceneObject::getSceneTime(%this)
{
   return %this.getSceneGraph().getSceneTime();
}

EDIT:
The value returned will be a floating-point number represent the time in seconds since the scenegraph was created (and unpaused).
#2
05/19/2006 (10:23 am)
Thanx a lot ! I figured it out directly after posting .... :/