Atoms Crowd  7.0.0
SimulationTime.impl.h
1 // ===========================================================================
2 // Copyright (c) 2015 Toolchefs Ltd. All rights reserved.
3 //
4 // Use of this software is subject to the terms of the Toolchefs license
5 // agreement provided at the time of installation or download, or which
6 // otherwise accompanies this software in either electronic or hard copy form.
7 // ===========================================================================
8 
9 namespace Atoms
10 {
12  {
13  m_time = 0.0;
14  }
15 
16  double SimulationTime::time() const
17  {
18  return m_time;
19  }
20 
21  void SimulationTime::increment(double value)
22  {
23  m_deltaTime = value;
24  m_time += value;
25  }
26 
27  void SimulationTime::set(double value)
28  {
29  m_time = value;
30  }
31 
32  void SimulationTime::setFps(double fps)
33  {
34  m_fps = fps;
35  }
36 
37  double SimulationTime::fps() const
38  {
39  return m_fps;
40  }
41 
42  double SimulationTime::seconds() const
43  {
44  return m_time / m_fps;
45  }
46 
47  void SimulationTime::setEndTime(double value)
48  {
49  m_endTime = value;
50  }
51 
52  double SimulationTime::endTime() const
53  {
54  return m_endTime;
55  }
56 
57  void SimulationTime::setDeltaTime(double value)
58  {
59  m_deltaTime = value;
60  }
61 
63  {
64  return m_deltaTime;
65  }
66 }
double seconds() const
Gets the current time in seconds.
Definition: SimulationTime.impl.h:42
double deltaTime() const
Delta time.
Definition: SimulationTime.impl.h:62
void setFps(double fps)
Sets the fps.
Definition: SimulationTime.impl.h:32
void increment(double value)
Increments the time.
Definition: SimulationTime.impl.h:21
void setDeltaTime(double value)
Sets delta time.
Definition: SimulationTime.impl.h:57
double fps() const
Gets the fps.
Definition: SimulationTime.impl.h:37
void setEndTime(double value)
Sets end time.
Definition: SimulationTime.impl.h:47
double endTime() const
End time.
Definition: SimulationTime.impl.h:52
void reset()
Resets time.
Definition: SimulationTime.impl.h:11
double time() const
Gets current time.
Definition: SimulationTime.impl.h:16
void set(double value)
Sets the time.
Definition: SimulationTime.impl.h:27
Atoms namespace.
Definition: Agent.h:29