VR-Forces 4.6.1 Class Documentation
Home
Modules
Namespaces
Classes
Files
Examples
Behavior Models
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Groups
Pages
include
vrvOsg
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
11
#include <
vrvOsg/DtDynamicFeatureTickable.h
>
12
#include <
vrvOsg/DtMetaObjectCreator.h
>
13
#include <
vrvCore/vrvCore.h
>
14
#include <
vrvCore/DtDoubleSmoother.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
27
class
DT_DLL_VRVOSG
DtShipFlagSwitchTickable
:
28
public
DtDynamicFeatureTickable
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
:
74
DtSceneObject
*
mySceneObject
;
75
77
float
myLastWindSpeed
;
78
80
DtVector
myLastPos
;
81
83
DtTime
myLastTime
;
84
86
DtDoubleSmoother
myFlagSpeedSmoother
;
87
89
DtDisplayUnitsConverter
&
myConverter
;
90
92
osgSim::MultiSwitch*
myWindSwitchNode
;
93
95
std::vector<double>
myWindSpeeds
;
96
std::vector<int>
mySwitchIndices
;
97
};
98
101
class
DT_DLL_VRVOSG
DtShipFlagSwitchTickableCreator
:
public
DtMetaObjectCreator
102
{
103
104
public
:
105
107
DtShipFlagSwitchTickableCreator
();
108
110
virtual
~
DtShipFlagSwitchTickableCreator
();
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 Wed Jul 25 16:57:45 EDT 2018 from SVN revision 190790
Copyright © 2005-2018 VT MÄK. All Rights Reserved (
www.mak.com
)