initial import, >900commits predate this

This commit is contained in:
2020-09-29 13:47:50 +02:00
commit e74154ccee
352 changed files with 108120 additions and 0 deletions

View File

@ -0,0 +1,20 @@
cmake_minimum_required(VERSION 3.2)
project(fast_sky_sun_system CXX)
add_library(fast_sky_sun_system
src/mm/systems/fast_sky_sun_system.hpp
src/mm/systems/fast_sky_sun_system.cpp
)
target_include_directories(fast_sky_sun_system PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/src")
target_link_libraries(fast_sky_sun_system
engine
fast_sky_render_task
)
if(EMSCRIPTEN)
set_target_properties(fast_sky_sun_system PROPERTIES COMPILE_FLAGS "-s USE_SDL=2")
set_target_properties(fast_sky_sun_system PROPERTIES LINK_FLAGS "-s USE_SDL=2")
endif()

View 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

View 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