From cd526d614599bdd529b4c6c9c76c15af954e59b2 Mon Sep 17 00:00:00 2001 From: Faymoon Date: Sat, 17 Feb 2018 12:47:16 +0100 Subject: [PATCH] Remove some useless "Nz::" (#159) * Remove useless "Nz::" * Remove useless "Nz::" * REmove useless "Nz::" * Remove useless "Nz::" --- include/Nazara/Physics3D/PhysWorld3D.hpp | 6 +++--- include/Nazara/Physics3D/RigidBody3D.hpp | 4 ++-- src/Nazara/Physics3D/PhysWorld3D.cpp | 24 ++++++++++++------------ src/Nazara/Physics3D/RigidBody3D.cpp | 4 ++-- 4 files changed, 19 insertions(+), 19 deletions(-) diff --git a/include/Nazara/Physics3D/PhysWorld3D.hpp b/include/Nazara/Physics3D/PhysWorld3D.hpp index 76d4c09b4..8eaf26223 100644 --- a/include/Nazara/Physics3D/PhysWorld3D.hpp +++ b/include/Nazara/Physics3D/PhysWorld3D.hpp @@ -35,13 +35,13 @@ namespace Nz PhysWorld3D(PhysWorld3D&&) = delete; ///TODO ~PhysWorld3D(); - int CreateMaterial(Nz::String name = Nz::String()); + int CreateMaterial(String name = String()); - void ForEachBodyInAABB(const Nz::Boxf& box, BodyIterator iterator); + void ForEachBodyInAABB(const Boxf& box, BodyIterator iterator); Vector3f GetGravity() const; NewtonWorld* GetHandle() const; - int GetMaterial(const Nz::String& name); + int GetMaterial(const String& name); std::size_t GetMaxStepCount() const; float GetStepSize() const; diff --git a/include/Nazara/Physics3D/RigidBody3D.hpp b/include/Nazara/Physics3D/RigidBody3D.hpp index 28f53536f..a5c5a1956 100644 --- a/include/Nazara/Physics3D/RigidBody3D.hpp +++ b/include/Nazara/Physics3D/RigidBody3D.hpp @@ -59,7 +59,7 @@ namespace Nz bool IsSimulationEnabled() const; bool IsSleeping() const; - void SetAngularDamping(const Nz::Vector3f& angularDamping); + void SetAngularDamping(const Vector3f& angularDamping); void SetAngularVelocity(const Vector3f& angularVelocity); void SetGeom(Collider3DRef geom); void SetGravityFactor(float gravityFactor); @@ -67,7 +67,7 @@ namespace Nz void SetLinearVelocity(const Vector3f& velocity); void SetMass(float mass); void SetMassCenter(const Vector3f& center); - void SetMaterial(const Nz::String& materialName); + void SetMaterial(const String& materialName); void SetMaterial(int materialIndex); void SetPosition(const Vector3f& position); void SetRotation(const Quaternionf& rotation); diff --git a/src/Nazara/Physics3D/PhysWorld3D.cpp b/src/Nazara/Physics3D/PhysWorld3D.cpp index 2a01a27e0..099b0ebfb 100644 --- a/src/Nazara/Physics3D/PhysWorld3D.cpp +++ b/src/Nazara/Physics3D/PhysWorld3D.cpp @@ -27,7 +27,7 @@ namespace Nz NewtonDestroy(m_world); } - int PhysWorld3D::CreateMaterial(Nz::String name) + int PhysWorld3D::CreateMaterial(String name) { NazaraAssert(m_materialIds.find(name) == m_materialIds.end(), "Material \"" + name + "\" already exists"); @@ -37,7 +37,7 @@ namespace Nz return materialId; } - void PhysWorld3D::ForEachBodyInAABB(const Nz::Boxf& box, BodyIterator iterator) + void PhysWorld3D::ForEachBodyInAABB(const Boxf& box, BodyIterator iterator) { auto NewtonCallback = [](const NewtonBody* const body, void* const userdata) -> int { @@ -59,7 +59,7 @@ namespace Nz return m_world; } - int PhysWorld3D::GetMaterial(const Nz::String& name) + int PhysWorld3D::GetMaterial(const String& name) { auto it = m_materialIds.find(name); NazaraAssert(it != m_materialIds.end(), "Material \"" + name + "\" does not exists"); @@ -99,7 +99,7 @@ namespace Nz void PhysWorld3D::SetMaterialCollisionCallback(int firstMaterial, int secondMaterial, AABBOverlapCallback aabbOverlapCallback, CollisionCallback collisionCallback) { - static_assert(sizeof(Nz::UInt64) >= 2 * sizeof(int), "Oops"); + static_assert(sizeof(UInt64) >= 2 * sizeof(int), "Oops"); auto callbackPtr = std::make_unique(); callbackPtr->aabbOverlapCallback = std::move(aabbOverlapCallback); @@ -107,10 +107,10 @@ namespace Nz NewtonMaterialSetCollisionCallback(m_world, firstMaterial, secondMaterial, callbackPtr.get(), (callbackPtr->aabbOverlapCallback) ? OnAABBOverlap : nullptr, (callbackPtr->collisionCallback) ? ProcessContact : nullptr); - Nz::UInt64 firstMaterialId(firstMaterial); - Nz::UInt64 secondMaterialId(secondMaterial); + UInt64 firstMaterialId(firstMaterial); + UInt64 secondMaterialId(secondMaterial); - Nz::UInt64 callbackIndex = firstMaterialId << 32 | secondMaterialId; + UInt64 callbackIndex = firstMaterialId << 32 | secondMaterialId; m_callbacks[callbackIndex] = std::move(callbackPtr); } @@ -154,8 +154,8 @@ namespace Nz int PhysWorld3D::OnAABBOverlap(const NewtonMaterial* const material, const NewtonBody* const body0, const NewtonBody* const body1, int threadIndex) { - Nz::RigidBody3D* bodyA = static_cast(NewtonBodyGetUserData(body0)); - Nz::RigidBody3D* bodyB = static_cast(NewtonBodyGetUserData(body1)); + RigidBody3D* bodyA = static_cast(NewtonBodyGetUserData(body0)); + RigidBody3D* bodyB = static_cast(NewtonBodyGetUserData(body1)); assert(bodyA && bodyB); Callback* callbackData = static_cast(NewtonMaterialGetMaterialPairUserData(material)); @@ -167,14 +167,14 @@ namespace Nz void PhysWorld3D::ProcessContact(const NewtonJoint* const contactJoint, float timestep, int threadIndex) { - Nz::RigidBody3D* bodyA = static_cast(NewtonBodyGetUserData(NewtonJointGetBody0(contactJoint))); - Nz::RigidBody3D* bodyB = static_cast(NewtonBodyGetUserData(NewtonJointGetBody1(contactJoint))); + RigidBody3D* bodyA = static_cast(NewtonBodyGetUserData(NewtonJointGetBody0(contactJoint))); + RigidBody3D* bodyB = static_cast(NewtonBodyGetUserData(NewtonJointGetBody1(contactJoint))); assert(bodyA && bodyB); using ContactJoint = void*; // Query all joints first, to prevent removing a joint from the list while iterating on it - Nz::StackArray contacts = NazaraStackAllocationNoInit(ContactJoint, NewtonContactJointGetContactCount(contactJoint)); + StackArray contacts = NazaraStackAllocationNoInit(ContactJoint, NewtonContactJointGetContactCount(contactJoint)); std::size_t contactIndex = 0; for (ContactJoint contact = NewtonContactJointGetFirstContact(contactJoint); contact; contact = NewtonContactJointGetNextContact(contactJoint, contact)) { diff --git a/src/Nazara/Physics3D/RigidBody3D.cpp b/src/Nazara/Physics3D/RigidBody3D.cpp index 34e6ce12f..ea6e58621 100644 --- a/src/Nazara/Physics3D/RigidBody3D.cpp +++ b/src/Nazara/Physics3D/RigidBody3D.cpp @@ -266,7 +266,7 @@ namespace Nz return NewtonBodyGetSleepState(m_body) != 0; } - void RigidBody3D::SetAngularDamping(const Nz::Vector3f& angularDamping) + void RigidBody3D::SetAngularDamping(const Vector3f& angularDamping) { NewtonBodySetAngularDamping(m_body, angularDamping); } @@ -345,7 +345,7 @@ namespace Nz NewtonBodySetCentreOfMass(m_body, center); } - void RigidBody3D::SetMaterial(const Nz::String& materialName) + void RigidBody3D::SetMaterial(const String& materialName) { SetMaterial(m_world->GetMaterial(materialName)); }