Chira Engine
A customizable MIT-licensed game engine.
SkyboxComponent.h
1 #pragma once
2 
3 #include <render/material/MaterialCubemap.h>
4 #include <render/mesh/MeshDataBuilder.h>
5 
6 namespace chira {
7 
9  explicit SkyboxComponent(const std::string& cubemapId = "file://materials/skybox.json") {
10  this->skybox.addCube({}, {1, 1, 1}, false);
11  this->skybox.update();
12  this->skybox.setMaterial(Resource::getResource<MaterialCubemap>(cubemapId).cast<IMaterial>());
13  }
14 
15 public:
16  MeshDataBuilder skybox{};
17 };
18 
19 } // namespace chira