VR-Forces 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) 2025 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  class DtCoordinateSystem;
21  class DtSceneObject;
22  class DtDeadReckonUpdater;
23 
27  {
28  public:
30  public:
35  };
36 
40  {
41  public:
43  public:
45  double myLeftSpeed;
46 
48  double myRightSpeed;
49 
51  double mySpeed;
52  };
53 
58  {
59  public:
62 
64  virtual ~DtEntityWheelUpdater();
65 
66  private:
68  DtEntityWheelUpdater() = delete;
72  DtEntityWheelUpdater &operator=(const DtEntityWheelUpdater &) = delete;
73 
74  public:
77  virtual void update(DtTime tNow);
78 
81  virtual void setWheelData(std::unordered_map<DtOsgArticulatedModel*, DtEntityWheelData>* wheelMap);
82 
85  static void setAutoResumeTimeout(double val);
86 
89  static double autoResumeTimeout();
90 
91  protected:
92 
97  virtual bool verifyAutoUpdate(DtTime tNow, DtOsgArticulatedModel* model, DtEntityWheelData& wheelData);
98 
100  virtual void updateWheels(DtTime tNow);
101 
103  virtual void updateWheels(DtTime tNow, DtOsgArticulatedModel* model, DtEntityWheelData& wheelData, bool vrvWheelRotationEnabled);
104 
108  virtual bool calculateVelocity( DtSceneObject* sceneObject, DtDeadReckonUpdater* updater, DtEntityWheelDataCommon& wheelDataCommon, DtTime tNow) const;
109 
111  virtual bool calculateHeading( DtSceneObject* sceneObject, DtDeadReckonUpdater* updater, DtEntityWheelDataCommon& wheelDataCommon, DtTime tNow) const;
112 
114  virtual float calculateDistanceBetweenWheelAxles(DtOsgArticulatedModel* model, int firstSet, int secondSet) const;
115 
117  virtual bool hasAckermanSteering(DtOsgArticulatedModel* model) const;
118 
120  virtual bool hasSkidSteering(DtOsgArticulatedModel* model) const;
121 
123  virtual bool hasArticulatedWheels(DtOsgArticulatedModel* model) const;
124 
126  virtual int numSetOfWheels(const DtEntityWheelData& wheelData) const;
127 
130  virtual DtAckermanSteeringVelocity calculateAckermanSteeringVelocity(DtTime tNow, DtOsgArticulatedModel* model, DtEntityWheelData& wheelData, double speed) const;
131 
134  virtual DtSkidSteeringSpeed calculateSkidSteeringSpeeds(DtTime tNow, DtOsgArticulatedModel* model, DtEntityWheelData& wheelData ) const;
135 
137  virtual bool hasTracks(DtOsgArticulatedModel* model) const;
138 
140  virtual float calculateTrackWidth(DtOsgArticulatedModel* model) const;
141 
143  virtual void printWheelDetails(DtOsgArticulatedModel* model, const DtVector& currVel, int partNum
144  , double speed, double angVel) const;
145 
147  virtual void updateWheelsAckerman(DtTime tNow, DtOsgArticulatedModel* model, DtEntityWheelData& wheelData, bool vrvWheelRotationEnabled ) const;
148 
150  virtual void updateWheelsSkid(DtTime tNow, DtOsgArticulatedModel* model, DtEntityWheelData& wheelData, bool vrvWheelRotationEnabled, DtSkidSteeringSpeed skidSteeringSpeed) const;
151 
153  virtual bool isReversing( const DtVector& entityVelocity, const DtTaitBryan& entityHeading ) const;
154 
156  virtual void slot_coordinateSystemChanged();
157 
159  virtual void slot_sceneObjectToBeDeleted(DtOsgArticulatedModel* model);
160 
162  virtual void slot_sceneObjectUpdaterToBeDeleted(DtOsgArticulatedModel* model);
163 
165  virtual void findSceneObjectAndUpdater( DtOsgArticulatedModel* model, DtSceneObject*& sceneObject, DtDeadReckonUpdater*& updater );
166 
172  virtual bool doesModelNeedUpdating(DtOsgArticulatedModel* model);
173  protected:
175  {
180  };
181 
182  protected:
184  // local clone of the system wide coordinate system.
185  // for thread safety.
188 
190  std::unordered_map<DtOsgArticulatedModel*, DtEntityWheelData>* myEntityWheelMap;
191  std::unordered_map<DtOsgArticulatedModel*, DtPerModelWheelUpdaterCache> myPerModelWheelUpdaterCacheMap;
192 
195  static double theAutoResumeTimeout;
196  };
197 }
DtDeadReckonUpdater * myDeadReckonUpdater
Definition: DtEntityWheelUpdater.h:177
DtSignalConnectionManager myConnections
Definition: DtEntityWheelUpdater.h:178
std::unordered_map< DtOsgArticulatedModel *, DtEntityWheelData > * myEntityWheelMap
map of entities to corresponding wheel data art parts
Definition: DtEntityWheelUpdater.h:190
double myFirstSetVelocity
psi velocity for the 1st set
Definition: DtEntityWheelUpdater.h:32
This is not a typical updater, instead of the usual 1 updater per entity, the DtEntityWheelManager ad...
Definition: DtEntityWheelUpdater.h:57
#define DT_DLL_VRVOSG
Definition: vrvOsg.h:23
DtSceneObject * mySceneObject
Definition: DtEntityWheelUpdater.h:176
DtDeadReckonUpdater is a scene object updater that is given kinematic updates and updates a scene obj...
Definition: DtDeadReckonUpdater.h:28
std::unordered_map< DtOsgArticulatedModel *, DtPerModelWheelUpdaterCache > myPerModelWheelUpdaterCacheMap
Definition: DtEntityWheelUpdater.h:191
double myLeftSpeed
for the left track
Definition: DtEntityWheelUpdater.h:45
An abstract base class for objects that require updates. This object automatically adds itself to a D...
Definition: DtTickable.h:26
DtCoordinateSystem * myCoordinateSystem
Definition: DtEntityWheelUpdater.h:186
An articulated model manipulator for controlling an articulated model. Supports indirect rendering of...
Definition: DtOsgArticulatedModel.h:67
double mySecondSetVelocity
psi velocity for the 2nd set
Definition: DtEntityWheelUpdater.h:34
bool myAreWheelUpdatesFrozen
Definition: DtEntityWheelUpdater.h:179
Definition: DtEntityWheelUpdater.h:174
double myRightSpeed
for the right track
Definition: DtEntityWheelUpdater.h:48
common data structure to store last position/updated These are used to compute the speed if the updat...
Definition: DtEntityWheelData.h:48
static double theAutoResumeTimeout
The amount of time before auto updates will resume after a manual/nework update has been applied to a...
Definition: DtEntityWheelUpdater.h:195
Class to manage disconnection of boost connections on deletion.
Definition: DtSignalConnectionManager.h:20
double mySpeed
for the vehicle as a whole
Definition: DtEntityWheelUpdater.h:51
The DtCoordinateSystem is used to manage the current coordinate system of the scene.
Definition: DtCoordinateSystem.h:40
Contains the declaration for makVrv::DtTickable.
A DtSceneObject represents an object that can be positioned in the scene by (possibly) attaching it t...
Definition: DtSceneObject.h:44
brief Structure containing information about all wheel on an entity sceneObj - the scene object for t...
Definition: DtEntityWheelData.h:90
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:76
DtDe & myDe
Definition: DtEntityWheelUpdater.h:183
bool myShouldRotate
Definition: DtEntityWheelUpdater.h:187
simple structure to hold velocity (steering or rather psi speed) of the first and optionally the 2nd ...
Definition: DtEntityWheelUpdater.h:26
simple structure to hold skid steering speed for the left, right tracks and the vehicles as a whole ...
Definition: DtEntityWheelUpdater.h:39

Document ID: Generated on Thu Oct 23 22:29:17 EDT 2025 from SVN revision 280951
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)