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) 2026 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
9 
10 #pragma once
14 
15 #include <vrvCore/DtTickable.h>
16 
17 #include <unordered_map>
18 #include <vector>
19 
20 namespace makVrv
21 {
22  class DtOsgArticulatedModel;
23  class DtCoordinateSystem;
24  class DtSceneObject;
25  class DtDeadReckonUpdater;
26 
30  {
31  public:
33  public:
38  };
39 
43  {
44  public:
46  public:
48  double myLeftSpeed;
49 
51  double myRightSpeed;
52 
54  double mySpeed;
55  };
56 
61  {
62  public:
65 
67  virtual ~DtEntityWheelUpdater();
68 
69  private:
71  DtEntityWheelUpdater() = delete;
75  DtEntityWheelUpdater &operator=(const DtEntityWheelUpdater &) = delete;
76 
77  public:
80  virtual void update(DtTime tNow);
81 
84  virtual void setWheelData(std::unordered_map<DtOsgArticulatedModel*, DtEntityWheelData>* wheelMap);
85 
88  static void setAutoResumeTimeout(double val);
89 
92  static double autoResumeTimeout();
93 
94  protected:
95 
100  virtual bool verifyAutoUpdate(DtTime tNow, DtOsgArticulatedModel* model, DtEntityWheelData& wheelData);
101 
103  virtual void updateWheels(DtTime tNow);
104 
106  virtual void updateWheels(DtTime tNow, DtOsgArticulatedModel* model, DtEntityWheelData& wheelData, bool vrvWheelRotationEnabled);
107 
111  virtual bool calculateVelocity( DtSceneObject* sceneObject, DtDeadReckonUpdater* updater, DtEntityWheelDataCommon& wheelDataCommon, DtTime tNow) const;
112 
114  virtual bool calculateHeading( DtSceneObject* sceneObject, DtDeadReckonUpdater* updater, DtEntityWheelDataCommon& wheelDataCommon, DtTime tNow) const;
115 
117  virtual float calculateDistanceBetweenWheelAxles(DtOsgArticulatedModel* model, int firstSet, int secondSet) const;
118 
120  virtual int numSetOfWheels(const DtEntityWheelData& wheelData) const;
121 
124  virtual DtAckermanSteeringVelocity calculateAckermanSteeringVelocity(DtTime tNow, DtOsgArticulatedModel* model, DtEntityWheelData& wheelData, double speed) const;
125 
128  virtual DtSkidSteeringSpeed calculateSkidSteeringSpeeds(DtTime tNow, DtOsgArticulatedModel* model, DtEntityWheelData& wheelData ) const;
129 
131  virtual float calculateTrackWidth(DtOsgArticulatedModel* model) const;
132 
134  virtual void printWheelDetails(DtOsgArticulatedModel* model, const DtVector& currVel, int partNum
135  , double speed, double angVel) const;
136 
138  virtual void updateWheelsAckerman(DtTime tNow, DtOsgArticulatedModel* model, DtEntityWheelData& wheelData, bool vrvWheelRotationEnabled );
139 
141  virtual void updateWheelsSkid(DtTime tNow, DtOsgArticulatedModel* model, DtEntityWheelData& wheelData, bool vrvWheelRotationEnabled, DtSkidSteeringSpeed skidSteeringSpeed);
142 
144  virtual bool isReversing( const DtVector& entityVelocity, const DtTaitBryan& entityHeading ) const;
145 
147  virtual void slot_coordinateSystemChanged();
148 
150  virtual void slot_sceneObjectToBeDeleted(DtOsgArticulatedModel* model);
151 
153  virtual void slot_sceneObjectUpdaterToBeDeleted(DtOsgArticulatedModel* model);
154 
156  virtual void ensureCachedUpdater(DtEntityWheelData& wheelData, DtOsgArticulatedModel* model);
157 
163  virtual bool doesModelNeedUpdating(DtOsgArticulatedModel* model, DtEntityWheelData& wheelData);
164  protected:
166  // local clone of the system wide coordinate system.
167  // for thread safety.
170 
172  std::unordered_map<DtOsgArticulatedModel*, DtEntityWheelData>* myEntityWheelMap;
173 
176  std::vector<DtPartVelocityUpdate> myReusablePartUpdates;
177 
180  static double theAutoResumeTimeout;
181  };
182 }
std::unordered_map< DtOsgArticulatedModel *, DtEntityWheelData > * myEntityWheelMap
map of entities to corresponding wheel data art parts
Definition: DtEntityWheelUpdater.h:172
double myFirstSetVelocity
psi velocity for the 1st set
Definition: DtEntityWheelUpdater.h:35
This is not a typical updater, instead of the usual 1 updater per entity, the DtEntityWheelManager ad...
Definition: DtEntityWheelUpdater.h:60
#define DT_DLL_VRVOSG
Definition: vrvOsg.h:23
DtDeadReckonUpdater is a scene object updater that is given kinematic updates and updates a scene obj...
Definition: DtDeadReckonUpdater.h:28
OsgEarth-free batch-entry structs shared by the articulated-model / indirect-entity batch update path...
double myLeftSpeed
for the left track
Definition: DtEntityWheelUpdater.h:48
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:168
An articulated model manipulator for controlling an articulated model. Supports indirect rendering of...
Definition: DtOsgArticulatedModel.h:70
std::vector< DtPartVelocityUpdate > myReusablePartUpdates
Reusable vector for batch wheel updates. Cleared each frame, preserves capacity. Main-thread only – n...
Definition: DtEntityWheelUpdater.h:176
double mySecondSetVelocity
psi velocity for the 2nd set
Definition: DtEntityWheelUpdater.h:37
double myRightSpeed
for the right track
Definition: DtEntityWheelUpdater.h:51
common data structure to store last position/updated These are used to compute the speed if the updat...
Definition: DtEntityWheelData.h:54
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:180
double mySpeed
for the vehicle as a whole
Definition: DtEntityWheelUpdater.h:54
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:96
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:165
Contains the makVrv::DtOsgArticulatedModel class declaration.
bool myShouldRotate
Definition: DtEntityWheelUpdater.h:169
simple structure to hold velocity (steering or rather psi speed) of the first and optionally the 2nd ...
Definition: DtEntityWheelUpdater.h:29
simple structure to hold skid steering speed for the left, right tracks and the vehicles as a whole ...
Definition: DtEntityWheelUpdater.h:42

Document ID: Generated on Thu Oct 15 21:27:02 EDT 2026 from SVN revision 296421
Copyright © 2005-2026 MAK Technologies. All Rights Reserved (www.mak.com)