VR-Vantage 3.2 API Documentation
Home
Modules
Namespaces
Classes
Files
Libraries
Examples
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Groups
Pages
include
vrvGraphicsUtils
DtLight.h
Go to the documentation of this file.
1
/******************************************************************************
2
** Copyright (c) 2023 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/DtUserObjectBindings.h
>
15
#include <
vrvGraphicsUtils/DtForwardDeclare.h
>
16
17
#include <
vrvMath/DtColorValue.h
>
18
#include <
vrvMath/DtVector3.h
>
19
#include <
vrvMath/DtAxisAlignedBoundingBox.h
>
20
#include <
vrvMath/DtMath.h
>
21
#include <
vrvMath/DtReusableMemoryVector.h
>
22
FORWARD_DECLARE_DIFFERENT_SUFFIX
(DtLight, Light)
23
24
#include <array>
25
26
namespace
makVrv
27
{
28
class
DtLight;
29
class
DtLightManager;
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
49
class
DT_DLL_VRVGRAPHICSUTILS
DtLight
50
{
51
public
:
53
DtLight
(
DtLightManager
* lightManager);
54
56
virtual
~
DtLight
();
57
59
DtLight
& operator=(
const
DtLight
& rhs);
60
61
private
:
63
DtLight
() =
delete
;
64
66
DtLight
(
const
DtLight
& rhs) =
delete
;
67
68
public
:
70
71
virtual
void
setOn(
bool
bOn);
72
virtual
bool
isOn(
void
)
const
;
74
76
77
78
79
80
81
virtual
void
setLightType(
LightType
lightType);
82
virtual
LightType
lightType(
void
)
const
;
84
86
87
88
89
90
virtual
void
setSensorMask(
unsigned
int
sensorMask);
91
virtual
unsigned
int
sensorMask()
const
;
93
94
96
97
virtual
void
setAmbientColor(
const
DtColorValue
& color);
98
virtual
void
setDiffuseColor(
const
DtColorValue
& color);
99
virtual
void
setSpecularColor(
const
DtColorValue
& color);
101
103
104
virtual
const
DtColorValue
& ambientColor(
void
)
const
;
105
virtual
const
DtColorValue
& diffuseColor(
void
)
const
;
106
virtual
const
DtColorValue
& specularColor(
void
)
const
;
108
110
virtual
void
setPosition(
const
Vector3_64
& vPosition);
111
virtual
const
Vector3_64
& position(
void
)
const
;
112
114
virtual
void
setDirection(
const
Vector3_64
& vDirection);
115
virtual
const
Vector3_64
& direction(
void
)
const
;
116
118
119
virtual
void
setRange(
float32
fRange);
120
virtual
float32
range(
void
)
const
;
121
virtual
float32
squaredRange(
void
)
const
;
123
125
126
virtual
void
setAttenuation(
float32
fConstant,
float32
fLinear,
float32
fQuadratic);
127
128
virtual
float32
constantAttenuation(
void
)
const
;
129
virtual
float32
linearAttenuation(
void
)
const
;
130
virtual
float32
quadraticAttenuation(
void
)
const
;
131
132
virtual
void
getAttenuation(
float32
attenuations[3])
const
;
134
135
137
138
virtual
void
setSpotLightParameters(
const
DtDegrees
& fInnerAngleDegrees
139
,
const
DtDegrees
& fOuterAngleDegrees
140
,
float32
fFalloff);
141
142
virtual
void
setSpotLightAngles(
const
DtDegrees
& fInnerAngleDegrees,
const
DtDegrees
& fOuterAngleDegrees);
143
virtual
void
spotLightAngles(
DtDegrees
& fInnerAngleDegrees,
DtDegrees
& fOuterAngleDegrees);
144
145
virtual
DtDegrees
innerAngle(
void
)
const
;
146
virtual
DtDegrees
outerAngle(
void
)
const
;
147
virtual
float32
falloff(
void
)
const
;
149
151
152
virtual
void
setReserved(
bool
val);
153
virtual
bool
reserved(
void
)
const
;
155
157
158
virtual
void
setOctreeNode(
void
* pUserData);
159
virtual
void
* octreeNode()
const
;
161
163
virtual
LightGroup
lightGroup()
const
;
164
166
virtual
void
setLightGroup(
LightGroup
group);
167
169
virtual
const
AxisAlignedBoundingBox_64
& worldAABB(
void
)
const
;
170
172
virtual
bool
isInitted()
const
;
173
176
virtual
void
setLightSourceTypeId(
unsigned
int
lightSourceTypeId);
177
179
virtual
unsigned
int
lightSourceTypeId()
const
;
180
182
virtual
void
printDetails(
void
)
const
;
183
185
virtual
void
setUserValue(
float64
val);
186
188
virtual
float64
userValue(
void
)
const
;
189
190
protected
:
191
friend
class
DtLightScreenSpaceData
;
192
194
virtual
void
getArbitraryBasisVectors(
Vector3_64
& vBasis0,
Vector3_64
& vBasis1)
const
;
196
virtual
void
getArbitraryBasisPoints(
float
distance
, std::array<Vector3_64, 4>& point)
const
;
198
virtual
float
getAngleFactor()
const
;
199
201
virtual
Vector3_64
getSpotCenter()
const
;
202
204
virtual
void
UpdateBounds(
void
);
205
206
protected
:
207
208
LightType
myLightType
;
209
210
unsigned
int
mySensorMask
;
//bit 0 is visual, bit 1 is NVG, bit 2 is MWIR, bit 3 is LWIR
211
212
DtColorValue
myAmbientColor
;
213
DtColorValue
myDiffuseColor
;
214
DtColorValue
mySpecularColor
;
215
217
Vector3_64
myVecPosition
;
219
Vector3_64
myVecDirection
;
220
221
float32
myfRange
;
222
float32
myfSquaredRange
;
223
224
float32
myfConstantAttenuation
;
225
float32
myfLinearAttenuation
;
226
float32
myfQuadraticAttenuation
;
227
229
DtDegrees
myfInnerAngle
;
231
DtDegrees
myfOuterAngle
;
233
float32
myfFallOff
;
234
235
bool
mybIsOn
;
237
bool
mybIsInitted
;
239
bool
myIsReserved =
false
;
240
void
*
myOctreeNode
;
241
242
AxisAlignedBoundingBox_64
myWorldAABB
;
243
247
LightGroup
myLightGroup
;
248
DtLightManager
*
myLightManager
;
249
250
unsigned
int
myLightSourceTypeId
;
251
252
float64
myUserValue
;
253
};
254
255
// initializer for a light pointer
256
struct
DtLightPointerInitializer
257
{
258
public
:
259
void
operator()
(
DtLight
*& light)
260
{
261
light =
nullptr
;
262
}
263
};
264
265
// a reusable vector of DtLight pointers
266
typedef
DtReusableMemoryVector<DtLight*, DtLightPointerInitializer>
LightReusableVector
;
267
268
}
//namespace makVrv
269
270
#pragma warning( pop )
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (
www.mak.com
)