VR-Forces 4.10 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtEntityWheelUpdater.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
12 
13 #include <vrvCore/DtTickable.h>
14 
15 #include <unordered_map>
16 
17 namespace makVrv
18 {
19  class DtOsgArticulatedModel;
20 
25  {
26  public:
29 
31  virtual ~DtEntityWheelUpdater();
32 
33  private:
35  DtEntityWheelUpdater() = delete;
39  DtEntityWheelUpdater &operator=(const DtEntityWheelUpdater &) = delete;
40 
41  public:
44  virtual void update(DtTime tNow);
45 
48  virtual void setWheelData(std::unordered_map<DtOsgArticulatedModel*, DtEntityWheelData>* wheelMap);
49 
52  virtual void setWheelData(std::unordered_map<DtOsgArticulatedModel*, DtEntityWheelDataCommon>* wheelFlipBookMap);
53 
56  virtual void setWheelDataScrollableTexture(std::unordered_map<DtOsgArticulatedModel*, DtEntityWheelDataCommon>* wheelScrollableTextureMap);
57 
58  protected:
60  virtual void updateWheels(DtTime tNow);
61 
63  virtual void updateWheelsFlipBookAnimations(DtTime tNow);
64 
66  virtual void updateWheelsScrollableTextures(DtTime tNow);
67 
71  virtual bool calculateVelocity(DtVector& velocity, DtOsgArticulatedModel* model, DtEntityWheelDataCommon& wheelDataCommon, DtTime tNow) const;
72 
74  virtual bool calculateHeading(DtTaitBryan& heading, DtOsgArticulatedModel* model, DtTime tNow);
75 
77  virtual float calculateDistanceBetweenWheelAxles(DtOsgArticulatedModel* model, int firstSet, int secondSet);
78 
80  virtual bool hasAckermanSteering(DtOsgArticulatedModel* model) const;
81 
83  virtual int numSetOfWheels(const DtEntityWheelData& wheelData) const;
84 
86  virtual std::pair<double, double> calculateAckermanSteeringVelocity(DtTime tNow, DtOsgArticulatedModel* model, DtEntityWheelData& wheelData, double speed);
87 
88  protected:
91 
93  std::unordered_map<DtOsgArticulatedModel*, DtEntityWheelData>* myEntityWheelMap;
94 
96  std::unordered_map<DtOsgArticulatedModel*, DtEntityWheelDataCommon>* myEntityWheelFlipBookMap;
97 
98  std::unordered_map<DtOsgArticulatedModel*, DtEntityWheelDataCommon>* myEntityWheelScrollableTextureMap;
99 
101  std::unordered_map< DtOsgArticulatedModel*, DtVector> myCachedVelocities;
102  };
103 }
std::unordered_map< DtOsgArticulatedModel *, DtEntityWheelData > * myEntityWheelMap
map of entities to corresponding wheel data art parts
Definition: DtEntityWheelUpdater.h:93
This is not a typical updater, instead of the usual 1 updater per entity, the DtEntityWheelManager ad...
Definition: DtEntityWheelUpdater.h:24
#define DT_DLL_VRVOSG
Definition: vrvOsg.h:23
An abstract base class for objects that require updates.
Definition: DtTickable.h:26
std::unordered_map< DtOsgArticulatedModel *, DtEntityWheelDataCommon > * myEntityWheelScrollableTextureMap
Definition: DtEntityWheelUpdater.h:98
An articulated model manipulator for controlling an articulated model.
Definition: DtOsgArticulatedModel.h:67
common data structure to store last position/updated These are used to compute the speed if the updat...
Definition: DtEntityWheelData.h:48
std::unordered_map< DtOsgArticulatedModel *, DtEntityWheelDataCommon > * myEntityWheelFlipBookMap
map of entities that have wheels as flip book animation and some common data for each (last position...
Definition: DtEntityWheelUpdater.h:96
Contains the declaration for makVrv::DtTickable.
brief Structure containing information about all wheel on an entity sceneObj - the scene object for t...
Definition: DtEntityWheelData.h:76
The DtDe is the core component of any VR-Vantage application.
Definition: DtDe.h:69
DtDe & myDe
Definition: DtEntityWheelUpdater.h:89
bool myShouldRotate
Definition: DtEntityWheelUpdater.h:90
std::unordered_map< DtOsgArticulatedModel *, DtVector > myCachedVelocities
cache velocities
Definition: DtEntityWheelUpdater.h:101

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)