VR-Forces 5.0.2 Developer's Guide
 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 
24  {
25  public:
27  public:
32  };
33 
37  {
38  public:
40  public:
42  double myLeftSpeed;
43 
45  double myRightSpeed;
46 
48  double mySpeed;
49  };
50 
55  {
56  public:
59 
61  virtual ~DtEntityWheelUpdater();
62 
63  private:
65  DtEntityWheelUpdater() = delete;
69  DtEntityWheelUpdater &operator=(const DtEntityWheelUpdater &) = delete;
70 
71  public:
74  virtual void update(DtTime tNow);
75 
78  virtual void setWheelData(std::unordered_map<DtOsgArticulatedModel*, DtEntityWheelData>* wheelMap);
79 
80  protected:
82  virtual void updateWheels(DtTime tNow);
83 
87  virtual bool calculateVelocity(DtVector& velocity, DtOsgArticulatedModel* model, DtEntityWheelDataCommon& wheelDataCommon, DtTime tNow) const;
88 
90  virtual bool calculateHeading(DtTaitBryan& heading, DtOsgArticulatedModel* model, DtTime tNow);
91 
93  virtual float calculateDistanceBetweenWheelAxles(DtOsgArticulatedModel* model, int firstSet, int secondSet);
94 
96  virtual bool hasAckermanSteering(DtOsgArticulatedModel* model) const;
97 
99  virtual bool hasSkidSteering(DtOsgArticulatedModel* model) const;
100 
102  virtual bool hasArticulatedWheels(DtOsgArticulatedModel* model) const;
103 
105  virtual int numSetOfWheels(const DtEntityWheelData& wheelData) const;
106 
109  virtual DtAckermanSteeringVelocity calculateAckermanSteeringVelocity(DtTime tNow, DtOsgArticulatedModel* model, DtEntityWheelData& wheelData, double speed);
110 
113  virtual DtSkidSteeringSpeed calculateSkidSteeringSpeeds(DtTime tNow, DtOsgArticulatedModel* model, DtEntityWheelData& wheelData, double speed);
114 
116  virtual bool hasTracks(DtOsgArticulatedModel* model) const;
117 
119  virtual float calculateTrackWidth(DtOsgArticulatedModel* model) const;
120 
121  protected:
124 
126  std::unordered_map<DtOsgArticulatedModel*, DtEntityWheelData>* myEntityWheelMap;
127 
128 
130  std::unordered_map< DtOsgArticulatedModel*, DtVector> myCachedVelocities;
131  };
132 }
std::unordered_map< DtOsgArticulatedModel *, DtEntityWheelData > * myEntityWheelMap
map of entities to corresponding wheel data art parts
Definition: DtEntityWheelUpdater.h:126
double myFirstSetVelocity
psi velocity for the 1st set
Definition: DtEntityWheelUpdater.h:29
This is not a typical updater, instead of the usual 1 updater per entity, the DtEntityWheelManager ad...
Definition: DtEntityWheelUpdater.h:54
#define DT_DLL_VRVOSG
Definition: vrvOsg.h:23
double myLeftSpeed
for the left track
Definition: DtEntityWheelUpdater.h:42
An abstract base class for objects that require updates. This object automatically adds itself to a D...
Definition: DtTickable.h:26
An articulated model manipulator for controlling an articulated model. Supports indirect rendering of...
Definition: DtOsgArticulatedModel.h:69
double mySecondSetVelocity
psi velocity for the 2nd set
Definition: DtEntityWheelUpdater.h:31
double myRightSpeed
for the right track
Definition: DtEntityWheelUpdater.h:45
common data structure to store last position/updated These are used to compute the speed if the updat...
Definition: DtEntityWheelData.h:48
double mySpeed
for the vehicle as a whole
Definition: DtEntityWheelUpdater.h:48
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:80
The DtDe is the core component of any VR-Vantage application. It owns a DtRenderer, DtDeCommunicator, as well as a DtDisplay and other things.
Definition: DtDe.h:70
DtDe & myDe
Definition: DtEntityWheelUpdater.h:122
bool myShouldRotate
Definition: DtEntityWheelUpdater.h:123
simple structure to hold velocity (steering or rather psi speed) of the first and optionally the 2nd ...
Definition: DtEntityWheelUpdater.h:23
std::unordered_map< DtOsgArticulatedModel *, DtVector > myCachedVelocities
cache velocities
Definition: DtEntityWheelUpdater.h:130
simple structure to hold skid steering speed for the left, right tracks and the vehicles as a whole ...
Definition: DtEntityWheelUpdater.h:36

Document ID: Generated on Sun Dec 4 20:22:03 EST 2022 from SVN revision 249613
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)