VR-Forces 4.10 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) 2020 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  class DtOsgArticulatedModel;
25  class DtModel;
26 
32  {
33  public:
34 
36  DtShipFlagDirTickable(DtDe& de, DtElementID elementId, DtUniqueID sceneObjectId,
37  DtUniqueID uniqueId, unsigned int nodeTypeIndex, DtOsgArticulatedModel* osgArticulatedModel);
38 
40  virtual ~DtShipFlagDirTickable();
41 
43  virtual void update( DtTime tNow );
44 
47  float calcRotAngleForShipFlag(DtSceneObject* sceneObj,
48  DtDeadReckonUpdater* updater, DtTime tNow,
49  const DtVector& windDirVec, float windSpeedMperS);
50 
52  DtVector computeWindVec(DtSceneObject* sceneObj, float windDirRad);
53 
62  virtual bool needsUpdate( DtTime tNow );
63 
65  virtual void configure(osg::Node* n, const rapidjson::Value& windJsonData);
66 
68  virtual void modelToBeDestroyed(DtModel* model);
69  public:
70  // @{
73  static const char* theShipFlagDirFeatureName;
74  static const char* theTagRotOffsetDeg;
75  static const char* theTagRotDir;
76  static const char* theRotDirCW;
77  // @}
78  protected:
80  virtual void disconnectFromModel();
81 
82  protected:
85 
88 
91 
94 
96  osgSim::DOFTransform* myWindDirNode;
97 
100  float myRotOffset;
101 
103  float myRotDir;
104 
106  };
107 
111  {
112 
113  public:
114 
117 
119  virtual ~DtShipFlagDirTickableCreator();
120 
122  virtual DtShipFlagDirTickable* create(DtDe& de, osg::Node* node,
123  DtOsgArticulatedModel* osgArticulatedMode,
124  const rapidjson::Value& jsonObject, const std::string& modelDefName,
125  const DtElementID elementId, const DtUniqueID uniqueId
126  , const unsigned int nodeTypeIndex);
127 
128  };
129 }
DtOsgArticulatedModel * myOsgArticulatedModel
Definition: DtShipFlagDirTickable.h:105
DtDynamicFeatureTickable is a tickable with extra information from .meta files for parameters for upd...
Definition: DtDynamicFeatureTickable.h:24
The DtShipFlagDirTickable updates a transform node to rotate into the direction of the wind and ship...
Definition: DtShipFlagDirTickable.h:30
float myLastFlagDir
Last update wind direction.
Definition: DtShipFlagDirTickable.h:87
DtSceneObject * mySceneObject
The scene object we are querying.
Definition: DtShipFlagDirTickable.h:84
#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:74
An articulated model manipulator for controlling an articulated model.
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 * theRotDirCW
Definition: DtShipFlagDirTickable.h:76
static const char * theTagRotDir
Definition: DtShipFlagDirTickable.h:75
IMGUI_API void Value(const char *prefix, bool b)
DtTime myLastTime
Last update time.
Definition: DtShipFlagDirTickable.h:93
unsigned long long DtUniqueID
Definition: DtUniqueID.h:19
osgSim::DOFTransform * myWindDirNode
Transform for the wind to act upon.
Definition: DtShipFlagDirTickable.h:96
float myRotOffset
The rotation offset to bring the model&#39;s rotation in line with the wind&#39;s direction.
Definition: DtShipFlagDirTickable.h:100
DtVector myLastPos
Last position.
Definition: DtShipFlagDirTickable.h:90
A DtSceneObject represents an object that can be positioned in the scene by (possibly) attaching it t...
Definition: DtSceneObject.h:41
A model which owns a single model instance.
Definition: DtModel.h:55
The DtDe is the core component of any VR-Vantage application.
Definition: DtDe.h:69
Contains makVrv::DtMetaObjectCreator class.
DtShipFlagDirTickableCreator class.
Definition: DtShipFlagDirTickable.h:110
float myRotDir
Clockwise or counterclockwise rotation.
Definition: DtShipFlagDirTickable.h:103
static const char * theShipFlagDirFeatureName
Strings to get the different parts of the meta file Use these instead of hardcoded strings...
Definition: DtShipFlagDirTickable.h:73
Abstract dynamic feature creator class.
Definition: DtMetaObjectCreator.h:28
Contains DLL export macros.

Document ID: Generated on Tue Sep 21 17:42:52 EDT 2021 from SVN revision 234861
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)