Convert all remaining enums to enum classes (!)

This commit is contained in:
Jérôme Leclercq
2021-05-25 00:08:50 +02:00
parent 8cdd0b51cb
commit 874fb3542e
122 changed files with 1082 additions and 2169 deletions

View File

@@ -34,7 +34,7 @@ namespace Ndk
ClientSdk::ClientSdk(Config /*config*/) :
ModuleBase("ClientSDK", this)
{
Nz::ErrorFlags errFlags(Nz::ErrorFlag_ThrowException, true);
Nz::ErrorFlags errFlags(Nz::ErrorMode::ThrowException, true);
// Client components
InitializeComponent<ListenerComponent>("NdkList");

View File

@@ -30,7 +30,7 @@ namespace Ndk
Sdk::Sdk(Config /*config*/) :
ModuleBase("SDK", this)
{
Nz::ErrorFlags errFlags(Nz::ErrorFlag_ThrowException, true);
Nz::ErrorFlags errFlags(Nz::ErrorMode::ThrowException, true);
// SDK Initialization

View File

@@ -52,10 +52,10 @@ namespace Ndk
// We get the position and the rotation to affect these to the listener
const NodeComponent& node = entity->GetComponent<NodeComponent>();
Nz::Vector3f newPos = node.GetPosition(Nz::CoordSys_Global);
Nz::Vector3f newPos = node.GetPosition(Nz::CoordSys::Global);
audio->SetListenerPosition(newPos);
audio->SetListenerRotation(node.GetRotation(Nz::CoordSys_Global));
audio->SetListenerRotation(node.GetRotation(Nz::CoordSys::Global));
// Compute listener velocity based on their old/new position
Nz::Vector3f velocity = (newPos - oldPos) / elapsedTime;

View File

@@ -196,7 +196,7 @@ namespace Ndk
auto& node = entity->GetComponent<NodeComponent>();
Nz::RigidBody2D* physObj = collision.GetStaticBody();
physObj->SetPosition(Nz::Vector2f(node.GetPosition(Nz::CoordSys_Global)));
physObj->SetPosition(Nz::Vector2f(node.GetPosition(Nz::CoordSys::Global)));
//physObj->SetRotation(node.GetRotation());
}
}
@@ -224,8 +224,8 @@ namespace Ndk
PhysicsComponent2D& phys = entity->GetComponent<PhysicsComponent2D>();
Nz::RigidBody2D* body = phys.GetRigidBody();
node.SetRotation(body->GetRotation(), Nz::CoordSys_Global);
node.SetPosition(Nz::Vector3f(body->GetPosition(), node.GetPosition(Nz::CoordSys_Global).z), Nz::CoordSys_Global);
node.SetRotation(body->GetRotation(), Nz::CoordSys::Global);
node.SetPosition(Nz::Vector3f(body->GetPosition(), node.GetPosition(Nz::CoordSys::Global).z), Nz::CoordSys::Global);
}
float invElapsedTime = 1.f / elapsedTime;
@@ -237,7 +237,7 @@ namespace Ndk
Nz::RigidBody2D* body = collision.GetStaticBody();
Nz::Vector2f oldPosition = body->GetPosition();
Nz::Vector2f newPosition = Nz::Vector2f(node.GetPosition(Nz::CoordSys_Global));
Nz::Vector2f newPosition = Nz::Vector2f(node.GetPosition(Nz::CoordSys::Global));
// To move static objects and ensure their collisions, we have to specify them a velocity
// (/!\: the physical engine does not apply the speed on static objects)
@@ -250,7 +250,7 @@ namespace Ndk
body->SetVelocity(Nz::Vector2f::Zero());
Nz::RadianAnglef oldRotation = body->GetRotation();
Nz::RadianAnglef newRotation = node.GetRotation(Nz::CoordSys_Global).To2DAngle();
Nz::RadianAnglef newRotation = node.GetRotation(Nz::CoordSys::Global).To2DAngle();
if (newRotation != oldRotation)
{

View File

@@ -69,8 +69,8 @@ namespace Ndk
auto& node = entity->GetComponent<NodeComponent>();
Nz::RigidBody3D* physObj = collision.GetStaticBody();
physObj->SetPosition(node.GetPosition(Nz::CoordSys_Global));
physObj->SetRotation(node.GetRotation(Nz::CoordSys_Global));
physObj->SetPosition(node.GetPosition(Nz::CoordSys::Global));
physObj->SetRotation(node.GetRotation(Nz::CoordSys::Global));
}
}
@@ -97,8 +97,8 @@ namespace Ndk
PhysicsComponent3D& phys = entity->GetComponent<PhysicsComponent3D>();
Nz::RigidBody3D* physObj = phys.GetRigidBody();
node.SetRotation(physObj->GetRotation(), Nz::CoordSys_Global);
node.SetPosition(physObj->GetPosition(), Nz::CoordSys_Global);
node.SetRotation(physObj->GetRotation(), Nz::CoordSys::Global);
node.SetPosition(physObj->GetPosition(), Nz::CoordSys::Global);
}
float invElapsedTime = 1.f / elapsedTime;
@@ -111,8 +111,8 @@ namespace Ndk
Nz::Quaternionf oldRotation = physObj->GetRotation();
Nz::Vector3f oldPosition = physObj->GetPosition();
Nz::Quaternionf newRotation = node.GetRotation(Nz::CoordSys_Global);
Nz::Vector3f newPosition = node.GetPosition(Nz::CoordSys_Global);
Nz::Quaternionf newRotation = node.GetRotation(Nz::CoordSys::Global);
Nz::Vector3f newPosition = node.GetPosition(Nz::CoordSys::Global);
// To move static objects and ensure their collisions, we have to specify them a velocity
// (/!\: the physical motor does not apply the speed on static objects)