My Project
Loading...
Searching...
No Matches
dev
engine
src
lights.hh
Go to the documentation of this file.
1
#pragma once
2
3
#include <glm/glm.hpp>
4
#include "
imgui.h
"
5
#include "vendor/imgui/imgui.h"
6
7
// types os lights:
8
struct
PointLight
9
{
10
glm::vec3
position
;
11
12
glm::vec3
ambient
;
13
glm::vec3
diffuse
;
14
glm::vec3
specular
;
15
16
float
constant
;
17
float
linear
;
18
float
quadratic
;
19
20
PointLight
(
float
position
,
float
ambient
,
float
diffuse
,
float
specular
,
float
constant
= 0.0f,
float
linear
= 0.0f,
float
quadratic
= 0.0f)
21
:
position
(
position
),
ambient
(
ambient
),
diffuse
(
diffuse
),
specular
(
specular
),
constant
(
constant
),
linear
(
linear
),
quadratic
(
quadratic
){};
22
23
void
set_position
(
float
x,
float
y,
float
z){
24
position
.x = x;
25
position
.y = y;
26
position
.z = z;
27
}
28
};
29
30
struct
DirLight
31
{
32
glm::vec3
direction
;
33
34
glm::vec3
ambient
;
35
glm::vec3
diffuse
;
36
glm::vec3
specular
;
37
38
DirLight
(
float
direction
,
float
ambient
,
float
diffuse
,
float
specular
)
39
:
direction
(
direction
),
ambient
(
ambient
),
diffuse
(
diffuse
),
specular
(
specular
){};
40
41
void
set_direction
(
float
x,
float
y,
float
z){
42
direction
.x = x;
43
direction
.y = y;
44
direction
.z = z;
45
}
46
};
imgui.h
DirLight
Definition
lights.hh:31
DirLight::diffuse
glm::vec3 diffuse
Definition
lights.hh:35
DirLight::DirLight
DirLight(float direction, float ambient, float diffuse, float specular)
Definition
lights.hh:38
DirLight::ambient
glm::vec3 ambient
Definition
lights.hh:34
DirLight::direction
glm::vec3 direction
Definition
lights.hh:32
DirLight::specular
glm::vec3 specular
Definition
lights.hh:36
DirLight::set_direction
void set_direction(float x, float y, float z)
Definition
lights.hh:41
PointLight
Definition
lights.hh:9
PointLight::set_position
void set_position(float x, float y, float z)
Definition
lights.hh:23
PointLight::quadratic
float quadratic
Definition
lights.hh:18
PointLight::diffuse
glm::vec3 diffuse
Definition
lights.hh:13
PointLight::linear
float linear
Definition
lights.hh:17
PointLight::specular
glm::vec3 specular
Definition
lights.hh:14
PointLight::PointLight
PointLight(float position, float ambient, float diffuse, float specular, float constant=0.0f, float linear=0.0f, float quadratic=0.0f)
Definition
lights.hh:20
PointLight::position
glm::vec3 position
Definition
lights.hh:10
PointLight::constant
float constant
Definition
lights.hh:16
PointLight::ambient
glm::vec3 ambient
Definition
lights.hh:12
Generated by
1.9.8