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) 2024 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 
83  protected:
85  virtual void updateWheels(DtTime tNow);
86 
88  virtual void updateWheels(DtTime tNow, DtOsgArticulatedModel* model, DtEntityWheelData& wheelData, bool vrvWheelRotationEnabled) const;
89 
93  virtual bool calculateVelocity( DtSceneObject* sceneObject, DtDeadReckonUpdater* updater, DtEntityWheelDataCommon& wheelDataCommon, DtTime tNow) const;
94 
96  virtual bool calculateHeading( DtSceneObject* sceneObject, DtDeadReckonUpdater* updater, DtEntityWheelDataCommon& wheelDataCommon, DtTime tNow) const;
97 
99  virtual float calculateDistanceBetweenWheelAxles(DtOsgArticulatedModel* model, int firstSet, int secondSet) const;
100 
102  virtual bool hasAckermanSteering(DtOsgArticulatedModel* model) const;
103 
105  virtual bool hasSkidSteering(DtOsgArticulatedModel* model) const;
106 
108  virtual bool hasArticulatedWheels(DtOsgArticulatedModel* model) const;
109 
111  virtual int numSetOfWheels(const DtEntityWheelData& wheelData) const;
112 
115  virtual DtAckermanSteeringVelocity calculateAckermanSteeringVelocity(DtTime tNow, DtOsgArticulatedModel* model, DtEntityWheelData& wheelData, double speed) const;
116 
119  virtual DtSkidSteeringSpeed calculateSkidSteeringSpeeds(DtTime tNow, DtOsgArticulatedModel* model, DtEntityWheelData& wheelData ) const;
120 
122  virtual bool hasTracks(DtOsgArticulatedModel* model) const;
123 
125  virtual float calculateTrackWidth(DtOsgArticulatedModel* model) const;
126 
128  virtual void printWheelDetails(DtOsgArticulatedModel* model, const DtVector& currVel, int partNum
129  , double speed, double angVel) const;
130 
132  virtual void updateWheelsAckerman(DtTime tNow, DtOsgArticulatedModel* model, DtEntityWheelData& wheelData, bool vrvWheelRotationEnabled ) const;
133 
135  virtual DtSkidSteeringSpeed updateWheelsSkid(DtTime tNow, DtOsgArticulatedModel* model, DtEntityWheelData& wheelData, bool vrvWheelRotationEnabled ) const;
136 
138  virtual bool isReversing( const DtVector& entityVelocity, const DtTaitBryan& entityHeading ) const;
139 
141  virtual void slot_coordinateSystemChanged();
142 
144  virtual void findSceneObjectAndUpdater( DtOsgArticulatedModel* model, DtSceneObject*& sceneObject, DtDeadReckonUpdater*& updater ) const;
145  protected:
147  // local clone of the system wide coordinate system.
148  // for thread safety.
151 
153  std::unordered_map<DtOsgArticulatedModel*, DtEntityWheelData>* myEntityWheelMap;
154  };
155 }
std::unordered_map< DtOsgArticulatedModel *, DtEntityWheelData > * myEntityWheelMap
map of entities to corresponding wheel data art parts
Definition: DtEntityWheelUpdater.h:153
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
DtDeadReckonUpdater is a scene object updater that is given kinematic updates and updates a scene obj...
Definition: DtDeadReckonUpdater.h:28
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:149
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
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
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:86
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:72
DtDe & myDe
Definition: DtEntityWheelUpdater.h:146
bool myShouldRotate
Definition: DtEntityWheelUpdater.h:150
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 Tue Sep 24 19:28:17 EDT 2024 from SVN revision 269799
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)