VR-Forces 4.7 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtShipFlagSwitchTickable.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
13 #include <vrvCore/vrvCore.h>
15 #include <matrix/vlVector.h>
16 #include <rapidjson/document.h>
17 #include <osgSim/MultiSwitch>
18 
19 namespace makVrv
20 {
21  class DtDisplayUnitsConverter;
22  class DtSceneObject;
23 
29  {
30  public:
31 
33  DtShipFlagSwitchTickable(DtDe& de, DtElementID elementId, DtUniqueID sceneObjectId,
34  DtUniqueID uniqueId, bool useInstancing, unsigned int nodeTypeIndex);
35 
37  virtual ~DtShipFlagSwitchTickable();
38 
40  DtVector computeWindVec(DtSceneObject* sceneObj, float windDirRad);
41 
43  virtual void update( DtTime tNow );
44 
45  void SetWindNodeSwitch(double windSpeed);
46 
55  virtual bool needsUpdate( DtTime tNow );
56 
58  virtual void configure(osg::Node* n, const rapidjson::Value& windJsonData);
59 
61  unsigned int getSwitchIndexForSpeed(double windSpeed);
62 
63  public:
64  // @{
67  static const char* theShipFlagSwitchFeatureName;
68  static const char* theTagWindSpeeds;
69  static const char* theTagSwitchIndices;
70  // @}
71 
72  protected:
75 
78 
81 
84 
87 
90 
92  osgSim::MultiSwitch* myWindSwitchNode;
93 
95  std::vector<double> myWindSpeeds;
96  std::vector<int> mySwitchIndices;
97  };
98 
102  {
103 
104  public:
105 
108 
111 
113  virtual DtShipFlagSwitchTickable* create(DtDe& de, osg::Node* node,
114  DtOsgArticulatedModel* osgArticulatedModel,
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 }

Document ID: Generated on Fri Apr 26 21:53:14 EDT 2019 from SVN revision 197883
Copyright © 2005-2019 VT MAK. All Rights Reserved (www.mak.com)