TimeSourceVirtual.cpp

00001 /***************************************************************************
00002  *                                                                         *
00003  *   (c) Art Tevs, MPI Informatik Saarbruecken                             *
00004  *       mailto: <tevs@mpi-sb.mpg.de>                                      *
00005  *                                                                         *
00006  *   This program is free software; you can redistribute it and/or modify  *
00007  *   it under the terms of the GNU General Public License as published by  *
00008  *   the Free Software Foundation; either version 2 of the License, or     *
00009  *   (at your option) any later version.                                   *
00010  *                                                                         *
00011  ***************************************************************************/
00012 
00013 //----------------------------------------------------------------------------------
00014 // Includes
00015 //----------------------------------------------------------------------------------
00016 #include "TimeSourceVirtual.h"
00017 #include "TimeSource.h"
00018 #include "Log.h"
00019 
00020 
00021 namespace nrEngine{
00022                 
00023         //------------------------------------------------------------------------
00024         TimeSourceVirtual::TimeSourceVirtual(float64 step) : TimeSource(), _timeStep(step)
00025         {
00026                 
00027         }
00028 
00029         //------------------------------------------------------------------------
00030         TimeSourceVirtual::~TimeSourceVirtual()
00031         {
00032         }
00033                 
00034         //------------------------------------------------------------------------
00035         float64 TimeSourceVirtual::getTime()
00036         {
00037                 // return it back
00038                 return _currentTime;
00039         }
00040 
00041         //------------------------------------------------------------------------
00042         void TimeSourceVirtual::notifyNextFrame()
00043         {
00044                 // clculate the time in seconds
00045                 _currentTime += _timeStep; 
00046         }
00047 
00048         //------------------------------------------------------------------------
00049         void TimeSourceVirtual::reset(float64 startValue)
00050         {
00051                 _currentTime = startValue;
00052         }
00053         
00054 }; // end namespace     
00055 

Generated on Wed Sep 12 23:19:42 2007 for nrEngine by  doxygen 1.5.1