mirror of
https://github.com/MadeOfJelly/MushMachine.git
synced 2025-06-20 19:56:37 +02:00
initial import, >900commits predate this
This commit is contained in:
23
systems/fast_sky_sun/src/mm/systems/fast_sky_sun_system.cpp
Normal file
23
systems/fast_sky_sun/src/mm/systems/fast_sky_sun_system.cpp
Normal file
@ -0,0 +1,23 @@
|
||||
#include "./fast_sky_sun_system.hpp"
|
||||
|
||||
#include <mm/services/scene_service_interface.hpp>
|
||||
|
||||
#include <entt/entity/registry.hpp>
|
||||
|
||||
#include <mm/opengl/render_tasks/fast_sky_render_task.hpp>
|
||||
|
||||
#include <glm/trigonometric.hpp>
|
||||
|
||||
namespace MM::Systems {
|
||||
|
||||
void FastSkySun(Scene& scene, float delta) {
|
||||
auto& sky_ctx = scene.ctx<MM::OpenGL::RenderTasks::FastSkyContext>();
|
||||
|
||||
sky_ctx.time += delta * 0.2f;
|
||||
|
||||
sky_ctx.fsun.y = glm::sin(sky_ctx.time * 0.01f);
|
||||
sky_ctx.fsun.z = glm::cos(sky_ctx.time * 0.01f);
|
||||
}
|
||||
|
||||
} // MM::Systems
|
||||
|
11
systems/fast_sky_sun/src/mm/systems/fast_sky_sun_system.hpp
Normal file
11
systems/fast_sky_sun/src/mm/systems/fast_sky_sun_system.hpp
Normal file
@ -0,0 +1,11 @@
|
||||
#pragma once
|
||||
|
||||
#include <mm/engine_fwd.hpp>
|
||||
|
||||
namespace MM::Systems {
|
||||
|
||||
// this system updates time and sun depending on time with the time delta
|
||||
void FastSkySun(Scene& scene, float delta);
|
||||
|
||||
} // MM::Systems
|
||||
|
Reference in New Issue
Block a user