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
40
class
DT_DLL_VRVGRAPHICSUTILS
DtLight
41
{
42
public
:
44
DtLight
(
void
);
45
47
virtual
~
DtLight
();
48
50
51
void
SetOn(
bool
bOn);
52
bool
IsOn(
void
)
const
;
54
56
57
58
59
60
61
void
setLightType(
LightType
lightType);
62
LightType
lightType(
void
)
const
;
64
66
67
void
setAmbientColor(
const
DtColorValue
&
color
);
68
void
setDiffuseColor(
const
DtColorValue
& color);
69
void
setSpecularColor(
const
DtColorValue
& color);
71
73
74
const
DtColorValue
& ambientColor(
void
)
const
;
75
const
DtColorValue
& diffuseColor(
void
)
const
;
76
const
DtColorValue
& specularColor(
void
)
const
;
78
80
void
setPosition(
const
Vector3_64
& vPosition);
81
const
Vector3_64
& position(
void
)
const
;
82
84
void
setDirection(
const
Vector3_64
& vDirection);
85
const
Vector3_64
& direction(
void
)
const
;
86
88
89
void
setRange(
float32
fRange);
90
float32
range
(
void
)
const
;
91
float32
squaredRange(
void
)
const
;
93
95
96
void
setAttenuation(
float32
fConstant,
float32
fLinear,
float32
fQuadratic);
97
98
float32
constantAttenuation(
void
)
const
;
99
float32
linearAttenuation(
void
)
const
;
100
float32
quadraticAttenuation(
void
)
const
;
101
102
void
getAttenuation(
float32
attenuations[3])
const
;
104
105
107
108
void
setSpotLightParameters(
DtDegrees
fInnerAngleDegrees
109
,
DtDegrees
fOuterAngleDegrees
110
,
float32
fFalloff);
111
112
void
setSpotLightAngles(
DtDegrees
fInnerAngleDegrees,
DtDegrees
fOuterAngleDegrees);
113
void
getSpotLightAngles(
DtDegrees
& fInnerAngleDegrees,
DtDegrees
& fOuterAngleDegrees);
114
115
DtDegrees
innerAngle(
void
)
const
;
116
DtDegrees
outerAngle(
void
)
const
;
117
float32
falloff(
void
)
const
;
119
121
122
DtUserObjectBindings
& getUserObjectBindings(
void
);
123
const
DtUserObjectBindings
& getUserObjectBindings(
void
)
const
;
125
127
128
LightSignal
signal_LightUpdated
;
129
LightSignal
signal_LightBoundsUpdated
;
130
LightSignal
signal_LightDestroyed
;
131
132
void
enableSignals(
bool
enable
);
133
bool
signalsEnabled(
void
)
const
;
135
136
137
const
AxisAlignedBoundingBox_64
& getWorldAABB(
void
)
const
;
138
139
float64
fTempValue
;
140
141
static
const
std::string
& getReservedBindingKey(
void
)
142
{
143
return
mystrReservedBinding;
144
}
145
146
const
DtLight
& operator=(
const
DtLight
& rhs);
147
private
:
148
149
LightType
myLightType
;
150
151
DtColorValue
myAmbientColor
;
152
DtColorValue
myDiffuseColor
;
153
DtColorValue
mySpecularColor
;
154
156
Vector3_64
myVecPosition
;
158
Vector3_64
myVecDirection
;
159
160
float32
myfRange
;
161
float32
myfSquaredRange
;
162
163
float32
myfConstantAttenuation
;
164
float32
myfLinearAttenuation
;
165
float32
myfQuadraticAttenuation
;
166
168
DtDegrees
myfInnerAngle
;
170
DtDegrees
myfOuterAngle
;
172
float32
myfFallOff
;
173
174
bool
mybIsOn
;
175
176
DtUserObjectBindings
myUserObjectBindings
;
177
178
void
UpdateBounds(
void
);
179
AxisAlignedBoundingBox_64
myWorldAABB
;
180
181
static
const
std::string
mystrReservedBinding
;
182
183
bool
mySignalsEnabled
;
184
};
185
186
}
//namespace makVrv
187
188
#pragma warning( pop )
Copyright © 2005-2013 VT MÄK. All Rights Reserved (
www.mak.com
)