From 120ec667f733f7fde9acca41b2d8ae61529a3dbf Mon Sep 17 00:00:00 2001 From: BlackMATov Date: Wed, 5 Feb 2020 11:30:41 +0700 Subject: [PATCH] remove physics dummy stuff --- headers/enduro2d/high/_all.hpp | 3 - headers/enduro2d/high/_high.hpp | 3 - .../enduro2d/high/components/rigid_body.hpp | 131 ---------------- headers/enduro2d/high/physics.hpp | 27 ---- headers/enduro2d/high/starter.hpp | 27 ---- .../enduro2d/high/systems/physics_system.hpp | 26 ---- samples/bin/library/scenes/sample_08.json | 12 -- .../scripts/emmy/components/rigid_body.lua | 19 --- .../bin/library/scripts/emmy/high/gobject.lua | 3 - .../bin/library/scripts/emmy/high/physics.lua | 6 - .../high/bindings/high_binds/_high_binds.hpp | 4 - .../components/rigid_body_binds.cpp | 54 ------- .../bindings/high_binds/gobject_binds.cpp | 2 - .../bindings/high_binds/physics_binds.cpp | 18 --- .../enduro2d/high/components/rigid_body.cpp | 144 ------------------ sources/enduro2d/high/physics.cpp | 31 ---- sources/enduro2d/high/starter.cpp | 64 -------- .../enduro2d/high/systems/physics_system.cpp | 46 ------ .../enduro2d/high/systems/script_system.cpp | 2 - untests/bin/library/prefab.json | 1 - untests/sources/untests_high/library.cpp | 1 - 21 files changed, 624 deletions(-) delete mode 100644 headers/enduro2d/high/components/rigid_body.hpp delete mode 100644 headers/enduro2d/high/physics.hpp delete mode 100644 headers/enduro2d/high/systems/physics_system.hpp delete mode 100644 samples/bin/library/scripts/emmy/components/rigid_body.lua delete mode 100644 samples/bin/library/scripts/emmy/high/physics.lua delete mode 100644 sources/enduro2d/high/bindings/high_binds/components/rigid_body_binds.cpp delete mode 100644 sources/enduro2d/high/bindings/high_binds/physics_binds.cpp delete mode 100644 sources/enduro2d/high/components/rigid_body.cpp delete mode 100644 sources/enduro2d/high/physics.cpp delete mode 100644 sources/enduro2d/high/systems/physics_system.cpp diff --git a/headers/enduro2d/high/_all.hpp b/headers/enduro2d/high/_all.hpp index d858a7a1..a71e38bc 100644 --- a/headers/enduro2d/high/_all.hpp +++ b/headers/enduro2d/high/_all.hpp @@ -40,7 +40,6 @@ #include "components/model_renderer.hpp" #include "components/named.hpp" #include "components/renderer.hpp" -#include "components/rigid_body.hpp" #include "components/scene.hpp" #include "components/spine_player.hpp" #include "components/sprite_renderer.hpp" @@ -51,7 +50,6 @@ #include "systems/frame_system.hpp" #include "systems/gizmos_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" @@ -75,7 +73,6 @@ #include "model.hpp" #include "node.hpp" #include "node.inl" -#include "physics.hpp" #include "prefab.hpp" #include "script.hpp" #include "spine.hpp" diff --git a/headers/enduro2d/high/_high.hpp b/headers/enduro2d/high/_high.hpp index a611d566..3a3baca6 100644 --- a/headers/enduro2d/high/_high.hpp +++ b/headers/enduro2d/high/_high.hpp @@ -60,7 +60,6 @@ namespace e2d class model_renderer; class named; class renderer; - class rigid_body; class scene; class spine_player; class sprite_renderer; @@ -71,7 +70,6 @@ namespace e2d class frame_system; class gizmos_system; class label_system; - class physics_system; class render_system; class script_system; class spine_system; @@ -100,7 +98,6 @@ namespace e2d class editor; class inspector; class luasol; - class physics; class starter; class world; diff --git a/headers/enduro2d/high/components/rigid_body.hpp b/headers/enduro2d/high/components/rigid_body.hpp deleted file mode 100644 index 5cb89a6a..00000000 --- a/headers/enduro2d/high/components/rigid_body.hpp +++ /dev/null @@ -1,131 +0,0 @@ -/******************************************************************************* - * 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 "_components.hpp" - -namespace e2d -{ - class rigid_body final { - public: - ENUM_HPP_CLASS_DECL(types, u8, - (dynamic) - (kinematic)) - - ENUM_HPP_CLASS_DECL(sleepings, u8, - (never) - (start_awake) - (start_asleep)) - - ENUM_HPP_CLASS_DECL(collisions, u8, - (discrete) - (continuous)) - public: - rigid_body() = default; - - rigid_body& type(types value) noexcept; - [[nodiscard]] types type() const noexcept; - - rigid_body& sleeping(sleepings value) noexcept; - [[nodiscard]] sleepings sleeping() const noexcept; - - rigid_body& collision(collisions value) noexcept; - [[nodiscard]] collisions collision() const noexcept; - - rigid_body& gravity_scale(f32 value) noexcept; - [[nodiscard]] f32 gravity_scale() const noexcept; - - rigid_body& fixed_rotation(bool value) noexcept; - [[nodiscard]] bool fixed_rotation() const noexcept; - private: - types type_ = types::dynamic; - sleepings sleeping_ = sleepings::start_awake; - collisions collision_ = collisions::discrete; - f32 gravity_scale_ = 1.f; - bool fixed_rotation_ = false; - }; -} - -ENUM_HPP_REGISTER_TRAITS(e2d::rigid_body::types) -ENUM_HPP_REGISTER_TRAITS(e2d::rigid_body::sleepings) -ENUM_HPP_REGISTER_TRAITS(e2d::rigid_body::collisions) - -namespace e2d -{ - template <> - class factory_loader final : factory_loader<> { - public: - static const char* schema_source; - - bool operator()( - rigid_body& component, - const fill_context& ctx) const; - - bool operator()( - asset_dependencies& dependencies, - const collect_context& ctx) const; - }; -} - -namespace e2d -{ - template <> - class component_inspector final : component_inspector<> { - public: - static const char* title; - - void operator()(gcomponent& c) const; - }; -} - -namespace e2d -{ - inline rigid_body& rigid_body::type(types value) noexcept { - type_ = value; - return *this; - } - - inline rigid_body::types rigid_body::type() const noexcept { - return type_; - } - - inline rigid_body& rigid_body::sleeping(sleepings value) noexcept { - sleeping_ = value; - return *this; - } - - inline rigid_body::sleepings rigid_body::sleeping() const noexcept { - return sleeping_; - } - - inline rigid_body& rigid_body::collision(collisions value) noexcept { - collision_ = value; - return *this; - } - - inline rigid_body::collisions rigid_body::collision() const noexcept { - return collision_; - } - - inline rigid_body& rigid_body::gravity_scale(f32 value) noexcept { - gravity_scale_ = value; - return *this; - } - - inline f32 rigid_body::gravity_scale() const noexcept { - return gravity_scale_; - } - - inline rigid_body& rigid_body::fixed_rotation(bool value) noexcept { - fixed_rotation_ = value; - return *this; - } - - inline bool rigid_body::fixed_rotation() const noexcept { - return fixed_rotation_; - } -} diff --git a/headers/enduro2d/high/physics.hpp b/headers/enduro2d/high/physics.hpp deleted file mode 100644 index 106f805c..00000000 --- a/headers/enduro2d/high/physics.hpp +++ /dev/null @@ -1,27 +0,0 @@ -/******************************************************************************* - * 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 "_high.hpp" - -#include "starter.hpp" - -namespace e2d -{ - class physics final : public module { - public: - physics(starter::physics_parameters params); - ~physics() noexcept final; - - const v2f& gravity() const noexcept; - u32 update_framerate() const noexcept; - u32 velocity_iterations() const noexcept; - u32 position_iterations() const noexcept; - private: - starter::physics_parameters params_; - }; -} diff --git a/headers/enduro2d/high/starter.hpp b/headers/enduro2d/high/starter.hpp index 68f25d66..adab5776 100644 --- a/headers/enduro2d/high/starter.hpp +++ b/headers/enduro2d/high/starter.hpp @@ -20,7 +20,6 @@ namespace e2d using application_uptr = std::unique_ptr; public: class library_parameters; - class physics_parameters; class parameters; public: starter(int argc, char *argv[], const parameters& params); @@ -55,28 +54,6 @@ namespace e2d url root_{"resources://bin/library"}; }; - // - // starter::physics_parameters - // - - class starter::physics_parameters { - public: - physics_parameters& gravity(const v2f& value) noexcept; - physics_parameters& update_framerate(u32 value) noexcept; - physics_parameters& velocity_iterations(u32 value) noexcept; - physics_parameters& position_iterations(u32 value) noexcept; - - const v2f& gravity() const noexcept; - u32 update_framerate() const noexcept; - u32 velocity_iterations() const noexcept; - u32 position_iterations() const noexcept; - private: - v2f gravity_ = v2f::zero(); - u32 update_framerate_ = 50u; - u32 velocity_iterations_ = 6u; - u32 position_iterations_ = 2u; - }; - // // starter::parameters // @@ -88,19 +65,15 @@ namespace e2d parameters& engine_params(engine::parameters value) noexcept; parameters& library_params(library_parameters value) noexcept; - parameters& physics_params(physics_parameters value) noexcept; engine::parameters& engine_params() noexcept; library_parameters& library_params() noexcept; - physics_parameters& physics_params() noexcept; const engine::parameters& engine_params() const noexcept; const library_parameters& library_params() const noexcept; - const physics_parameters& physics_params() const noexcept; private: engine::parameters engine_params_; library_parameters library_params_; - physics_parameters physics_params_; }; } diff --git a/headers/enduro2d/high/systems/physics_system.hpp b/headers/enduro2d/high/systems/physics_system.hpp deleted file mode 100644 index eda2a797..00000000 --- a/headers/enduro2d/high/systems/physics_system.hpp +++ /dev/null @@ -1,26 +0,0 @@ -/******************************************************************************* - * 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> { - public: - physics_system(); - ~physics_system() noexcept final; - - void process( - ecs::registry& owner, - const ecs::after& trigger) override; - private: - class internal_state; - std::unique_ptr state_; - }; -} diff --git a/samples/bin/library/scenes/sample_08.json b/samples/bin/library/scenes/sample_08.json index 51399424..82a4393d 100644 --- a/samples/bin/library/scenes/sample_08.json +++ b/samples/bin/library/scenes/sample_08.json @@ -48,9 +48,6 @@ "script" : "../scripts/sample_08/ship.lua" }, "touchable" : {}, - "rigid_body" : { - "type" : "dynamic" - }, "circle_collider" : { "offset" : [10,15], "radius" : 33 @@ -71,9 +68,6 @@ "script" : "../scripts/sample_08/ship.lua" }, "touchable" : {}, - "rigid_body" : { - "type" : "dynamic" - }, "circle_collider" : { "offset" : [10,15], "radius" : 33 @@ -95,9 +89,6 @@ "script" : "../scripts/sample_08/ship.lua" }, "touchable" : {}, - "rigid_body" : { - "type" : "dynamic" - }, "rect_collider" : { "size" : [66,113] }, @@ -120,9 +111,6 @@ "actor" : { "translation" : [0,-240] }, - "rigid_body" : { - "type" : "kinematic" - }, "rect_collider" : { "size" : [320, 50] } diff --git a/samples/bin/library/scripts/emmy/components/rigid_body.lua b/samples/bin/library/scripts/emmy/components/rigid_body.lua deleted file mode 100644 index 00040e2c..00000000 --- a/samples/bin/library/scripts/emmy/components/rigid_body.lua +++ /dev/null @@ -1,19 +0,0 @@ ----@class rigid_body -local rigid_body = { - ---@type boolean - enabled = true, - - ---@type boolean - disabled = false -} - ----@overload fun(self: rigid_body) ----@param self rigid_body -function rigid_body.enable(self) end - ----@overload fun(self: rigid_body) ----@param self rigid_body -function rigid_body.disable(self) end - ----@type rigid_body -_G.rigid_body = _G.rigid_body or rigid_body diff --git a/samples/bin/library/scripts/emmy/high/gobject.lua b/samples/bin/library/scripts/emmy/high/gobject.lua index d135e94b..91452682 100644 --- a/samples/bin/library/scripts/emmy/high/gobject.lua +++ b/samples/bin/library/scripts/emmy/high/gobject.lua @@ -39,9 +39,6 @@ local gobject = { ---@type renderer renderer = nil, - ---@type rigid_body - rigid_body = nil, - ---@type scene scene = nil, diff --git a/samples/bin/library/scripts/emmy/high/physics.lua b/samples/bin/library/scripts/emmy/high/physics.lua deleted file mode 100644 index 27886a87..00000000 --- a/samples/bin/library/scripts/emmy/high/physics.lua +++ /dev/null @@ -1,6 +0,0 @@ ----@class physics -local physics = { -} - ----@type physics -_G.the_physics = _G.the_physics or physics diff --git a/sources/enduro2d/high/bindings/high_binds/_high_binds.hpp b/sources/enduro2d/high/bindings/high_binds/_high_binds.hpp index 082ccd3a..db5dec14 100644 --- a/sources/enduro2d/high/bindings/high_binds/_high_binds.hpp +++ b/sources/enduro2d/high/bindings/high_binds/_high_binds.hpp @@ -13,7 +13,6 @@ namespace e2d::bindings::high void bind_editor(sol::state& l); void bind_library(sol::state& l); void bind_luasol(sol::state& l); - void bind_physics(sol::state& l); void bind_world(sol::state& l); void bind_node(sol::state& l); @@ -28,7 +27,6 @@ namespace e2d::bindings::high void bind_model_renderer(sol::state& l); void bind_named(sol::state& l); void bind_renderer(sol::state& l); - void bind_rigid_body(sol::state& l); void bind_scene(sol::state& l); void bind_spine_player(sol::state& l); void bind_sprite_renderer(sol::state& l); @@ -41,7 +39,6 @@ namespace e2d::bindings high::bind_editor(l); high::bind_library(l); high::bind_luasol(l); - high::bind_physics(l); high::bind_world(l); high::bind_node(l); @@ -56,7 +53,6 @@ namespace e2d::bindings high::bind_model_renderer(l); high::bind_named(l); high::bind_renderer(l); - high::bind_rigid_body(l); high::bind_scene(l); high::bind_spine_player(l); high::bind_sprite_renderer(l); diff --git a/sources/enduro2d/high/bindings/high_binds/components/rigid_body_binds.cpp b/sources/enduro2d/high/bindings/high_binds/components/rigid_body_binds.cpp deleted file mode 100644 index bd902c85..00000000 --- a/sources/enduro2d/high/bindings/high_binds/components/rigid_body_binds.cpp +++ /dev/null @@ -1,54 +0,0 @@ -/******************************************************************************* - * 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 "../_high_binds.hpp" - -#include -#include -#include - -namespace e2d::bindings::high -{ - void bind_rigid_body(sol::state& l) { - l.new_usertype>("rigid_body", - sol::no_constructor, - - "enable", [](gcomponent& c){ - c.owner().component>().remove(); - }, - - "disable", [](gcomponent& c){ - c.owner().component>().ensure(); - }, - - "enabled", sol::property( - [](const gcomponent& c) -> bool { - return !c.owner().component>().exists(); - }, - [](gcomponent& c, bool yesno){ - if ( yesno ) { - c.owner().component>().remove(); - } else { - c.owner().component>().ensure(); - } - } - ), - - "disabled", sol::property( - [](const gcomponent& c) -> bool { - return c.owner().component>().exists(); - }, - [](gcomponent& c, bool yesno){ - if ( yesno ) { - c.owner().component>().ensure(); - } else { - c.owner().component>().remove(); - } - } - ) - ); - } -} diff --git a/sources/enduro2d/high/bindings/high_binds/gobject_binds.cpp b/sources/enduro2d/high/bindings/high_binds/gobject_binds.cpp index ce6bf320..c723fc27 100644 --- a/sources/enduro2d/high/bindings/high_binds/gobject_binds.cpp +++ b/sources/enduro2d/high/bindings/high_binds/gobject_binds.cpp @@ -17,7 +17,6 @@ #include #include #include -#include #include #include #include @@ -52,7 +51,6 @@ namespace e2d::bindings::high "model_renderer", sol::property([](gobject& go){ return component_wrapper{go}; }), "named", sol::property([](gobject& go){ return component_wrapper{go}; }), "renderer", sol::property([](gobject& go){ return component_wrapper{go}; }), - "rigid_body", sol::property([](gobject& go){ return component_wrapper{go}; }), "scene", sol::property([](gobject& go){ return component_wrapper{go}; }), "spine_player", sol::property([](gobject& go){ return component_wrapper{go}; }), "sprite_renderer", sol::property([](gobject& go){ return component_wrapper{go}; }), diff --git a/sources/enduro2d/high/bindings/high_binds/physics_binds.cpp b/sources/enduro2d/high/bindings/high_binds/physics_binds.cpp deleted file mode 100644 index d1218735..00000000 --- a/sources/enduro2d/high/bindings/high_binds/physics_binds.cpp +++ /dev/null @@ -1,18 +0,0 @@ -/******************************************************************************* - * 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 "_high_binds.hpp" - -#include - -namespace e2d::bindings::high -{ - void bind_physics(sol::state& l) { - l.new_usertype("physics", - sol::no_constructor - ); - } -} diff --git a/sources/enduro2d/high/components/rigid_body.cpp b/sources/enduro2d/high/components/rigid_body.cpp deleted file mode 100644 index 5e233d14..00000000 --- a/sources/enduro2d/high/components/rigid_body.cpp +++ /dev/null @@ -1,144 +0,0 @@ -/******************************************************************************* - * 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 - -namespace e2d -{ - const char* factory_loader::schema_source = R"json({ - "type" : "object", - "required" : [], - "additionalProperties" : false, - "properties" : { - "type" : { "$ref": "#/definitions/types" }, - "sleeping" : { "$ref": "#/definitions/sleepings" }, - "collision" : { "$ref": "#/definitions/collisions" }, - "gravity_scale" : { "type" : "number" }, - "fixed_rotation" : { "type" : "boolean" } - }, - "definitions" : { - "types" : { - "type" : "string", - "enum" : [ - "dynamic", - "kinematic" - ] - }, - "sleepings" : { - "type" : "string", - "enum" : [ - "never", - "start_awake", - "start_asleep" - ] - }, - "collisions" : { - "type" : "string", - "enum" : [ - "discrete", - "continuous" - ] - } - } - })json"; - - bool factory_loader::operator()( - rigid_body& component, - const fill_context& ctx) const - { - if ( ctx.root.HasMember("type") ) { - rigid_body::types type = component.type(); - if ( !json_utils::try_parse_value(ctx.root["type"], type) ) { - the().error("RIGID_BODY: Incorrect formatting of 'type' property"); - return false; - } - component.type(type); - } - - if ( ctx.root.HasMember("sleeping") ) { - rigid_body::sleepings sleeping = component.sleeping(); - if ( !json_utils::try_parse_value(ctx.root["sleeping"], sleeping) ) { - the().error("RIGID_BODY: Incorrect formatting of 'sleeping' property"); - return false; - } - component.sleeping(sleeping); - } - - if ( ctx.root.HasMember("collision") ) { - rigid_body::collisions collision = component.collision(); - if ( !json_utils::try_parse_value(ctx.root["collision"], collision) ) { - the().error("RIGID_BODY: Incorrect formatting of 'collision' property"); - return false; - } - component.collision(collision); - } - - if ( ctx.root.HasMember("gravity_scale") ) { - f32 gravity_scale = component.gravity_scale(); - if ( !json_utils::try_parse_value(ctx.root["gravity_scale"], gravity_scale) ) { - the().error("RIGID_BODY: Incorrect formatting of 'gravity_scale' property"); - return false; - } - component.gravity_scale(gravity_scale); - } - - if ( ctx.root.HasMember("fixed_rotation") ) { - bool fixed_rotation = component.fixed_rotation(); - if ( !json_utils::try_parse_value(ctx.root["fixed_rotation"], fixed_rotation) ) { - the().error("RIGID_BODY: Incorrect formatting of 'fixed_rotation' property"); - return false; - } - component.fixed_rotation(fixed_rotation); - } - - return true; - } - - bool factory_loader::operator()( - asset_dependencies& dependencies, - const collect_context& ctx) const - { - E2D_UNUSED(dependencies, ctx); - return true; - } -} - -namespace e2d -{ - const char* component_inspector::title = ICON_FA_WEIGHT_HANGING " rigid_body"; - - void component_inspector::operator()(gcomponent& c) const { - if ( rigid_body::types type = c->type(); - imgui_utils::show_enum_combo_box("type", &type) ) - { - c->type(type); - } - - if ( rigid_body::sleepings sleeping = c->sleeping(); - imgui_utils::show_enum_combo_box("sleeping", &sleeping) ) - { - c->sleeping(sleeping); - } - - if ( rigid_body::collisions collision = c->collision(); - imgui_utils::show_enum_combo_box("collision", &collision) ) - { - c->collision(collision); - } - - if ( f32 gravity_scale = c->gravity_scale(); - ImGui::DragFloat("gravity_scale", &gravity_scale, 0.01f) ) - { - c->gravity_scale(gravity_scale); - } - - if ( bool fixed_rotation = c->fixed_rotation(); - ImGui::Checkbox("fixed_rotation", &fixed_rotation) ) - { - c->fixed_rotation(fixed_rotation); - } - } -} diff --git a/sources/enduro2d/high/physics.cpp b/sources/enduro2d/high/physics.cpp deleted file mode 100644 index 285c9ea4..00000000 --- a/sources/enduro2d/high/physics.cpp +++ /dev/null @@ -1,31 +0,0 @@ -/******************************************************************************* - * 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 - -namespace e2d -{ - physics::physics(starter::physics_parameters params) - : params_(std::move(params)) {} - - physics::~physics() noexcept = default; - - const v2f& physics::gravity() const noexcept { - return params_.gravity(); - } - - u32 physics::update_framerate() const noexcept { - return params_.update_framerate(); - } - - u32 physics::velocity_iterations() const noexcept { - return params_.velocity_iterations(); - } - - u32 physics::position_iterations() const noexcept { - return params_.position_iterations(); - } -} diff --git a/sources/enduro2d/high/starter.cpp b/sources/enduro2d/high/starter.cpp index b879ed28..a26d2431 100644 --- a/sources/enduro2d/high/starter.cpp +++ b/sources/enduro2d/high/starter.cpp @@ -11,7 +11,6 @@ #include #include #include -#include #include #include @@ -26,7 +25,6 @@ #include #include #include -#include #include #include #include @@ -37,7 +35,6 @@ #include #include #include -#include #include #include #include @@ -72,8 +69,6 @@ namespace .add_system()) .feature(ecs::feature() .add_system()) - .feature(ecs::feature() - .add_system()) .feature(ecs::feature() .add_system()) .feature(ecs::feature() @@ -144,46 +139,6 @@ namespace e2d return root_; } - // - // starter::physics_parameters - // - - starter::physics_parameters& starter::physics_parameters::gravity(const v2f& value) noexcept { - gravity_ = value; - return *this; - } - - starter::physics_parameters& starter::physics_parameters::update_framerate(u32 value) noexcept { - update_framerate_ = value; - return *this; - } - - starter::physics_parameters& starter::physics_parameters::velocity_iterations(u32 value) noexcept { - velocity_iterations_ = value; - return *this; - } - - starter::physics_parameters& starter::physics_parameters::position_iterations(u32 value) noexcept { - position_iterations_ = value; - return *this; - } - - const v2f& starter::physics_parameters::gravity() const noexcept { - return gravity_; - } - - u32 starter::physics_parameters::update_framerate() const noexcept { - return update_framerate_; - } - - u32 starter::physics_parameters::velocity_iterations() const noexcept { - return velocity_iterations_; - } - - u32 starter::physics_parameters::position_iterations() const noexcept { - return position_iterations_; - } - // // starter::parameters // @@ -201,11 +156,6 @@ namespace e2d return *this; } - starter::parameters& starter::parameters::physics_params(physics_parameters value) noexcept { - physics_params_ = std::move(value); - return *this; - } - engine::parameters& starter::parameters::engine_params() noexcept { return engine_params_; } @@ -214,10 +164,6 @@ namespace e2d return library_params_; } - starter::physics_parameters& starter::parameters::physics_params() noexcept { - return physics_params_; - } - const engine::parameters& starter::parameters::engine_params() const noexcept { return engine_params_; } @@ -226,10 +172,6 @@ namespace e2d return library_params_; } - const starter::physics_parameters& starter::parameters::physics_params() const noexcept { - return physics_params_; - } - // // starter // @@ -254,7 +196,6 @@ namespace e2d .register_component("model_renderer") .register_component("named") .register_component("renderer") - .register_component("rigid_body") .register_component("scene") .register_component("spine_player") .register_component>("spine_player.events") @@ -279,7 +220,6 @@ namespace e2d .register_component("model_renderer") .register_component("named") .register_component("renderer") - .register_component("rigid_body") .register_component("scene") .register_component("spine_player") //.register_component>("spine_player.events") @@ -294,9 +234,6 @@ namespace e2d safe_module_initialize( params.library_params()); - safe_module_initialize( - params.physics_params()); - safe_module_initialize(); safe_module_initialize(); } @@ -306,7 +243,6 @@ namespace e2d modules::shutdown(); modules::shutdown(); - modules::shutdown(); modules::shutdown(); modules::shutdown(); modules::shutdown(); diff --git a/sources/enduro2d/high/systems/physics_system.cpp b/sources/enduro2d/high/systems/physics_system.cpp deleted file mode 100644 index 9b0851db..00000000 --- a/sources/enduro2d/high/systems/physics_system.cpp +++ /dev/null @@ -1,46 +0,0 @@ -/******************************************************************************* - * 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 - -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_update(ecs::registry& owner) { - E2D_UNUSED(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& trigger) - { - E2D_UNUSED(trigger); - E2D_PROFILER_SCOPE("physics_system.process_update"); - state_->process_update(owner); - } -} diff --git a/sources/enduro2d/high/systems/script_system.cpp b/sources/enduro2d/high/systems/script_system.cpp index d96feb48..d657ee16 100644 --- a/sources/enduro2d/high/systems/script_system.cpp +++ b/sources/enduro2d/high/systems/script_system.cpp @@ -9,7 +9,6 @@ #include #include #include -#include #include #include @@ -37,7 +36,6 @@ namespace s["the_editor"] = &the(); s["the_library"] = &the(); s["the_luasol"] = &the(); - s["the_physics"] = &the(); s["the_world"] = &the(); } diff --git a/untests/bin/library/prefab.json b/untests/bin/library/prefab.json index 06d206ae..baeeaa24 100644 --- a/untests/bin/library/prefab.json +++ b/untests/bin/library/prefab.json @@ -1,6 +1,5 @@ { "components" : { - "rigid_body" : {}, "touchable" : {}, "rect_collider" : { diff --git a/untests/sources/untests_high/library.cpp b/untests/sources/untests_high/library.cpp index 674ec248..04986230 100644 --- a/untests/sources/untests_high/library.cpp +++ b/untests/sources/untests_high/library.cpp @@ -250,7 +250,6 @@ TEST_CASE("library"){ ecs::registry w; ecs::entity e = w.create_entity(prefab_res->content().prototype()); - REQUIRE(e.exists_component()); REQUIRE(e.exists_component()); REQUIRE(e.exists_component());