mirror of
https://github.com/MadeOfJelly/MushMachine.git
synced 2025-06-19 11:16:37 +02:00
port everything over to organizer
This commit is contained in:
@ -11,6 +11,7 @@ target_include_directories(fast_sky_sun_system PUBLIC "${CMAKE_CURRENT_SOURCE_DI
|
||||
target_link_libraries(fast_sky_sun_system
|
||||
engine
|
||||
fast_sky_render_task
|
||||
common_components
|
||||
)
|
||||
|
||||
if(EMSCRIPTEN)
|
||||
|
@ -2,6 +2,8 @@
|
||||
|
||||
#include <mm/services/scene_service_interface.hpp>
|
||||
|
||||
#include <mm/components/time_delta.hpp>
|
||||
|
||||
#include <entt/entity/registry.hpp>
|
||||
|
||||
#include <mm/opengl/render_tasks/fast_sky_render_task.hpp>
|
||||
@ -10,10 +12,8 @@
|
||||
|
||||
namespace MM::Systems {
|
||||
|
||||
void FastSkySun(Scene& scene, float delta) {
|
||||
auto& sky_ctx = scene.ctx<MM::OpenGL::RenderTasks::FastSkyContext>();
|
||||
|
||||
sky_ctx.time += delta * 0.2f;
|
||||
void fast_sky_sun(MM::OpenGL::RenderTasks::FastSkyContext& sky_ctx, const MM::Components::TimeDelta& delta) {
|
||||
sky_ctx.time += delta.tickDelta * 0.2f;
|
||||
|
||||
sky_ctx.fsun.y = glm::sin(sky_ctx.time * 0.01f);
|
||||
sky_ctx.fsun.z = glm::cos(sky_ctx.time * 0.01f);
|
||||
|
@ -2,10 +2,18 @@
|
||||
|
||||
#include <mm/engine_fwd.hpp>
|
||||
|
||||
// fwd
|
||||
namespace MM::OpenGL::RenderTasks {
|
||||
struct FastSkyContext;
|
||||
}
|
||||
namespace MM::Components {
|
||||
struct TimeDelta;
|
||||
}
|
||||
|
||||
namespace MM::Systems {
|
||||
|
||||
// this system updates time and sun depending on time with the time delta
|
||||
void FastSkySun(Scene& scene, float delta);
|
||||
void fast_sky_sun(MM::OpenGL::RenderTasks::FastSkyContext& c, const MM::Components::TimeDelta& delta);
|
||||
|
||||
} // MM::Systems
|
||||
|
||||
|
Reference in New Issue
Block a user