From fc86d098c3b146a89fe5e8f7a2ded36cc1825728 Mon Sep 17 00:00:00 2001 From: Faymoon Date: Fri, 11 Jan 2019 09:29:37 +0100 Subject: [PATCH 1/2] Update Velocity[System/Component] to add CoordSys_Local support (#193) --- SDK/include/NDK/Components/VelocityComponent.hpp | 3 ++- SDK/include/NDK/Components/VelocityComponent.inl | 5 +++-- SDK/src/NDK/Systems/VelocitySystem.cpp | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/SDK/include/NDK/Components/VelocityComponent.hpp b/SDK/include/NDK/Components/VelocityComponent.hpp index 8785f6861..2c619da76 100644 --- a/SDK/include/NDK/Components/VelocityComponent.hpp +++ b/SDK/include/NDK/Components/VelocityComponent.hpp @@ -19,10 +19,11 @@ namespace Ndk class NDK_API VelocityComponent : public Component { public: - VelocityComponent(const Nz::Vector3f& velocity = Nz::Vector3f::Zero()); + VelocityComponent(const Nz::Vector3f& velocity = Nz::Vector3f::Zero(), Nz::CoordSys coordSystem = Nz::CoordSys_Global); ~VelocityComponent() = default; Nz::Vector3f linearVelocity; + Nz::CoordSys coordSys; VelocityComponent& operator=(const Nz::Vector3f& vel); diff --git a/SDK/include/NDK/Components/VelocityComponent.inl b/SDK/include/NDK/Components/VelocityComponent.inl index 3ca449132..2adedf413 100644 --- a/SDK/include/NDK/Components/VelocityComponent.inl +++ b/SDK/include/NDK/Components/VelocityComponent.inl @@ -16,8 +16,9 @@ namespace Ndk * \param velocity Linear velocity */ - inline VelocityComponent::VelocityComponent(const Nz::Vector3f& velocity) : - linearVelocity(velocity) + inline VelocityComponent::VelocityComponent(const Nz::Vector3f& velocity, Nz::CoordSys coordSystem) : + linearVelocity(velocity), + coordSys(coordSystem) { } diff --git a/SDK/src/NDK/Systems/VelocitySystem.cpp b/SDK/src/NDK/Systems/VelocitySystem.cpp index 0b1845bfb..b633d7b68 100644 --- a/SDK/src/NDK/Systems/VelocitySystem.cpp +++ b/SDK/src/NDK/Systems/VelocitySystem.cpp @@ -43,7 +43,7 @@ namespace Ndk NodeComponent& node = entity->GetComponent(); const VelocityComponent& velocity = entity->GetComponent(); - node.Move(velocity.linearVelocity * elapsedTime, Nz::CoordSys_Global); + node.Move(velocity.linearVelocity * elapsedTime, velocity.coordSys); } } From c152d2b62bbc696e86e08e3f84c129b4d3400c67 Mon Sep 17 00:00:00 2001 From: Alexandre Janniaux Date: Mon, 14 Jan 2019 22:09:03 +0100 Subject: [PATCH 2/2] unicode: silence shadow variable warnings (#194) --- src/Nazara/Core/Unicode.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Nazara/Core/Unicode.cpp b/src/Nazara/Core/Unicode.cpp index 477a77ff4..5b20ebce6 100644 --- a/src/Nazara/Core/Unicode.cpp +++ b/src/Nazara/Core/Unicode.cpp @@ -37,13 +37,13 @@ namespace Nz { const UnicodeCharacter* GetCharacter(Nz::UInt32 codepoint) { - auto it = std::lower_bound(std::begin(unicodeCharacters), std::end(unicodeCharacters), codepoint, [](const UnicodeCharacter& character, Nz::UInt32 codepoint) { return character.codepoint < codepoint; }); + auto it = std::lower_bound(std::begin(unicodeCharacters), std::end(unicodeCharacters), codepoint, [](const UnicodeCharacter& character, Nz::UInt32 otherCodepoint) { return character.codepoint < otherCodepoint; }); if (it != std::end(unicodeCharacters) && it->codepoint == codepoint) return &*it; else { // Character is not part of the common character array, search in set - auto itSet = std::lower_bound(std::begin(unicodeSets), std::end(unicodeSets), codepoint, [](const UnicodeSet& character, Nz::UInt32 codepoint) { return character.firstCodepoint < codepoint; }); + auto itSet = std::lower_bound(std::begin(unicodeSets), std::end(unicodeSets), codepoint, [](const UnicodeSet& character, Nz::UInt32 otherCodepoint) { return character.firstCodepoint < otherCodepoint; }); if (itSet != std::begin(unicodeSets)) { --itSet; @@ -58,7 +58,7 @@ namespace Nz template const UnicodeCharacterSimpleMapping* GetCharacterMapping(Nz::UInt32 codepoint, const UnicodeCharacterSimpleMapping(&mapping)[N]) { - auto it = std::lower_bound(std::begin(mapping), std::end(mapping), codepoint, [](const UnicodeCharacterSimpleMapping& character, Nz::UInt32 codepoint) { return character.codepoint < codepoint; }); + auto it = std::lower_bound(std::begin(mapping), std::end(mapping), codepoint, [](const UnicodeCharacterSimpleMapping& character, Nz::UInt32 otherCodepoint) { return character.codepoint < otherCodepoint; }); if (it != std::end(mapping) && it->codepoint == codepoint) return &*it; else