From efd07029e353e8ecddb3c1b96e3d9928695a11f1 Mon Sep 17 00:00:00 2001 From: Lynix Date: Sat, 17 Feb 2018 14:23:27 +0100 Subject: [PATCH] Physics3D/PhysWorld3D: Fix move constructor/operator --- ChangeLog.md | 3 ++- include/Nazara/Physics3D/PhysWorld3D.hpp | 7 ++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/ChangeLog.md b/ChangeLog.md index 203821b57..346147435 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -68,6 +68,7 @@ Nazara Engine: - Add PhysWorld[2D|3D] max step count per Step call (default: 50), to avoid spirals of death when the physics engine simulation time is over step size. - Fix Window triggering KeyPressed event after triggering a resize/movement event on Windows - (WIP) Add support for materials and callbacks to Physics3D module. +- PhysWorld3D class is now movable Nazara Development Kit: - Added ImageWidget (#139) @@ -103,7 +104,7 @@ Nazara Development Kit: - ⚠️ Renamed World::Update() to World::Refresh() for more clarity and to differentiate it from World::Update(elapsedTime) - World entity ids are now reused from lowest to highest (they were previously reused in reverse order of death) - World now has an internal profiler, allowing to measure the refresh and system update time -- CollisionComponent[2D|3D] and PhysicsComponent[2D|3D] now configures their internal RigidBody userdata to the entity ID they belong to (useful for callbacks) +- CollisionComponent[2D|3D] and PhysicsComponent[2D|3D] now configures their internal RigidBody userdata to the entity ID they belong to (useful for callbacks). # 0.4: diff --git a/include/Nazara/Physics3D/PhysWorld3D.hpp b/include/Nazara/Physics3D/PhysWorld3D.hpp index 983b4aaa1..ff0b3c811 100644 --- a/include/Nazara/Physics3D/PhysWorld3D.hpp +++ b/include/Nazara/Physics3D/PhysWorld3D.hpp @@ -8,6 +8,7 @@ #define NAZARA_PHYSWORLD_HPP #include +#include #include #include #include @@ -32,7 +33,7 @@ namespace Nz PhysWorld3D(); PhysWorld3D(const PhysWorld3D&) = delete; - PhysWorld3D(PhysWorld3D&&) = delete; ///TODO + PhysWorld3D(PhysWorld3D&&) = default; ~PhysWorld3D(); int CreateMaterial(String name = String()); @@ -60,7 +61,7 @@ namespace Nz void Step(float timestep); PhysWorld3D& operator=(const PhysWorld3D&) = delete; - PhysWorld3D& operator=(PhysWorld3D&&) = delete; ///TODO + PhysWorld3D& operator=(PhysWorld3D&&) = default; private: struct Callback @@ -75,8 +76,8 @@ namespace Nz std::unordered_map> m_callbacks; std::unordered_map m_materialIds; std::size_t m_maxStepCount; + MovablePtr m_world; Vector3f m_gravity; - NewtonWorld* m_world; float m_stepSize; float m_timestepAccumulator; };