VR-Forces 4.8 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtEntityWheelManager.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2019 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
9 
10 #pragma once
11 #include <vrvCore/DtDe.h>
12 #include <vrvCore/DtUniqueID.h>
13 
14 #include <vrvOsg/vrvOsg.h>
16 
18 
19 #include <vlutil/vlTime.h>
20 #include <matrix/vlVector.h>
21 
22 #include <osg/ComputeBoundsVisitor>
23 
24 namespace makVrv
25 {
26  class DtDeadReckonUpdater;
27  class DtSceneObject;
28  class DtEntityWheelUpdater;
29 
36  struct WheelInfo
37  {
40 
42  : steerable(false)
43  , partNum(0)
44  , wheelSet(0)
46  , wheelRadius(0.0)
47  , angVel(0.0)
48  {};
49 
50  bool steerable;
51  int partNum;
52  int wheelSet;
54  double wheelRadius;
55  double angVel;
56  };
57 
64  {
66  : sceneId(0)
67  , lastUpdateTime(0)
68  {
69 
70  };
71 
72  // Also retrieve the scene object instead of storing
74  // For using the scene object position
77  std::vector<WheelInfo> wheels;
78  };
79 
87  {
88  public:
89 
92 
96  static DtEntityWheelManager& instance(DtDe& de);
97 
98  static void registerInstance(DtDe& de, DtEntityWheelManager *manager);
99 
101  static const std::string& theClassName();
102 
104  virtual ~DtEntityWheelManager();
105 
107  virtual void addModel(DtOsgArticulatedModel& model, bool isInstanced,
108  DtUniqueID uniqueId, DtUniqueID elementId);
109 
112  virtual void removeModel(DtOsgArticulatedModel& model);
113 
115  virtual int numModels() const;
116 
122  virtual int wheelSetNum(const int sisoValue) const;
123 
126  virtual WheelInfo::WheelSide wheelSide(const int sisoValue) const;
127 
129  virtual bool hasWheels(DtOsgArticulatedModel& model);
130 
132  virtual std::vector<int> listWheelParts(DtOsgArticulatedModel& model);
133 
136  virtual std::string toString(const int sisoValue) const;
137 
139  virtual bool isWheel(const int sisoValue) const;
140 
143  virtual double computeRadius(const int sisoValue, const DtArticulatedModelParser::PartMap& partIdToNode);
144 
146  virtual double defaultWheelRadius();
147 
150  virtual void setDefaultWheelRadius(double wheelRadius);
151 
152  private:
153 
156 
159 
161  DtEntityWheelManager& operator=(const DtEntityWheelManager);
162 
163  protected:
164 
167  std::set<int> myWheelPartIds;
168  osg::ComputeBoundsVisitor myComputerBoundsVisitor;
170  std::map<DtOsgArticulatedModel*, EntityWheelData> myEntityToWheelDataMap;
171  };
172 
173 }
Definition: DtEntityWheelManager.h:39
osg::ComputeBoundsVisitor myComputerBoundsVisitor
Definition: DtEntityWheelManager.h:168
brief Structure containing information about all wheel on an entity sceneObj - the scene object for t...
Definition: DtEntityWheelManager.h:63
double myDefaultWheelRadius
Definition: DtEntityWheelManager.h:166
Virtual base class.
Definition: DtVirtualBaseClass.h:22
Definition: DtEntityWheelManager.h:39
DtVector lastPos
Definition: DtEntityWheelManager.h:76
This is not a typical updater, instead of the usual 1 updater per entity, the DtEntityWheelManager ad...
Definition: DtEntityWheelUpdater.h:22
#define DT_DLL_VRVOSG
Definition: vrvOsg.h:23
DtTime lastUpdateTime
Definition: DtEntityWheelManager.h:75
Contains makVrv::DtDe class.
DtEntityWheelUpdater * myWheelUpdater
Definition: DtEntityWheelManager.h:169
std::map< DtOsgArticulatedModel *, EntityWheelData > myEntityToWheelDataMap
Definition: DtEntityWheelManager.h:170
An articulated model manipulator for controlling an articulated model.
Definition: DtOsgArticulatedModel.h:56
WheelSide wheelSide
Definition: DtEntityWheelManager.h:53
boost::unordered_map< int, PartTransformList > PartMap
Definition: DtArticulatedModelParser.h:43
double wheelRadius
Definition: DtEntityWheelManager.h:54
Contains makVrv::DtVirtualBaseClass class.
Definition: DtEntityWheelManager.h:39
bool steerable
Definition: DtEntityWheelManager.h:48
std::vector< WheelInfo > wheels
Definition: DtEntityWheelManager.h:77
WheelSide
Which side.
Definition: DtEntityWheelManager.h:39
EntityWheelData()
Definition: DtEntityWheelManager.h:65
The DtEntityWheelManager class is responsible for collecting art part ids related to wheels and then ...
Definition: DtEntityWheelManager.h:86
unsigned long long DtUniqueID
Definition: DtUniqueID.h:22
std::set< int > myWheelPartIds
Definition: DtEntityWheelManager.h:167
int wheelSet
Definition: DtEntityWheelManager.h:52
Contains makVrv::DtArticulatedModelParser class.
double angVel
Definition: DtEntityWheelManager.h:55
Contains makVrv::DtUniqueID type.
Contains DLL export macros.
The DtDe is the core component of any VR-Vantage application.
Definition: DtDe.h:69
Structure contained individual wheel information partNum - the articulated part wheel id wheelSet - 1...
Definition: DtEntityWheelManager.h:36
int partNum
Definition: DtEntityWheelManager.h:51
DtUniqueID sceneId
Definition: DtEntityWheelManager.h:70
DtDe & myDe
Definition: DtEntityWheelManager.h:165
WheelInfo()
Definition: DtEntityWheelManager.h:41

Document ID: Generated on Thu Aug 27 10:56:05 EDT 2020 from SVN revision 217100
Copyright © 2005-2020 MAK Technologies. All Rights Reserved (www.mak.com)