clipping planes for camera

This commit is contained in:
2020-01-28 08:01:34 +07:00
parent bd085efa3a
commit 8f0fac1750
20 changed files with 297 additions and 159 deletions

View File

@@ -32,23 +32,6 @@ namespace
}
};
class camera_system final : public systems::post_update_system {
public:
void process(
ecs::registry& owner,
const systems::post_update_event& event) override
{
E2D_UNUSED(event);
owner.for_joined_components<camera>(
[](const ecs::const_entity&, camera& cam){
if ( !cam.target() ) {
cam.projection(math::make_orthogonal_lh_matrix4(
the<window>().real_size().cast_to<f32>(), 0.f, 1000.f));
}
});
}
};
class game final : public starter::application {
public:
bool initialize() final {
@@ -67,8 +50,7 @@ namespace
bool create_systems() {
ecs::registry_filler(the<world>().registry())
.feature<struct game_feature>(ecs::feature()
.add_system<game_system>()
.add_system<camera_system>());
.add_system<game_system>());
return true;
}
};