VR-Forces 5.0.1 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) 2022 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 
106  {
107 
108  public:
109 
112 
114  virtual ~DtWindRotTickableCreator();
115 
117  virtual DtWindRotTickable* create(DtDe& de, osg::Node* node, DtOsgArticulatedModel* osgArticulatedModel,
118  const rapidjson::Value& jsonObject, const std::string& modelDefName,
119  const DtElementID elementId, const DtUniqueID uniqueId
120  , const unsigned int nodeTypeIndex);
121 
122  };
123 }
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:69
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
DtWindRotTickableCreator class.
Definition: DtWindRotTickable.h:105
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:60
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:55
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
Contains the makVrv::DtOsgArticulatedModel class declaration.
static const int theAnimationFlags
Definition: DtWindRotTickable.h:100
Contains makVrv::DtMetaObjectCreator class.
Abstract dynamic feature creator class. A dynamic feature retrieves data from a .meta file and applie...
Definition: DtMetaObjectCreator.h:28
Contains DLL export macros.

Document ID: Generated on Mon Jun 20 00:38:30 EDT 2022 from SVN revision 244029
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)