TrueReality  v0.1.1912
MessageTick.h
Go to the documentation of this file.
1 /*
2 * True Reality Open Source Game and Simulation Engine
3 * Copyright © 2021 Acid Rain Studios LLC
4 *
5 * This library is free software; you can redistribute it and/or modify it under
6 * the terms of the GNU Lesser General Public License as published by the Free
7 * Software Foundation; either version 3.0 of the License, or (at your option)
8 * any later version.
9 *
10 * This library is distributed in the hope that it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
13 * details.
14 *
15 * You should have received a copy of the GNU Lesser General Public License
16 * along with this library; if not, write to the Free Software Foundation, Inc.,
17 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 *
19 * @author Maxim Serebrennik
20 */
21 
22 #pragma once
23 
24 #include "Export.h"
25 
26 #include <trUtil/RefStr.h>
27 #include <trBase/UniqueId.h>
28 #include <trManager/MessageBase.h>
30 
31 #include <string>
32 
33 namespace trManager
34 {
41  {
42  public:
44 
46 
55  MessageTick(const trBase::UniqueId* fromActorID, const trManager::TimingStructure& timeStruct);
56 
64  virtual const std::string& GetMessageType() const override;
65 
73  const int& GetFrameNumber(void) const { return(*mFrameNumber); }
74 
82  const double& GetDeltaSimTime(void) const { return(*mDeltaSimTime); }
83 
91  const double& GetDeltaRealTime(void) const { return(*mDeltaRealTime); }
92 
100  const double& GetSimTime(void) const { return(*mSimTime); }
101 
109  const double& GetRealTime(void) const { return(*mRealTime); }
110 
118  const double& GetTimeScale(void) const { return(*mTimeScale); }
119 
120  protected:
121 
127  ~MessageTick();
128 
129  private:
130 
131  const int* mFrameNumber; //Holds the current frame number.
132  const double* mDeltaSimTime; //Scaled Time between frames in seconds.
133  const double* mDeltaRealTime; //Non-scaled Time between frames.
134  const double* mSimTime; //Scaled time of the current simulation run.
135  const double* mRealTime; //Non-scaled time of the current simulation run.
136  const double* mTimeScale; //Time scaler
137 
138  };
139 }
A timing structure for all sim loop variables.
const double * mRealTime
Definition: MessageTick.h:135
static const trUtil::RefStr MESSAGE_TYPE
Adds an easy and swappable access to the base class.
Definition: MessageTick.h:45
const double * mDeltaRealTime
Definition: MessageTick.h:133
This class creates a GUID, or a Unique ID that is used through out TR to identify and distinguish one...
Definition: UniqueId.h:42
const int & GetFrameNumber(void) const
Gets frame number.
Definition: MessageTick.h:73
const double * mTimeScale
Definition: MessageTick.h:136
A string wrapper that will make sure that all of the strings with the same value will point to the sa...
Definition: RefStr.h:50
const int * mFrameNumber
Definition: MessageTick.h:131
const double & GetRealTime(void) const
Access the RealTime.
Definition: MessageTick.h:109
This message carries all the inter-frame timing information.
Definition: MessageTick.h:40
const double * mSimTime
Definition: MessageTick.h:134
const double * mDeltaSimTime
Definition: MessageTick.h:132
const double & GetDeltaRealTime(void) const
Access the DeltaRealTime.
Definition: MessageTick.h:91
const double & GetDeltaSimTime(void) const
Access the DeltaSimTime.
Definition: MessageTick.h:82
osg::Referenced BaseClass
Definition: SmrtClass.h:42
const double & GetTimeScale(void) const
Access the TimeScale.
Definition: MessageTick.h:118
This is the base class for all the messages in TR.
Definition: MessageBase.h:40
const double & GetSimTime(void) const
Access the SimTime.
Definition: MessageTick.h:100
#define TR_MANAGER_EXPORT