VR-Forces 5.0.2 Developer's Guide
 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) 2022 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
9 
10 #pragma once
11 #include <vrvCore/vrvCore.h>
14 
16 
17 #include <matrix/vlVector.h>
18 
19 #include <osgSim/DOFTransform>
20 
21 #include <rapidjson/document.h>
22 
23 namespace makVrv
24 {
25  class DtDisplayUnitsConverter;
26  class DtDeadReckonUpdater;
27  class DtOsgArticulatedModel;
28  class DtModel;
29  class DtCoordinateSystem;
30 
36  {
37  public:
38 
40  DtShipFlagDirTickable(DtDe& de, DtElementID elementId, DtUniqueID sceneObjectId,
41  DtUniqueID uniqueId, unsigned int nodeTypeIndex, DtOsgArticulatedModel* osgArticulatedModel);
42 
44  virtual ~DtShipFlagDirTickable();
45 
47  virtual void update( DtTime tNow );
48 
51  float calcRotAngleForShipFlag(DtSceneObject* sceneObj,
52  DtDeadReckonUpdater* updater, DtTime tNow,
53  const DtVector& windDirVec, float windSpeedMperS);
54 
56  DtVector computeWindVec(DtSceneObject* sceneObj, float windDirRad);
57 
66  virtual bool needsUpdate( DtTime tNow );
67 
69  virtual void configure(osg::Node* n, const rapidjson::Value& windJsonData);
70 
72  virtual void modelToBeDestroyed(DtModel* model);
73  public:
74  // @{
77  static const char* theShipFlagDirFeatureName;
78  static const char* theTagRotOffsetDeg;
79  static const char* theTagRotDir;
80  static const char* theRotDirCW;
81  // @}
82  protected:
84  virtual void disconnectFromModel();
85 
87  virtual void slot_coordinateSystemChanged();
88 
89  protected:
92 
95 
98 
101 
103  osgSim::DOFTransform* myWindDirNode;
104 
107  float myRotOffset;
108 
110  float myRotDir;
111 
113 
115 
118  DtCoordinateSystem* myCoordinateSystem = nullptr;
119  };
120 
124  {
125 
126  public:
127 
130 
132  virtual ~DtShipFlagDirTickableCreator();
133 
135  virtual DtShipFlagDirTickable* create(DtDe& de, osg::Node* node,
136  DtOsgArticulatedModel* osgArticulatedMode,
137  const rapidjson::Value& jsonObject, const std::string& modelDefName,
138  const DtElementID elementId, const DtUniqueID uniqueId
139  , const unsigned int nodeTypeIndex);
140 
141  };
142 }
DtOsgArticulatedModel * myOsgArticulatedModel
Definition: DtShipFlagDirTickable.h:112
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:34
float myLastFlagDir
Last update wind direction.
Definition: DtShipFlagDirTickable.h:94
DtSceneObject * mySceneObject
The scene object we are querying.
Definition: DtShipFlagDirTickable.h:91
#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
Strings to get the different parts of the meta file Use these instead of hardcoded strings...
Definition: DtShipFlagDirTickable.h:78
An articulated model manipulator for controlling an articulated model. Supports indirect rendering of...
Definition: DtOsgArticulatedModel.h:69
static const char * theRotDirCW
Strings to get the different parts of the meta file Use these instead of hardcoded strings...
Definition: DtShipFlagDirTickable.h:80
static const char * theTagRotDir
Strings to get the different parts of the meta file Use these instead of hardcoded strings...
Definition: DtShipFlagDirTickable.h:79
IMGUI_API void Value(const char *prefix, bool b)
DtTime myLastTime
Last update time.
Definition: DtShipFlagDirTickable.h:100
Class to manage disconnection of boost connections on deletion.
Definition: DtSignalConnectionManager.h:20
The DtCoordinateSystem is used to manage the current coordinate system of the scene.
Definition: DtCoordinateSystem.h:40
osgSim::DOFTransform * myWindDirNode
Transform for the wind to act upon.
Definition: DtShipFlagDirTickable.h:103
float myRotOffset
The rotation offset to bring the model&#39;s rotation in line with the wind&#39;s direction.
Definition: DtShipFlagDirTickable.h:107
DtVector myLastPos
Last position.
Definition: DtShipFlagDirTickable.h:97
Base class to provide boost signal/slot management.
A DtSceneObject represents an object that can be positioned in the scene by (possibly) attaching it t...
Definition: DtSceneObject.h:42
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 makVrv::DtMetaObjectCreator class.
DtShipFlagDirTickableCreator class.
Definition: DtShipFlagDirTickable.h:123
DtSignalConnectionManager myConnections
Definition: DtShipFlagDirTickable.h:114
float myRotDir
Clockwise or counterclockwise rotation.
Definition: DtShipFlagDirTickable.h:110
static const char * theShipFlagDirFeatureName
Strings to get the different parts of the meta file Use these instead of hardcoded strings...
Definition: DtShipFlagDirTickable.h:77
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 Sun Dec 4 20:22:03 EST 2022 from SVN revision 249613
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)