VR-Forces Developer's Guide
 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) 2021 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>
17 
19 #include <vlutil/vlTime.h>
20 #include <matrix/vlVector.h>
21 
22 #include <osg/ComputeBoundsVisitor>
23 
24 #include <unordered_map>
25 
26 namespace makVrv
27 {
28  class DtDeadReckonUpdater;
29  class DtSceneObject;
30  class DtEntityWheelUpdater;
31 
32 
40  {
41  public:
42 
45 
49  static DtEntityWheelManager& instance(DtDe& de);
50 
51  static void registerInstance(DtDe& de, DtEntityWheelManager *manager);
52 
54  static const std::string& theClassName();
55 
57  virtual ~DtEntityWheelManager();
58 
60  virtual void addModel(DtOsgArticulatedModel& model, DtUniqueID uniqueId, DtUniqueID elementId);
61 
64  virtual void removeModel(DtOsgArticulatedModel& model);
65 
67  virtual int numModels() const;
68 
74  virtual int wheelSetNum(const int sisoValue) const;
75 
78  virtual WheelInfo::WheelSide wheelSide(const int sisoValue) const;
79 
81  virtual bool hasWheels(const DtOsgArticulatedModel& model) const;
82 
84  virtual std::vector<int> listWheelParts(const DtOsgArticulatedModel& model);
85 
88  virtual std::string toString(const int sisoValue) const;
89 
91  virtual bool isWheel(const int sisoValue) const;
92 
95  virtual double computeRadius(const int sisoValue, const DtArticulatedModelParser::PartMap& partIdToNode);
96 
98  virtual double defaultWheelRadius() const;
99 
102  virtual void setDefaultWheelRadius(double wheelRadius);
103 
104  protected:
106  virtual void addWheels(DtOsgArticulatedModel& model);
107 
108  private:
109 
112 
115 
117  DtEntityWheelManager& operator=(const DtEntityWheelManager);
118 
119  protected:
120 
123  std::set<int> myWheelPartIds;
124  osg::ComputeBoundsVisitor myComputerBoundsVisitor;
126 
127  std::unordered_map<DtOsgArticulatedModel*, DtEntityWheelData> myEntityToWheelDataMap;
128  std::unordered_map<DtOsgArticulatedModel*, DtEntityWheelDataCommon> myEntityWheelFlipBookMap;
129  std::unordered_map<DtOsgArticulatedModel*, DtEntityWheelDataCommon> myEntityWheelScrollableTextureMap;
130  };
131 
132 }
osg::ComputeBoundsVisitor myComputerBoundsVisitor
Definition: DtEntityWheelManager.h:124
double myDefaultWheelRadius
Definition: DtEntityWheelManager.h:122
Virtual base class. Allows for RTTI and proper virtual destruction. Used by Creators, Factories, Providers, Assemblers and User Interfaces.
Definition: DtVirtualBaseClass.h:19
std::unordered_map< DtOsgArticulatedModel *, DtEntityWheelDataCommon > myEntityWheelScrollableTextureMap
Definition: DtEntityWheelManager.h:129
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
Contains makVrv::DtDe class.
DtEntityWheelUpdater * myWheelUpdater
Definition: DtEntityWheelManager.h:125
An articulated model manipulator for controlling an articulated model. Supports indirect rendering of...
Definition: DtOsgArticulatedModel.h:67
std::unordered_map< DtOsgArticulatedModel *, DtEntityWheelDataCommon > myEntityWheelFlipBookMap
Definition: DtEntityWheelManager.h:128
Contains makVrv::DtVirtualBaseClass class.
WheelSide
Which side.
Definition: DtEntityWheelData.h:31
The DtEntityWheelManager class is responsible for collecting art part ids related to wheels and then ...
Definition: DtEntityWheelManager.h:39
unsigned long long DtUniqueID
Definition: DtUniqueID.h:19
std::set< int > myWheelPartIds
Definition: DtEntityWheelManager.h:123
std::unordered_map< int, PartTransformList > PartMap
Definition: DtArticulatedModelParser.h:44
Contains makVrv::DtArticulatedModelParser class.
Contains makVrv::DtUniqueID type.
Contains DLL export macros.
std::unordered_map< DtOsgArticulatedModel *, DtEntityWheelData > myEntityToWheelDataMap
Definition: DtEntityWheelManager.h:127
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: DtEntityWheelManager.h:121

Document ID: Generated on Wed Mar 27 22:49:11 EDT 2024 from SVN revision 264633
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)