VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtWindRotTickable.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2023 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
9 
10 #pragma once
11 #include <vrvCore/vrvCore.h>
12 #include <rapidjson/document.h>
15 #include <osgSim/DOFTransform>
17 
18 namespace makVrv
19 {
20  class DtDisplayUnitsConverter;
21  class DtOsgArticulatedModel;
22 
28  {
29  public:
30 
32  DtWindRotTickable(DtDe& de, DtElementID elementId, DtUniqueID sceneObjectId,
33  DtUniqueID uniqueId, unsigned int nodeTypeIndex, DtOsgArticulatedModel* osgArticulatedModel);
34 
36  virtual ~DtWindRotTickable();
37 
39  virtual void update( DtTime tNow );
40 
49  virtual bool needsUpdate( DtTime tNow );
50 
52  virtual void configure(osg::Node* n, const rapidjson::Value& windJsonData);
53 
55  virtual void modelToBeDestroyed(DtModel* model);
56 
57  public:
58  // @{
61  static const char* theWindRotFeatureName;
62  static const char* theTagDelayBeforeRot;
63  static const char* theTagDegPerKPH;
64  // @}
65 
66  protected:
68  virtual void disconnectFromModel();
69 
72  virtual float computeInitialOrientation(void) const;
73  protected:
75  virtual void setVelocity(float radianSpeed);
76 
77  protected:
78 
81 
83  osgSim::DOFTransform* myWindRotNode;
84 
87  float myDegPerKPH;
88 
90  float myLastWindSpeedKmPerHr = -1;
91 
93 
95  bool myInitialRotationSet = false;
96 
98  bool myRotating = false;
99 
100  static const int theAnimationFlags;
101 
102  boost::signalslib::connection myModelToBeDestroyedConnection;
103  };
104 
106 }
const DtDisplayUnitsConverter & myConverter
To convert the wind speed to display units (km/h)
Definition: DtWindRotTickable.h:80
The DtWindRotTickable rotates along X (like a fan blade) depending on the speed of the wind...
Definition: DtWindRotTickable.h:26
DtDynamicFeatureTickable is a tickable with extra information from .meta files for parameters for upd...
Definition: DtDynamicFeatureTickable.h:24
#define DT_DLL_VRVOSG
Definition: vrvOsg.h:23
Contains makVrv::DtDynamicFeatureTickable class.
float myDegPerKPH
Definition: DtWindRotTickable.h:87
float myWindSpeedTreshold
To constrain the rotation with respect to wind.
Definition: DtWindRotTickable.h:86
An articulated model manipulator for controlling an articulated model. Supports indirect rendering of...
Definition: DtOsgArticulatedModel.h:67
DtUniqueID DtElementID
The ElementID is a specific type of unique ID used to represent VR-Vantage uniquely defined elements...
Definition: DtUniqueID.h:23
static const char * theWindRotFeatureName
Strings to get the different parts of the meta file Use these instead of hardcoded strings...
Definition: DtWindRotTickable.h:61
static const char * theTagDelayBeforeRot
Strings to get the different parts of the meta file Use these instead of hardcoded strings...
Definition: DtWindRotTickable.h:62
boost::signalslib::connection myModelToBeDestroyedConnection
Definition: DtWindRotTickable.h:102
Definition: DtMetaObjectCreator.h:53
IMGUI_API void Value(const char *prefix, bool b)
static const char * theTagDegPerKPH
Strings to get the different parts of the meta file Use these instead of hardcoded strings...
Definition: DtWindRotTickable.h:63
Utility class for doing global unit conversion. All conversions functions use the following naming co...
Definition: DtDisplayUnitsSettingsManager.h:61
unsigned long long DtUniqueID
Definition: DtUniqueID.h:19
osgSim::DOFTransform * myWindRotNode
The node affected by the update rotation calculations.
Definition: DtWindRotTickable.h:83
DtOsgArticulatedModel * myOsgArticulatedModel
Definition: DtWindRotTickable.h:92
A model which owns a single model instance. A DtModel is a managing container for a single DtModelIns...
Definition: DtModel.h:56
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
DtTemplatedTickableCreator< DtWindRotTickable, false > DtWindRotTickableCreator
Definition: DtWindRotTickable.h:105
Contains the makVrv::DtOsgArticulatedModel class declaration.
static const int theAnimationFlags
Definition: DtWindRotTickable.h:100
Contains makVrv::DtMetaObjectCreator class.
Contains DLL export macros.

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)