VR-Vantage 2.5 API Documentation
Home
Modules
Namespaces
Classes
Files
Libraries
Examples
Tutorials
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
include
vrvGraphicsUtils
DtLight.h
Go to the documentation of this file.
1
/******************************************************************************
2
** Copyright (c) 2017 MAK Technologies, Inc.
3
** All rights reserved.
4
******************************************************************************/
5
9
#pragma once
10
11
#pragma warning( push )
12
#pragma warning( disable : 4251 )
13
14
#include <
vrvGraphicsUtils/DtColorValue.h
>
15
#include <
vrvGraphicsUtils/DtVectorForwardDeclare.h
>
16
#include <
vrvGraphicsUtils/DtAxisAlignedBoundingBox.h
>
17
#include <
vrvGraphicsUtils/DtUserObjectBindings.h
>
18
#include <
vrvGraphicsUtils/DtMath.h
>
19
#include <
vrvGraphicsUtils/DtForwardDeclare.h
>
20
FORWARD_DECLARE_DIFFERENT_SUFFIX
(DtLight, Light)
21
22
#include <boost/signals.hpp>
23
24
namespace
makVrv {
25
26
typedef
boost::signal< void(const DtLight*) >
LightSignal
;
27
28
enum
LightType
29
{
30
LT_DIRECTIONAL
= 0
31
,
LT_POINT
= 1
32
,
LT_SPOTLIGHT
= 2
33
};
34
35
enum
LightGroup
36
{
37
LG_UNKNOWN
= 0
38
,
LG_PROPS
= 1
39
,
LG_TERRAIN
= 2
40
};
41
44
class
DT_DLL_VRVGRAPHICSUTILS
DtLight
45
{
46
public
:
48
DtLight
(
void
);
49
51
~
DtLight
();
52
54
55
void
setOn(
bool
bOn);
56
bool
isOn
(
void
)
const
{
return
mybIsOn; }
58
60
61
62
63
64
65
void
setLightType(
LightType
lightType);
66
LightType
lightType(
void
)
const
;
68
70
71
void
setAmbientColor(
const
DtColorValue
&
color
);
72
void
setDiffuseColor(
const
DtColorValue
&
color
);
73
void
setSpecularColor(
const
DtColorValue
&
color
);
75
77
78
const
DtColorValue
& ambientColor(
void
)
const
;
79
const
DtColorValue
& diffuseColor(
void
)
const
;
80
const
DtColorValue
& specularColor(
void
)
const
;
82
84
void
setPosition(
const
Vector3_64
& vPosition);
85
const
Vector3_64
& position(
void
)
const
;
86
88
void
setDirection(
const
Vector3_64
& vDirection);
89
const
Vector3_64
& direction(
void
)
const
;
90
92
93
void
setRange(
float32
fRange);
94
float32
range
(
void
)
const
;
95
float32
squaredRange(
void
)
const
;
97
99
100
void
setAttenuation(
float32
fConstant,
float32
fLinear,
float32
fQuadratic);
101
102
float32
constantAttenuation(
void
)
const
;
103
float32
linearAttenuation(
void
)
const
;
104
float32
quadraticAttenuation(
void
)
const
;
105
106
void
getAttenuation(
float32
attenuations[3])
const
;
108
109
111
112
void
setSpotLightParameters(
const
DtDegrees
& fInnerAngleDegrees
113
,
const
DtDegrees
& fOuterAngleDegrees
114
,
float32
fFalloff);
115
116
void
setSpotLightAngles(
const
DtDegrees
& fInnerAngleDegrees,
const
DtDegrees
& fOuterAngleDegrees);
117
void
getSpotLightAngles(
DtDegrees
& fInnerAngleDegrees,
DtDegrees
& fOuterAngleDegrees);
118
119
DtDegrees
innerAngle(
void
)
const
;
120
DtDegrees
outerAngle(
void
)
const
;
121
float32
falloff(
void
)
const
;
123
125
126
DtUserObjectBindings
& getUserObjectBindings(
void
);
127
const
DtUserObjectBindings
& getUserObjectBindings(
void
)
const
;
129
131
132
void
setUserData
(
void
* pUserData){ myUserData = pUserData; }
133
void
*
userData
()
const
{
return
myUserData; }
135
137
138
LightSignal
signal_LightUpdated
;
139
LightSignal
signal_LightBoundsUpdated
;
140
LightSignal
signal_LightDestroyed
;
141
142
void
enableSignals(
bool
enable
);
143
bool
signalsEnabled(
void
)
const
;
144
145
void
enableUpdateSignals(
bool
enable
);
147
149
LightGroup
lightGroup()
const
;
150
152
void
setLightGroup(
LightGroup
group
);
153
154
const
AxisAlignedBoundingBox_64
& getWorldAABB(
void
)
const
;
155
156
float64
myTempValue
;
157
158
static
const
std::string
& getReservedBindingKey(
void
)
159
{
160
return
mystrReservedBinding;
161
}
162
163
DtLight
& operator=(
const
DtLight
& rhs);
164
165
private
:
166
167
LightType
myLightType
;
168
169
DtColorValue
myAmbientColor
;
170
DtColorValue
myDiffuseColor
;
171
DtColorValue
mySpecularColor
;
172
174
Vector3_64
myVecPosition
;
176
Vector3_64
myVecDirection
;
177
178
float32
myfRange
;
179
float32
myfSquaredRange
;
180
181
float32
myfConstantAttenuation
;
182
float32
myfLinearAttenuation
;
183
float32
myfQuadraticAttenuation
;
184
186
DtDegrees
myfInnerAngle
;
188
DtDegrees
myfOuterAngle
;
190
float32
myfFallOff
;
191
192
bool
mybIsOn
;
193
194
DtUserObjectBindings
myUserObjectBindings
;
195
void
*
myUserData
;
196
197
void
UpdateBounds(
void
);
198
AxisAlignedBoundingBox_64
myWorldAABB
;
199
200
static
const
std::string
mystrReservedBinding
;
201
202
bool
mySignalsEnabled
;
203
bool
myUpdateSignalEnabled
;
204
208
LightGroup
myLightGroup
;
209
};
210
211
}
//namespace makVrv
212
213
#pragma warning( pop )
Copyright © 2005-2019 VT MAK. All Rights Reserved (
www.mak.com
)