Engine²
Open-source game engine written in C++.
Loading...
Searching...
No Matches
Material.hpp
Go to the documentation of this file.
1/**************************************************************************
2 * EngineSquared v0.1.1
3 *
4 * EngineSquared is a software package, part of the Engine² organization.
5 *
6 * This file is part of the EngineSquared project that is under MIT License.
7 * Copyright © 2025-present by @EngineSquared, All rights reserved.
8 *
9 * EngineSquared is a free software: you can redistribute it and/or modify
10 * it under the terms of the MIT License. See the project's LICENSE file for
11 * the full license text and details.
12 *
13 * @file Material.hpp
14 * @brief Material struct declaration.
15 *
16 * This struct is used to represent a material.
17 *
18 * @author @EngineSquared
19 * @version 0.1.1
20 * @date 2025-10-04
21 **************************************************************************/
22
23#pragma once
24
25#include <entt/core/hashed_string.hpp>
26#include <glm/glm.hpp>
27#include <string>
28#include <vector>
29
30namespace Object::Component {
31
41struct Material {
42 using Id = entt::hashed_string;
43
44 std::string name;
45
46 glm::vec3 ambient = glm::vec3(1.f);
47 glm::vec3 diffuse = glm::vec3(1.f);
48 glm::vec3 specular;
49 glm::vec3 transmittance;
50 glm::vec3 emission;
51 float shininess;
52 float ior; // index of refraction
53 float dissolve; // 1 == opaque; 0 == fully transparent
54
55 std::string diffuseTexName;
56
57 explicit Material() = default;
58 ~Material() = default;
59
60 // Copy
61 explicit Material(const Material &other) = default;
62 Material &operator=(const Material &other) = default;
63
64 // Move
65 Material(Material &&other) = default;
66 Material &operator=(Material &&other) = default;
67};
68
69} // namespace Object::Component
Definition AmbientLight.hpp:5
Material & operator=(Material &&other)=default
std::string name
Definition Material.hpp:44
glm::vec3 specular
Definition Material.hpp:48
float shininess
Definition Material.hpp:51
Material(Material &&other)=default
std::string diffuseTexName
Definition Material.hpp:55
Material(const Material &other)=default
glm::vec3 ambient
Definition Material.hpp:46
Material & operator=(const Material &other)=default
float dissolve
Definition Material.hpp:53
float ior
Definition Material.hpp:52
glm::vec3 transmittance
Definition Material.hpp:49
entt::hashed_string Id
Definition Material.hpp:42
glm::vec3 emission
Definition Material.hpp:50
glm::vec3 diffuse
Definition Material.hpp:47