VR-Forces 4.10 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtRotorState.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * Copyright (c) 2021 MAK Technologies, Inc.
3  * All rights reserved.
4  *****************************************************************************/
5 
9 
10 #pragma once
11 
12 #include <vrvOsg/vrvOsg.h>
13 
14 #include <vlutil/vlTime.h>
15 
16 namespace makVrv
17 {
18  class DtEntityRotorData;
19 
25  {
26  public:
28  DtRotorState(DtEntityRotorData* rotorData);
30  virtual ~DtRotorState();
31  private:
33  DtRotorState() = delete;
34  DtRotorState(const DtRotorState& rhs) = delete;
35  DtRotorState& operator=(const DtRotorState& rhs) = delete;
36  public:
39  virtual DtRotorState* handleEvent(int state);
40 
43  virtual DtRotorState* update(DtTime timeNow);
44 
46  virtual void enter(void);
47 
49  virtual void exit(void);
50  protected:
52  protected:
54  static const float theMaxSpeed;
56  static const float theTimeToFullSpin;
58  static const float theTimeToFullCoolDown;
59 
60  static const float theTimeToSwitchToMotionBlur;
61  };
62 
65  {
66  public:
70  virtual ~DtNullRotorState();
71  private:
73  DtNullRotorState() = delete;
74  DtNullRotorState(const DtNullRotorState& rhs) = delete;
75  DtNullRotorState& operator=(const DtNullRotorState& rhs) = delete;
76  public:
80  virtual DtRotorState* handleEvent(int state) override;
81  protected:
82 
83  };
84 
86  class FullyOff : public DtRotorState
87  {
88  public:
90  FullyOff(DtEntityRotorData* rotorData);
92  virtual ~FullyOff();
93  private:
95  FullyOff() = delete;
96  FullyOff(const FullyOff& rhs) = delete;
97  FullyOff& operator=(const FullyOff& rhs) = delete;
98  public:
101  virtual DtRotorState* handleEvent(int state) override;
102 
104  virtual void enter(void) override;
105  };
106 
107  class FullyOn : public DtRotorState
108  {
109  public:
111  FullyOn(DtEntityRotorData* rotorData);
113  virtual ~FullyOn();
114  private:
116  FullyOn() = delete;
117  FullyOn(const FullyOff& rhs) = delete;
118  FullyOn& operator=(const FullyOn& rhs) = delete;
119  public:
122  virtual DtRotorState* handleEvent(int state) override;
123 
127  virtual void enter(void) override;
128  };
129 
130  class SpinningUp : public DtRotorState
131  {
132  public:
133  SpinningUp(DtEntityRotorData* rotorData, float initialVelocity);
134  virtual ~SpinningUp();
135  public:
137  virtual DtRotorState* handleEvent(int state) override;
139  virtual DtRotorState* update(DtTime timeNow) override;
140  private:
142  SpinningUp() = delete;
143  SpinningUp(const SpinningUp& rhs) = delete;
144  FullyOn& operator=(const SpinningUp& rhs) = delete;
145  public:
146 
147  protected:
150  const float myAcceleration;
151  const float myInitialVelocity;
154  };
155 
156  class SpinningDown : public DtRotorState
157  {
158  public:
159  SpinningDown(DtEntityRotorData* rotorData, float initial);
160  virtual ~SpinningDown();
161  private:
163  SpinningDown() = delete;
164  SpinningDown(const SpinningDown& rhs) = delete;
165  SpinningDown& operator=(const SpinningDown& rhs) = delete;
166  public:
168  virtual DtRotorState* handleEvent(int state) override;
170  virtual DtRotorState* update(DtTime timeNow) override;
171 
172  protected:
175  const float myAcceleration;
176  const float myInitialVelocity;
178  };
179 }
DtTime myLastUpdateTime
Definition: DtRotorState.h:148
Definition: DtRotorState.h:107
DtTime myElapsedTime
Definition: DtRotorState.h:149
class containing information about the rotors of an articulated model and the state This class is use...
Definition: DtEntityRotorData.h:24
static const float theTimeToSwitchToMotionBlur
Definition: DtRotorState.h:60
SpinningDown & operator=(const SpinningDown &rhs)=delete
virtual DtRotorState * handleEvent(int state)
handle an event (state change).
DtRotorState & operator=(const DtRotorState &rhs)=delete
virtual DtRotorState * update(DtTime timeNow) override
If M threshold, will transition to fully off.
virtual ~FullyOn()
destructor
DtEntityRotorData * myRotorData
Definition: DtRotorState.h:51
FullyOff & operator=(const FullyOff &rhs)=delete
virtual ~SpinningUp()
represents an abstract rotor state.
Definition: DtRotorState.h:24
float myCurrentVelocity
Definition: DtRotorState.h:177
SpinningUp()=delete
not allowed
DtNullRotorState()=delete
not allowed
start up state
Definition: DtRotorState.h:64
static const float theTimeToFullSpin
in seconds
Definition: DtRotorState.h:56
FullyOn & operator=(const FullyOn &rhs)=delete
virtual DtRotorState * handleEvent(int state) override
If 0, will transition to spinning down does not need to handle timed update.
DtTime myLastUpdateTime
Definition: DtRotorState.h:173
float myCurrentVelocity
Definition: DtRotorState.h:152
virtual void enter(void)
things to be done on enter.
bool mySwitchedToMotionBlur
Definition: DtRotorState.h:153
virtual DtRotorState * update(DtTime timeNow)
update given the current time.
DtNullRotorState & operator=(const DtNullRotorState &rhs)=delete
const float myAcceleration
Definition: DtRotorState.h:175
FullyOn()=delete
not allowed
virtual ~DtNullRotorState()
destructor
virtual ~FullyOff()
destructor
const float myInitialVelocity
Definition: DtRotorState.h:176
virtual void enter(void) override
will pass on the state 1 directly to the osg articulated model will also set the dofs that were being...
virtual DtRotorState * handleEvent(int state) override
If 1, will transition to spinning up does not need to handle timed update.
virtual void exit(void)
things to be done on exit
const float myInitialVelocity
Definition: DtRotorState.h:151
fully off state
Definition: DtRotorState.h:86
Definition: DtRotorState.h:156
FullyOff()=delete
not allowed
Definition: DtRotorState.h:130
virtual DtRotorState * update(DtTime timeNow) override
If &gt; treshold, will transition to fully on.
FullyOn & operator=(const SpinningUp &rhs)=delete
SpinningDown()=delete
not allowed
virtual ~DtRotorState()
destructor
DtTime myElapsedTime
Definition: DtRotorState.h:174
static const float theMaxSpeed
the max speed of a rotor (in rpm)
Definition: DtRotorState.h:54
Contains DLL export macros.
static const float theTimeToFullCoolDown
in seconds
Definition: DtRotorState.h:58
virtual void enter(void) override
will set the velocity of the rotors to 0
DtRotorState()=delete
not allowed
virtual DtRotorState * handleEvent(int state) override
If 0, will transition to spinning down.
const float myAcceleration
Definition: DtRotorState.h:150
virtual DtRotorState * handleEvent(int state) override
If 0, will transition to fully off If 1, will transition to fully on does not need to handle timed up...
virtual DtRotorState * handleEvent(int state) override
If 0, will transition to spinning down.

Document ID: Generated on Tue Sep 21 17:42:52 EDT 2021 from SVN revision 234861
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)