VR-Vantage 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) 2014 MAK Technologies, Inc.
3
** All rights reserved.
4
******************************************************************************/
5
9
#pragma once
10
11
#include "
vrvGraphicsUtils/DtGraphicsUtilsPreReqs.h
"
12
13
#pragma warning( push )
14
#pragma warning( disable : 4251 )
15
16
#include "
DtColorValue.h
"
17
#include "
DtVectorForwardDeclare.h
"
18
#include "
DtVector3.h
"
19
#include "
DtAxisAlignedBoundingBox.h
"
20
#include "
DtUserObjectBindings.h
"
21
#include "
DtMath.h
"
22
#include "
DtForwardDeclare.h
"
23
FORWARD_DECLARE_DIFFERENT_SUFFIX
(DtLight, Light)
24
25
#include <boost/signals.hpp>
26
27
namespace
makVrv {
28
29
typedef
boost::signal< void(const DtLight*) >
LightSignal
;
30
31
enum
LightType
32
{
33
LT_DIRECTIONAL
= 0
34
,
LT_POINT
= 1
35
,
LT_SPOTLIGHT
= 2
36
};
37
38
enum
LightGroup
39
{
40
LG_UNKNOWN
= 0
41
,
LG_PROPS
= 1
42
,
LG_TERRAIN
= 2
43
};
44
47
class
DT_DLL_VRVGRAPHICSUTILS
DtLight
48
{
49
public
:
51
DtLight
(
void
);
52
54
virtual
~
DtLight
();
55
57
58
void
setOn(
bool
bOn);
59
bool
isOn(
void
)
const
;
61
63
64
65
66
67
68
void
setLightType(
LightType
lightType);
69
LightType
lightType(
void
)
const
;
71
73
74
void
setAmbientColor(
const
DtColorValue
&
color
);
75
void
setDiffuseColor(
const
DtColorValue
& color);
76
void
setSpecularColor(
const
DtColorValue
& color);
78
80
81
const
DtColorValue
& ambientColor(
void
)
const
;
82
const
DtColorValue
& diffuseColor(
void
)
const
;
83
const
DtColorValue
& specularColor(
void
)
const
;
85
87
void
setPosition(
const
Vector3_64
& vPosition);
88
const
Vector3_64
& position(
void
)
const
;
89
91
void
setDirection(
const
Vector3_64
& vDirection);
92
const
Vector3_64
& direction(
void
)
const
;
93
95
96
void
setRange(
float32
fRange);
97
float32
range
(
void
)
const
;
98
float32
squaredRange(
void
)
const
;
100
102
103
void
setAttenuation(
float32
fConstant,
float32
fLinear,
float32
fQuadratic);
104
105
float32
constantAttenuation(
void
)
const
;
106
float32
linearAttenuation(
void
)
const
;
107
float32
quadraticAttenuation(
void
)
const
;
108
109
void
getAttenuation(
float32
attenuations[3])
const
;
111
112
114
115
void
setSpotLightParameters(
DtDegrees
fInnerAngleDegrees
116
,
DtDegrees
fOuterAngleDegrees
117
,
float32
fFalloff);
118
119
void
setSpotLightAngles(
DtDegrees
fInnerAngleDegrees,
DtDegrees
fOuterAngleDegrees);
120
void
getSpotLightAngles(
DtDegrees
& fInnerAngleDegrees,
DtDegrees
& fOuterAngleDegrees);
121
122
DtDegrees
innerAngle(
void
)
const
;
123
DtDegrees
outerAngle(
void
)
const
;
124
float32
falloff(
void
)
const
;
126
128
129
DtUserObjectBindings
& getUserObjectBindings(
void
);
130
const
DtUserObjectBindings
& getUserObjectBindings(
void
)
const
;
132
134
135
LightSignal
signal_LightUpdated
;
136
LightSignal
signal_LightBoundsUpdated
;
137
LightSignal
signal_LightDestroyed
;
138
139
void
enableSignals(
bool
enable
);
140
bool
signalsEnabled(
void
)
const
;
142
144
LightGroup
lightGroup()
const
;
145
147
void
setLightGroup(
LightGroup
group
);
148
149
const
AxisAlignedBoundingBox_64
& getWorldAABB(
void
)
const
;
150
151
float64
myTempValue
;
152
153
static
const
std::string
& getReservedBindingKey(
void
)
154
{
155
return
mystrReservedBinding;
156
}
157
158
const
DtLight
& operator=(
const
DtLight
& rhs);
159
160
private
:
161
162
LightType
myLightType
;
163
164
DtColorValue
myAmbientColor
;
165
DtColorValue
myDiffuseColor
;
166
DtColorValue
mySpecularColor
;
167
169
Vector3_64
myVecPosition
;
171
Vector3_64
myVecDirection
;
172
173
float32
myfRange
;
174
float32
myfSquaredRange
;
175
176
float32
myfConstantAttenuation
;
177
float32
myfLinearAttenuation
;
178
float32
myfQuadraticAttenuation
;
179
181
DtDegrees
myfInnerAngle
;
183
DtDegrees
myfOuterAngle
;
185
float32
myfFallOff
;
186
187
bool
mybIsOn
;
188
189
DtUserObjectBindings
myUserObjectBindings
;
190
191
void
UpdateBounds(
void
);
192
AxisAlignedBoundingBox_64
myWorldAABB
;
193
194
static
const
std::string
mystrReservedBinding
;
195
196
bool
mySignalsEnabled
;
197
201
LightGroup
myLightGroup
;
202
};
203
204
}
//namespace makVrv
205
206
#pragma warning( pop )
Copyright © 2005-2013 VT MÄK. All Rights Reserved (
www.mak.com
)