VR-Forces 5.0.2 Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtSceneObjectUpdater.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2020 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
9 
10 #pragma once
11 
12 #include <vrvCore/DtSceneObject.h>
13 #include <vrvCore/DtTickable.h>
14 
15 #include <vrvUtil/signalslib.h>
16 
17 namespace makVrv
18 {
19  class DtDe;
20 
37  {
38  public:
39 
44 
46  virtual ~DtSceneObjectUpdater();
47 
55  virtual void setNextUpdater( DtSceneObjectUpdater* nextUpdater );
56 
62  virtual void setPrevUpdater( DtSceneObjectUpdater* prevUpdater );
63 
73  virtual bool needsUpdate( DtTime tNow );
74 
80  virtual void update( DtTime tNow );
81 
85  virtual void updateAdaptiveTickrate(const DtVector& lastPos, const DtTime& deltaTime);
86 
89  virtual void setVertexToUpdate( unsigned int vertex );
90 
93  virtual void setInputPosition( const DtVector& position );
94 
97  virtual void setInputOrientation( const DtTaitBryan& orientation );
98 
103  virtual void setOutputPosition( const DtVector& position );
104 
109  virtual void setOutputOrientation( const DtTaitBryan& orientation );
110 
115  virtual void setOutputPositionAndOrientation(const DtVector& position, const DtTaitBryan& orientation);
116 
119  virtual DtTime lastUpdateTime() const;
120 
127  virtual void setSceneObject(DtSceneObject* sceneObject, bool addToTickableMgrIfHead);
128 
133  virtual void setSceneObject(DtSceneObject* sceneObject);
134 
136  virtual void setLodSystemEnabled(bool enabled);
138  virtual bool lodSystemEnabled() const;
139 
141  virtual void setLodScaleSpeedFactor(float factor);
143  virtual float lodScaleSpeedFactor() const;
144 
146  virtual void setLodRadiusStart(float ratius);
148  virtual float lodRadiusStart() const;
149 
151  virtual void setLodRadiusEnd(float ratius);
153  virtual float lodRadiusEnd() const;
154 
156  virtual void setNearLodUpdateRate(int nearRate);
158  virtual int nearLodUpdateRate() const;
159 
161  virtual void setFarLodUpdateRate(int maxRate);
163  virtual int farLodUpdateRate() const;
164 
166  inline DtSceneObject* findSceneObject()
169  {
170  return mySceneObject;
171  }
172 
174  inline DtSceneObject* const findSceneObject() const
175  {
176  return mySceneObject;
177  }
179 
181  inline DtUniqueID uniqueId() const
182  {
183  return myUniqueId;
184  }
185 
188  {
189  return myNextUpdater;
190  }
191 
194  {
195  return myPrevUpdater;
196  }
197 
201  virtual bool isChainThreadSafe(DtSceneObjectUpdater* firstUpdater);
202 
204  virtual DtSceneObjectUpdater* chainHead();
205 
207  virtual void setIsThreadSafe(bool safe);
208 
212  boost::signalslib::signal< void ( const DtUniqueID& ) > signal_updaterToBeDeleted;
214 
215  protected:
221  virtual void slot_sceneObjectToBeDeleted( const DtUniqueID& id );
223 
228  virtual void removeThreadSafeChainFromManager(DtSceneObjectUpdater* head);
229 
234  virtual void removeUnThreadSafeChainFromManager(DtSceneObjectUpdater* head);
235 
240  virtual void addThreadSafeChainToManager(DtSceneObjectUpdater* head);
241 
246  virtual void addUnThreadSafeChainToManager(DtSceneObjectUpdater* head);
247 
251  virtual void placeChainOnCorrectTickableList(DtSceneObjectUpdater* head);
252 
253  protected:
254 
257 
260 
263 
267 
268 
269  // When the class is destructed, the scene object may or may not
270  // exist. Using a separate connection variable makes it possible to
271  // 'disconnect' even if the scene object has been deleted.
272  boost::signalslib::connection mySceneObjectConnection;
273 
276 
279 
281  unsigned int myVertexToUpdate;
282 
285 
287  DtTaitBryan myInputOrientation;
288 
293 
298 
300  {
301  UpdateLODParams();
303  bool myEnabled;
304 
306  float myScaleSpeedFactor; // 20.0f
307 
309  float myNearUpdateRadius; // 1000.0f
310 
312  float myFarUpdateRadius; // 10000.0f
313 
315  int myFarUpdateRate; // 30
316 
319 
320  };
323  };
324 }
UpdateLODParams myLodUpdateParams
automatic lod system params
Definition: DtSceneObjectUpdater.h:322
DtUniqueID uniqueId() const
Returns the distributed object id of this updater.
Definition: DtSceneObjectUpdater.h:181
bool myEnabled
is system on for this model
Definition: DtSceneObjectUpdater.h:303
float myNearUpdateRadius
the near radius where the update rate starts to fall off
Definition: DtSceneObjectUpdater.h:309
DtUniqueID myUniqueId
This distributed object&#39;s unique identifier.
Definition: DtSceneObjectUpdater.h:259
DtSceneObject *const findSceneObject() const
const correct version
Definition: DtSceneObjectUpdater.h:174
Definition: DtSceneObjectUpdater.h:299
Scene Object Updater.
Definition: DtSceneObjectUpdater.h:36
An abstract base class for objects that require updates. This object automatically adds itself to a D...
Definition: DtTickable.h:26
int myNearUpdateRate
the update rate at the near radius
Definition: DtSceneObjectUpdater.h:318
bool myPositionDataOutputted
Flag to indicate if setOutputPosition has been called this tick. If a deriving updater hasn&#39;t called ...
Definition: DtSceneObjectUpdater.h:292
float myFarUpdateRadius
the far radius where the update rate is at it&#39;s lowest
Definition: DtSceneObjectUpdater.h:312
boost::signalslib::signal< void(const DtUniqueID &) > signal_updaterToBeDeleted
Definition: DtSceneObjectUpdater.h:212
DtDe & myDe
The display engine.
Definition: DtSceneObjectUpdater.h:256
DtSceneObjectUpdater * myPrevUpdater
The previous updater in the chain (or NULL)
Definition: DtSceneObjectUpdater.h:278
#define DT_DLL_VRVCORE
Definition: vrvCore.h:20
unsigned int myVertexToUpdate
The default scene object vertex to update.
Definition: DtSceneObjectUpdater.h:281
DtTaitBryan myInputOrientation
Input Orientation.
Definition: DtSceneObjectUpdater.h:287
Contains the declaration for makVrv::DtTickable.
DtSceneObjectUpdater * findPrevUpdater() const
Return the previous updater in the updater chain.
Definition: DtSceneObjectUpdater.h:193
DtSceneObject * mySceneObject
A pointer to the current scene object being updated.
Definition: DtSceneObjectUpdater.h:262
A DtSceneObject represents an object that can be positioned in the scene by (possibly) attaching it t...
Definition: DtSceneObject.h:42
float myScaleSpeedFactor
value that linearly adjusts the range of the lod radii by the velocity
Definition: DtSceneObjectUpdater.h:306
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:70
bool myOrientationDataOutputted
Flag to indicate if setOutputOrientation has been called this tick. If a deriving updater hasn&#39;t call...
Definition: DtSceneObjectUpdater.h:297
DtVector myInputPosition
Input position.
Definition: DtSceneObjectUpdater.h:284
int myFarUpdateRate
the update rate at the far radius
Definition: DtSceneObjectUpdater.h:315
DtSceneObjectUpdater * myNextUpdater
The next updater in the chain (or NULL)
Definition: DtSceneObjectUpdater.h:275
Contains makVrv::DtSceneObject class.
DtSceneObjectUpdater * findNextUpdater() const
Return the next updater in the updater chain.
Definition: DtSceneObjectUpdater.h:187
boost::signalslib::connection mySceneObjectConnection
Definition: DtSceneObjectUpdater.h:272
int myModelSet
This updater is registered as a modelset-specific tickable; this is the modelset it&#39;s registered with...
Definition: DtSceneObjectUpdater.h:266

Document ID: Generated on Sun Dec 4 20:22:03 EST 2022 from SVN revision 249613
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)