VR-Forces 4.8 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtShipFlagDirTickable.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2014 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
9 
10 #pragma once
11 #include <vrvCore/vrvCore.h>
14 #include <matrix/vlVector.h>
15 
16 #include <osgSim/DOFTransform>
17 
18 #include <rapidjson/document.h>
19 
20 namespace makVrv
21 {
22  class DtDisplayUnitsConverter;
23  class DtDeadReckonUpdater;
24 
30  {
31  public:
32 
34  DtShipFlagDirTickable(DtDe& de, DtElementID elementId, DtUniqueID sceneObjectId,
35  DtUniqueID uniqueId, bool useInstancing, unsigned int nodeTypeIndex);
36 
38  virtual ~DtShipFlagDirTickable();
39 
41  virtual void update( DtTime tNow );
42 
45  float calcRotAngleForShipFlag(DtSceneObject* sceneObj,
46  DtDeadReckonUpdater* updater, DtTime tNow,
47  const DtVector& windDirVec, float windSpeedKPH);
48 
50  DtVector computeWindVec(DtSceneObject* sceneObj, float windDirRad);
51 
60  virtual bool needsUpdate( DtTime tNow );
61 
63  virtual void configure(osg::Node* n, const rapidjson::Value& windJsonData);
64 
65  public:
66  // @{
69  static const char* theShipFlagDirFeatureName;
70  static const char* theTagRotOffsetDeg;
71  static const char* theTagRotDir;
72  static const char* theRotDirCW;
73  // @}
74 
75  protected:
78 
81 
84 
87 
89  osgSim::DOFTransform* myWindDirNode;
90 
93  float myRotOffset;
94 
96  float myRotDir;
97  };
98 
102  {
103 
104  public:
105 
108 
110  virtual ~DtShipFlagDirTickableCreator();
111 
113  virtual DtShipFlagDirTickable* create(DtDe& de, osg::Node* node,
114  DtOsgArticulatedModel* osgArticulatedMode,
115  const rapidjson::Value& jsonObject, const std::string& modelDefName,
116  const DtElementID elementId, const DtUniqueID uniqueId,
117  const bool useInstancing, const unsigned int nodeTypeIndex);
118 
119  };
120 }
DtDynamicFeatureTickable is a tickable with extra information from .meta files for parameters for upd...
Definition: DtDynamicFeatureTickable.h:25
The DtShipFlagDirTickable updates a transform node to rotate into the direction of the wind and ship...
Definition: DtShipFlagDirTickable.h:28
float myLastFlagDir
Last update wind direction.
Definition: DtShipFlagDirTickable.h:80
DtSceneObject * mySceneObject
The scene object we are querying.
Definition: DtShipFlagDirTickable.h:77
#define DT_DLL_VRVOSG
Definition: vrvOsg.h:23
DtDeadReckonUpdater is a scene object updater that is given kinematic updates and updates a scene obj...
Definition: DtDeadReckonUpdater.h:29
Contains makVrv::DtDynamicFeatureTickable class.
static const char * theTagRotOffsetDeg
Definition: DtShipFlagDirTickable.h:70
An articulated model manipulator for controlling an articulated model.
Definition: DtOsgArticulatedModel.h:56
DtUniqueID DtElementID
The ElementID is a specific type of unique ID used to represent VR-Vantage uniquely defined elements...
Definition: DtUniqueID.h:26
static const char * theRotDirCW
Definition: DtShipFlagDirTickable.h:72
static const char * theTagRotDir
Definition: DtShipFlagDirTickable.h:71
IMGUI_API void Value(const char *prefix, bool b)
DtTime myLastTime
Last update time.
Definition: DtShipFlagDirTickable.h:86
unsigned long long DtUniqueID
Definition: DtUniqueID.h:22
osgSim::DOFTransform * myWindDirNode
Transform for the wind to act upon.
Definition: DtShipFlagDirTickable.h:89
float myRotOffset
The rotation offset to bring the model&#39;s rotation in line with the wind&#39;s direction.
Definition: DtShipFlagDirTickable.h:93
DtVector myLastPos
Last position.
Definition: DtShipFlagDirTickable.h:83
A DtSceneObject represents an object that can be positioned in the scene by (possibly) attaching it t...
Definition: DtSceneObject.h:41
The DtDe is the core component of any VR-Vantage application.
Definition: DtDe.h:69
Contains makVrv::DtMetaObjectCreator class.
DtShipFlagDirTickableCreator class.
Definition: DtShipFlagDirTickable.h:101
float myRotDir
Clockwise or counterclockwise rotation.
Definition: DtShipFlagDirTickable.h:96
static const char * theShipFlagDirFeatureName
Strings to get the different parts of the meta file Use these instead of hardcoded strings...
Definition: DtShipFlagDirTickable.h:69
Abstract dynamic feature creator class.
Definition: DtMetaObjectCreator.h:28
Contains DLL export macros.

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)