DIE Engine
Toggle main menu visibility
Loading...
Searching...
No Matches
env.h
Go to the documentation of this file.
1
11
12
#ifndef ENV_H
13
#define ENV_H
14
15
#include <stdint.h>
16
17
/*****************************************************************************/
22
typedef
struct
{
23
float
hour
;
24
float
angle
;
25
uint32_t
ambientColor
;
26
uint32_t
rayColor
;
27
float
ambientStrength
;
28
float
rayStrength
;
29
}
Sun
;
30
31
typedef
enum
{
32
FOG_FLAG_ENABLE
= 0x0001,
33
}
FOG_FLAGS
;
34
38
typedef
struct
{
39
float
distanceNear
;
40
float
distanceFar
;
41
uint32_t
color
;
42
uint16_t
flags
;
43
}
Fog
;
44
45
/*****************************************************************************/
46
// Field-wise comparisons (structs carry padding, memcmp is not reliable)
47
inline
bool
operator==
(
const
Sun
& a,
const
Sun
& b)
48
{
49
return
a.
hour
== b.
hour
&&
50
a.
angle
== b.
angle
&&
51
a.
ambientColor
== b.
ambientColor
&&
52
a.
rayColor
== b.
rayColor
&&
53
a.
ambientStrength
== b.
ambientStrength
&&
54
a.
rayStrength
== b.
rayStrength
;
55
}
56
57
inline
bool
operator==
(
const
Fog
& a,
const
Fog
& b)
58
{
59
return
a.
distanceNear
== b.
distanceNear
&&
60
a.
distanceFar
== b.
distanceFar
&&
61
a.
color
== b.
color
&&
62
a.
flags
== b.
flags
;
63
}
64
65
/*****************************************************************************/
66
class
Env
67
{
68
public
:
69
Env
();
70
72
void
init
();
73
75
void
terminate
();
76
78
void
pass
();
79
80
Sun
sun
;
81
Fog
fog
;
82
};
83
84
#endif
// ENV_H
Env::init
void init()
Set the default sun & fog properties.
Definition
env.cpp:27
Env::sun
Sun sun
Definition
env.h:80
Env::fog
Fog fog
Definition
env.h:81
Env::Env
Env()
Definition
env.cpp:20
Env::terminate
void terminate()
Release the environment resources.
Definition
env.cpp:42
Env::pass
void pass()
Push the environment properties to the renderer.
Definition
env.cpp:48
operator==
bool operator==(const Sun &a, const Sun &b)
Definition
env.h:47
FOG_FLAGS
FOG_FLAGS
Definition
env.h:31
FOG_FLAG_ENABLE
@ FOG_FLAG_ENABLE
Definition
env.h:32
Fog
Distance fog properties.
Definition
env.h:38
Fog::flags
uint16_t flags
combination of FOG_FLAGS
Definition
env.h:42
Fog::color
uint32_t color
packed RGB fog color
Definition
env.h:41
Fog::distanceNear
float distanceNear
fog start distance, in world units
Definition
env.h:39
Fog::distanceFar
float distanceFar
fog full-density distance, in world units
Definition
env.h:40
Sun
Sun lighting properties.
Definition
env.h:22
Sun::angle
float angle
sun tilt, in hours (0 .. 24)
Definition
env.h:24
Sun::ambientColor
uint32_t ambientColor
packed RGB ambient color
Definition
env.h:25
Sun::rayColor
uint32_t rayColor
packed RGB direct ray color
Definition
env.h:26
Sun::hour
float hour
sun azimuth, in hours (0 .. 24)
Definition
env.h:23
Sun::ambientStrength
float ambientStrength
ambient intensity (0.0 .. 1.0)
Definition
env.h:27
Sun::rayStrength
float rayStrength
ray intensity (0.0 .. 1.0)
Definition
env.h:28
common
engine
env.h
Generated by
1.17.0