SpiecsEngine
 
Loading...
Searching...
No Matches
SkyBoxComponent.cpp
Go to the documentation of this file.
1/**
2* @file SkyBoxComponent.cpp.
3* @brief The SkyBoxComponent Class Implementation.
4* @author Spices.
5*/
6
7#include "Pchheader.h"
9#include "Render/FrameInfo.h"
10#include "World/Entity.h"
11
12namespace Spices {
13
15 {
17
18 /**
19 * @brief Use SpherePack Instead
20 */
21 std::shared_ptr<CubePack> pack = std::make_shared<CubePack>(2, 2);
22 //pack->SetMaterial(path);
23
24 m_Mesh = Mesh::Builder().AddPack(pack).Build();
25 }
26
28 {
29
30 }
31
33 {
34
35 }
36
38 {
40
42 }
43
44 void SkyBoxComponent::SetMaterial(const std::string& materialPath)
45 {
47
48 auto e = FrameInfo::Get().m_World->QueryEntitybyID((uint32_t)m_Owner);
49
50 m_Mesh->GetPacks().for_each([&](const auto& k, const auto& v) {
51 v->SetMaterial(materialPath);
52 v->GetMeshDesc().UpdatemodelAddress(e.GetComponent<TransformComponent>().GetModelBufferAddress());
53 v->GetMeshDesc().UpdateentityID((uint32_t)m_Owner);
54
55 return false;
56 });
57 }
58}
#define SPICES_PROFILE_ZONE
CubePack Class. This class defines box type mesh pack.
Definition MeshPack.h:446
virtual void DrawThis() override
This interface defines how to draw this component to property panel.
MeshComponent Class. This class defines the specific behaves of MeshComponent.
virtual void DrawThis() override
This interface defines how to draw this component to property panel.
SkyBoxComponent()
Constructor Function.
virtual void OnDeSerialize() override
This interface defines how to deserialize.
virtual void OnSerialize() override
This interface defines how to serialize.
void SetMaterial(const std::string &materialPath)
Set SkyBox Material.
SkyBoxComponent Class. This class defines the specific behaves of SkyBoxComponent.