mirror of
https://github.com/enduro2d/enduro2d.git
synced 2026-03-22 12:55:33 +07:00
dummy physics system
This commit is contained in:
@@ -49,6 +49,7 @@
|
||||
#include "systems/flipbook_system.hpp"
|
||||
#include "systems/input_system.hpp"
|
||||
#include "systems/label_system.hpp"
|
||||
#include "systems/physics_system.hpp"
|
||||
#include "systems/render_system.hpp"
|
||||
#include "systems/script_system.hpp"
|
||||
#include "systems/spine_system.hpp"
|
||||
|
||||
@@ -69,6 +69,7 @@ namespace e2d
|
||||
class flipbook_system;
|
||||
class input_system;
|
||||
class label_system;
|
||||
class physics_system;
|
||||
class render_system;
|
||||
class script_system;
|
||||
class spine_system;
|
||||
|
||||
26
headers/enduro2d/high/systems/physics_system.hpp
Normal file
26
headers/enduro2d/high/systems/physics_system.hpp
Normal file
@@ -0,0 +1,26 @@
|
||||
/*******************************************************************************
|
||||
* This file is part of the "Enduro2D"
|
||||
* For conditions of distribution and use, see copyright notice in LICENSE.md
|
||||
* Copyright (C) 2018-2019, by Matvey Cherevko (blackmatov@gmail.com)
|
||||
******************************************************************************/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "_systems.hpp"
|
||||
|
||||
namespace e2d
|
||||
{
|
||||
class physics_system final
|
||||
: public ecs::system<ecs::after<systems::update_event>> {
|
||||
public:
|
||||
physics_system();
|
||||
~physics_system() noexcept final;
|
||||
|
||||
void process(
|
||||
ecs::registry& owner,
|
||||
const ecs::after<systems::update_event>& trigger) override;
|
||||
private:
|
||||
class internal_state;
|
||||
std::unique_ptr<internal_state> state_;
|
||||
};
|
||||
}
|
||||
@@ -33,6 +33,7 @@
|
||||
#include <enduro2d/high/systems/flipbook_system.hpp>
|
||||
#include <enduro2d/high/systems/input_system.hpp>
|
||||
#include <enduro2d/high/systems/label_system.hpp>
|
||||
#include <enduro2d/high/systems/physics_system.hpp>
|
||||
#include <enduro2d/high/systems/render_system.hpp>
|
||||
#include <enduro2d/high/systems/script_system.hpp>
|
||||
#include <enduro2d/high/systems/spine_system.hpp>
|
||||
@@ -61,6 +62,8 @@ namespace
|
||||
.add_system<input_system>())
|
||||
.feature<struct label_feature>(ecs::feature()
|
||||
.add_system<label_system>())
|
||||
.feature<struct physics_feature>(ecs::feature()
|
||||
.add_system<physics_system>())
|
||||
.feature<struct render_feature>(ecs::feature()
|
||||
.add_system<render_system>())
|
||||
.feature<struct sript_feature>(ecs::feature()
|
||||
|
||||
43
sources/enduro2d/high/systems/physics_system.cpp
Normal file
43
sources/enduro2d/high/systems/physics_system.cpp
Normal file
@@ -0,0 +1,43 @@
|
||||
/*******************************************************************************
|
||||
* This file is part of the "Enduro2D"
|
||||
* For conditions of distribution and use, see copyright notice in LICENSE.md
|
||||
* Copyright (C) 2018-2019, by Matvey Cherevko (blackmatov@gmail.com)
|
||||
******************************************************************************/
|
||||
|
||||
#include <enduro2d/high/systems/physics_system.hpp>
|
||||
|
||||
namespace
|
||||
{
|
||||
using namespace e2d;
|
||||
}
|
||||
|
||||
namespace e2d
|
||||
{
|
||||
//
|
||||
// physics_system::internal_state
|
||||
//
|
||||
|
||||
class physics_system::internal_state final : private noncopyable {
|
||||
public:
|
||||
internal_state() = default;
|
||||
~internal_state() noexcept = default;
|
||||
|
||||
void process(f32 dt, ecs::registry& owner) {
|
||||
}
|
||||
};
|
||||
|
||||
//
|
||||
// physics_system
|
||||
//
|
||||
|
||||
physics_system::physics_system()
|
||||
: state_(new internal_state()) {}
|
||||
physics_system::~physics_system() noexcept = default;
|
||||
|
||||
void physics_system::process(
|
||||
ecs::registry& owner,
|
||||
const ecs::after<systems::update_event>& trigger)
|
||||
{
|
||||
state_->process(trigger.event.dt, owner);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user