Called when the layer is attached to the application.
47 {
49
50
51 {
61
70 }
71
72
73
74 {
87 }
88
89
90 {
91 FramebufferSpecification
fbSpec;
95 }
96
97
98 {
99
101
102#if 0
104
107 pCam.Camera.SetPerspective(glm::radians(45.0f), 0.1f, 1000.0f);
111
114
115
116 {
119 transform.Translation = (glm::vec3(-0.5f, 0.0f, -1.5f));
120
121 square.AddComponent<SpriteRendererComponent>(glm::vec4{ 0.8f, 0.8f, 0.2f, 1.0f });
123 for (
int x = 0;
x < 63;
x++)
124 {
125 for (
int y = 0;
y < 2;
y++)
126 {
128 }
129 }
133 }
134
135
136 {
139
140 transform.Translation = (glm::vec3(0.5f, 0.0f, 1.5f));
141
142 square.AddComponent<SpriteRendererComponent>(glm::vec4{ 0.8f, 0.8f, 0.2f, 1.0f });
144 for (
int x = 0;
x < 63;
x++)
145 {
146 for (
int y = 0;
y < 2;
y++)
147 {
149 }
150
151 }
155 }
156
159 quadEntity.GetComponent<TransformComponent>().Scale = { 0.5f, 0.5f, 1.0f };
160 quadEntity.GetComponent<TransformComponent>().Translation = { 1.5f, 0.0f, 0.0f };
161
162
164 public:
165 void OnCreate()
166 {
167 GetComponent<TransformComponent>().Translation = (glm::vec3(Random::RangeF1(-3.0f, 3.0f), Random::RangeF1(-3.0f, 3.0f), 0.0f));
168
169 }
170
171 void OnDestroy()
172 {
173
174 }
175
176 void OnUpdate(Timestep ts)
177 {
178 auto& transform = GetComponent<TransformComponent>().GetTransform();
179 float speed = 5.0f;
180
181
182 if (Input::IsKeyPressed(VZ_KEY_A))
183 transform[3][0] -= speed * ts;
184
185 if (Input::IsKeyPressed(VZ_KEY_D))
186 transform[3][0] += speed * ts;
187
188 if (Input::IsKeyPressed(VZ_KEY_W))
189 transform[3][1] += speed * ts;
190
191 if (Input::IsKeyPressed(VZ_KEY_S))
192 transform[3][1] -= speed * ts;
193 }
194
195 };
196
199
200#endif
201
203
205
207
211
218 MU_CORE_ERROR(
"Error loading the scene, please check the paths and file availability.");
219 }
220 else {
222 }
223 }
225 }
226
227
228 }
#define MU_CORE_ERROR(...)
error: indicates an error that has occurred
Definition Log.h:42
#define MU_CORE_INFO(...)
info: general information about application flow
Definition Log.h:38
ParticleProps m_ParticleProps
Definition EditorLayer.h:86
Ref< SubTexture2D > m_SubTextureSmoke
Definition EditorLayer.h:70
EditorCamera m_EditorCamera
Definition EditorLayer.h:78
Entity m_CameraEntity
Definition EditorLayer.h:47
Ref< Framebuffer > m_Framebuffer
Definition EditorLayer.h:76
Entity m_FireEntity
Definition EditorLayer.h:55
Ref< Texture2D > m_SpriteSheetFire
Definition EditorLayer.h:62
Ref< SubTexture2D > m_SubTextureFire
Definition EditorLayer.h:69
std::unordered_map< char, Ref< SubTexture2D > > s_TextureMap
Definition EditorLayer.h:100
ParticleSystem m_ParticleSystem
Definition EditorLayer.h:85
Ref< Texture2D > m_SpriteSheetTown
Definition EditorLayer.h:64
Ref< Texture2D > m_CheckerboardTexture
Definition EditorLayer.h:60
Ref< Texture2D > m_SpriteSheetRocks
Definition EditorLayer.h:66
Ref< Texture2D > m_SpriteSheetSmoke
Definition EditorLayer.h:63
Entity m_SmokeEntity
Definition EditorLayer.h:55
Ref< SubTexture2D > m_SubTextureTown
Definition EditorLayer.h:71
Ref< Texture2D > m_SpriteSheetCursedLands
Definition EditorLayer.h:67
Ref< Texture2D > m_SpriteSheetCrystals
Definition EditorLayer.h:65
T & GetComponent()
Retrieves a reference to the component of type T attached to the entity if it exists....
Definition Entity.h:73
T & AddComponent(Args &&... args)
Adds a component of type T to the entity with the provided arguments Otherwise, asserts if the entity...
Definition Entity.h:48
static void Initialize()
Definition FileSystem.cpp:16
static std::string GetAbsolutePath(const std::string &relativePath)
Definition FileSystem.cpp:38
static std::string GetCurrentWorkingDirectory()
Definition FileSystem.cpp:33
static Ref< Framebuffer > Create(const FramebufferSpecification &spec)
Creates a framebuffer with the given specification.
Definition Framebuffer.cpp:9
void SetParticleProps(const ParticleProps &particleProps)
Definition ParticleSystem.h:53
static Ref< SubTexture2D > CreateFromCoords(const Ref< Texture2D > &texture, const glm::vec2 &coords, const glm::vec2 &cellSize, const glm::vec2 &spriteSize={1, 1})
Creates a SubTexture2D from a grid of cells within the given texture.
Definition SubTexture2D.cpp:17
static Ref< Texture2D > Create(uint32_t width, uint32_t height)
Definition Texture.cpp:10
float SizeBegin
Definition ParticleSystem.h:19
glm::vec3 Position
Definition ParticleSystem.h:13
float RotationVariation
Definition ParticleSystem.h:23
float Lifetime
Definition ParticleSystem.h:24
glm::vec4 ColorEnd
Definition ParticleSystem.h:18
glm::vec3 VelocityVariation
Definition ParticleSystem.h:16
glm::vec4 ColorBegin
Definition ParticleSystem.h:17
float Rotation
Definition ParticleSystem.h:22
glm::vec3 Velocity
Definition ParticleSystem.h:15
float SizeEnd
Definition ParticleSystem.h:20