Switch from Nz prefix to namespace Nz

What a huge commit


Former-commit-id: 38ac5eebf70adc1180f571f6006192d28fb99897
This commit is contained in:
Lynix
2015-09-25 19:20:05 +02:00
parent c214251ecf
commit df8da275c4
609 changed files with 68265 additions and 66534 deletions

View File

@@ -19,7 +19,7 @@ namespace Ndk
{
class Entity;
class NDK_API CameraComponent : public Component<CameraComponent>, public NzAbstractViewer
class NDK_API CameraComponent : public Component<CameraComponent>, public Nz::AbstractViewer
{
public:
inline CameraComponent();
@@ -34,26 +34,26 @@ namespace Ndk
inline void EnsureViewportUpdate() const;
inline float GetAspectRatio() const;
inline NzVector3f GetEyePosition() const;
inline NzVector3f GetForward() const;
inline Nz::Vector3f GetEyePosition() const;
inline Nz::Vector3f GetForward() const;
inline float GetFOV() const;
inline const NzFrustumf& GetFrustum() const;
inline const Nz::Frustumf& GetFrustum() const;
inline unsigned int GetLayer() const;
inline const NzMatrix4f& GetProjectionMatrix() const;
inline nzProjectionType GetProjectionType() const;
inline const NzRenderTarget* GetTarget() const;
inline const NzRectf& GetTargetRegion() const;
inline const NzMatrix4f& GetViewMatrix() const;
inline const NzRecti& GetViewport() const;
inline const Nz::Matrix4f& GetProjectionMatrix() const;
inline Nz::ProjectionType GetProjectionType() const;
inline const Nz::RenderTarget* GetTarget() const;
inline const Nz::Rectf& GetTargetRegion() const;
inline const Nz::Matrix4f& GetViewMatrix() const;
inline const Nz::Recti& GetViewport() const;
inline float GetZFar() const;
inline float GetZNear() const;
inline void SetFOV(float fov);
inline void SetLayer(unsigned int layer);
inline void SetProjectionType(nzProjectionType projection);
inline void SetTarget(const NzRenderTarget* renderTarget);
inline void SetTargetRegion(const NzRectf& region);
inline void SetViewport(const NzRecti& viewport);
inline void SetProjectionType(Nz::ProjectionType projection);
inline void SetTarget(const Nz::RenderTarget* renderTarget);
inline void SetTargetRegion(const Nz::Rectf& region);
inline void SetViewport(const Nz::Recti& viewport);
inline void SetZFar(float zFar);
inline void SetZNear(float zNear);
@@ -69,26 +69,26 @@ namespace Ndk
void OnComponentAttached(BaseComponent& component) override;
void OnComponentDetached(BaseComponent& component) override;
void OnDetached() override;
void OnNodeInvalidated(const NzNode* node);
void OnRenderTargetRelease(const NzRenderTarget* renderTarget);
void OnRenderTargetSizeChange(const NzRenderTarget* renderTarget);
void OnNodeInvalidated(const Nz::Node* node);
void OnRenderTargetRelease(const Nz::RenderTarget* renderTarget);
void OnRenderTargetSizeChange(const Nz::RenderTarget* renderTarget);
void UpdateFrustum() const;
void UpdateProjectionMatrix() const;
void UpdateViewMatrix() const;
void UpdateViewport() const;
NazaraSlot(NzNode, OnNodeInvalidation, m_nodeInvalidationSlot);
NazaraSlot(NzRenderTarget, OnRenderTargetRelease, m_targetReleaseSlot);
NazaraSlot(NzRenderTarget, OnRenderTargetSizeChange, m_targetResizeSlot);
NazaraSlot(Nz::Node, OnNodeInvalidation, m_nodeInvalidationSlot);
NazaraSlot(Nz::RenderTarget, OnRenderTargetRelease, m_targetReleaseSlot);
NazaraSlot(Nz::RenderTarget, OnRenderTargetSizeChange, m_targetResizeSlot);
nzProjectionType m_projectionType;
mutable NzFrustumf m_frustum;
mutable NzMatrix4f m_projectionMatrix;
mutable NzMatrix4f m_viewMatrix;
NzRectf m_targetRegion;
mutable NzRecti m_viewport;
const NzRenderTarget* m_target;
Nz::ProjectionType m_projectionType;
mutable Nz::Frustumf m_frustum;
mutable Nz::Matrix4f m_projectionMatrix;
mutable Nz::Matrix4f m_viewMatrix;
Nz::Rectf m_targetRegion;
mutable Nz::Recti m_viewport;
const Nz::RenderTarget* m_target;
mutable bool m_frustumUpdated;
mutable bool m_projectionMatrixUpdated;
mutable bool m_viewMatrixUpdated;

View File

@@ -8,7 +8,7 @@
namespace Ndk
{
inline CameraComponent::CameraComponent() :
m_projectionType(nzProjectionType_Perspective),
m_projectionType(Nz::ProjectionType_Perspective),
m_targetRegion(0.f, 0.f, 1.f, 1.f),
m_target(nullptr),
m_frustumUpdated(false),
@@ -25,7 +25,7 @@ namespace Ndk
inline CameraComponent::CameraComponent(const CameraComponent& camera) :
Component(camera),
NzAbstractViewer(camera),
AbstractViewer(camera),
m_projectionType(camera.m_projectionType),
m_targetRegion(camera.m_targetRegion),
m_target(nullptr),
@@ -78,7 +78,7 @@ namespace Ndk
return m_fov;
}
inline const NzFrustumf& CameraComponent::GetFrustum() const
inline const Nz::Frustumf& CameraComponent::GetFrustum() const
{
EnsureFrustumUpdate();
@@ -90,36 +90,36 @@ namespace Ndk
return m_layer;
}
inline const NzMatrix4f& CameraComponent::GetProjectionMatrix() const
inline const Nz::Matrix4f& CameraComponent::GetProjectionMatrix() const
{
EnsureProjectionMatrixUpdate();
return m_projectionMatrix;
}
inline nzProjectionType CameraComponent::GetProjectionType() const
inline Nz::ProjectionType CameraComponent::GetProjectionType() const
{
return m_projectionType;
}
inline const NzRenderTarget* CameraComponent::GetTarget() const
inline const Nz::RenderTarget* CameraComponent::GetTarget() const
{
return m_target;
}
inline const NzRectf& CameraComponent::GetTargetRegion() const
inline const Nz::Rectf& CameraComponent::GetTargetRegion() const
{
return m_targetRegion;
}
inline const NzMatrix4f& CameraComponent::GetViewMatrix() const
inline const Nz::Matrix4f& CameraComponent::GetViewMatrix() const
{
EnsureViewMatrixUpdate();
return m_viewMatrix;
}
inline const NzRecti& CameraComponent::GetViewport() const
inline const Nz::Recti& CameraComponent::GetViewport() const
{
EnsureViewportUpdate();
@@ -138,20 +138,20 @@ namespace Ndk
inline void CameraComponent::SetFOV(float fov)
{
NazaraAssert(!NzNumberEquals(fov, 0.f), "FOV must be different from zero");
NazaraAssert(!Nz::NumberEquals(fov, 0.f), "FOV must be different from zero");
m_fov = fov;
InvalidateProjectionMatrix();
}
inline void CameraComponent::SetProjectionType(nzProjectionType projectionType)
inline void CameraComponent::SetProjectionType(Nz::ProjectionType projectionType)
{
m_projectionType = projectionType;
InvalidateProjectionMatrix();
}
inline void CameraComponent::SetTarget(const NzRenderTarget* renderTarget)
inline void CameraComponent::SetTarget(const Nz::RenderTarget* renderTarget)
{
m_target = renderTarget;
if (m_target)
@@ -160,14 +160,14 @@ namespace Ndk
m_targetReleaseSlot.Disconnect();
}
inline void CameraComponent::SetTargetRegion(const NzRectf& region)
inline void CameraComponent::SetTargetRegion(const Nz::Rectf& region)
{
m_targetRegion = region;
InvalidateViewport();
}
inline void CameraComponent::SetViewport(const NzRecti& viewport)
inline void CameraComponent::SetViewport(const Nz::Recti& viewport)
{
NazaraAssert(m_target, "Component has no render target");
@@ -175,7 +175,7 @@ namespace Ndk
float invWidth = 1.f/m_target->GetWidth();
float invHeight = 1.f/m_target->GetHeight();
SetTargetRegion(NzRectf(invWidth * viewport.x, invHeight * viewport.y, invWidth * viewport.width, invHeight * viewport.height));
SetTargetRegion(Nz::Rectf(invWidth * viewport.x, invHeight * viewport.y, invWidth * viewport.width, invHeight * viewport.height));
}
inline void CameraComponent::SetZFar(float zFar)
@@ -187,7 +187,7 @@ namespace Ndk
inline void CameraComponent::SetZNear(float zNear)
{
NazaraAssert(!NzNumberEquals(zNear, 0.f), "zNear cannot be zero");
NazaraAssert(!Nz::NumberEquals(zNear, 0.f), "zNear cannot be zero");
m_zNear = zNear;
InvalidateProjectionMatrix();

View File

@@ -11,7 +11,10 @@
#include <NDK/Component.hpp>
#include <memory>
class NzPhysObject;
namespace Nz
{
class PhysObject;
}
namespace Ndk
{
@@ -23,30 +26,30 @@ namespace Ndk
friend class StaticCollisionSystem;
public:
CollisionComponent(NzPhysGeomRef geom = NzPhysGeomRef());
CollisionComponent(Nz::PhysGeomRef geom = Nz::PhysGeomRef());
CollisionComponent(const CollisionComponent& collision);
~CollisionComponent() = default;
const NzPhysGeomRef& GetGeom() const;
const Nz::PhysGeomRef& GetGeom() const;
void SetGeom(NzPhysGeomRef geom);
void SetGeom(Nz::PhysGeomRef geom);
CollisionComponent& operator=(NzPhysGeomRef geom);
CollisionComponent& operator=(Nz::PhysGeomRef geom);
CollisionComponent& operator=(CollisionComponent&& collision) = default;
static ComponentIndex componentIndex;
private:
void InitializeStaticBody();
NzPhysObject* GetStaticBody();
Nz::PhysObject* GetStaticBody();
void OnAttached() override;
void OnComponentAttached(BaseComponent& component) override;
void OnComponentDetached(BaseComponent& component) override;
void OnDetached() override;
std::unique_ptr<NzPhysObject> m_staticBody;
NzPhysGeomRef m_geom;
std::unique_ptr<Nz::PhysObject> m_staticBody;
Nz::PhysGeomRef m_geom;
bool m_bodyUpdated;
};
}

View File

@@ -9,7 +9,7 @@
namespace Ndk
{
inline CollisionComponent::CollisionComponent(NzPhysGeomRef geom) :
inline CollisionComponent::CollisionComponent(Nz::PhysGeomRef geom) :
m_geom(std::move(geom)),
m_bodyUpdated(false)
{
@@ -21,19 +21,19 @@ namespace Ndk
{
}
inline const NzPhysGeomRef& CollisionComponent::GetGeom() const
inline const Nz::PhysGeomRef& CollisionComponent::GetGeom() const
{
return m_geom;
}
inline CollisionComponent& CollisionComponent::operator=(NzPhysGeomRef geom)
inline CollisionComponent& CollisionComponent::operator=(Nz::PhysGeomRef geom)
{
SetGeom(geom);
return *this;
}
inline NzPhysObject* CollisionComponent::GetStaticBody()
inline Nz::PhysObject* CollisionComponent::GetStaticBody()
{
return m_staticBody.get();
}

View File

@@ -22,16 +22,16 @@ namespace Ndk
inline GraphicsComponent(const GraphicsComponent& graphicsComponent);
~GraphicsComponent() = default;
inline void AddToRenderQueue(NzAbstractRenderQueue* renderQueue) const;
inline void AddToRenderQueue(Nz::AbstractRenderQueue* renderQueue) const;
inline void Attach(NzInstancedRenderableRef renderable);
inline void Attach(Nz::InstancedRenderableRef renderable);
inline void EnsureTransformMatrixUpdate() const;
static ComponentIndex componentIndex;
private:
void InvalidateRenderableData(const NzInstancedRenderable* renderable, nzUInt32 flags, unsigned int index);
void InvalidateRenderableData(const Nz::InstancedRenderable* renderable, Nz::UInt32 flags, unsigned int index);
inline void InvalidateRenderables();
inline void InvalidateTransformMatrix();
@@ -39,29 +39,29 @@ namespace Ndk
void OnComponentAttached(BaseComponent& component) override;
void OnComponentDetached(BaseComponent& component) override;
void OnDetached() override;
void OnNodeInvalidated(const NzNode* node);
void OnNodeInvalidated(const Nz::Node* node);
void UpdateTransformMatrix() const;
NazaraSlot(NzNode, OnNodeInvalidation, m_nodeInvalidationSlot);
NazaraSlot(Nz::Node, OnNodeInvalidation, m_nodeInvalidationSlot);
struct Renderable
{
Renderable(NzMatrix4f& transformMatrix) :
Renderable(Nz::Matrix4f& transformMatrix) :
data(transformMatrix),
dataUpdated(false)
{
}
NazaraSlot(NzInstancedRenderable, OnInstancedRenderableInvalidateData, renderableInvalidationSlot);
NazaraSlot(Nz::InstancedRenderable, OnInstancedRenderableInvalidateData, renderableInvalidationSlot);
mutable NzInstancedRenderable::InstanceData data;
NzInstancedRenderableRef renderable;
mutable Nz::InstancedRenderable::InstanceData data;
Nz::InstancedRenderableRef renderable;
mutable bool dataUpdated;
};
std::vector<Renderable> m_renderables;
mutable NzMatrix4f m_transformMatrix;
mutable Nz::Matrix4f m_transformMatrix;
mutable bool m_transformMatrixUpdated;
};
}

View File

@@ -16,7 +16,7 @@ namespace Ndk
Attach(r.renderable);
}
inline void GraphicsComponent::AddToRenderQueue(NzAbstractRenderQueue* renderQueue) const
inline void GraphicsComponent::AddToRenderQueue(Nz::AbstractRenderQueue* renderQueue) const
{
EnsureTransformMatrixUpdate();
@@ -32,7 +32,7 @@ namespace Ndk
}
}
inline void GraphicsComponent::Attach(NzInstancedRenderableRef renderable)
inline void GraphicsComponent::Attach(Nz::InstancedRenderableRef renderable)
{
m_renderables.emplace_back(m_transformMatrix);
Renderable& r = m_renderables.back();

View File

@@ -12,10 +12,10 @@
namespace Ndk
{
class NDK_API LightComponent : public Component<LightComponent>, public NzLight
class NDK_API LightComponent : public Component<LightComponent>, public Nz::Light
{
public:
inline LightComponent(nzLightType lightType = nzLightType_Point);
inline LightComponent(Nz::LightType lightType = Nz::LightType_Point);
LightComponent(const LightComponent& light) = default;
~LightComponent() = default;

View File

@@ -4,8 +4,8 @@
namespace Ndk
{
inline LightComponent::LightComponent(nzLightType lightType) :
NzLight(lightType)
inline LightComponent::LightComponent(Nz::LightType lightType) :
Nz::Light(lightType)
{
}
}
}

View File

@@ -14,14 +14,14 @@ namespace Ndk
{
class Entity;
class NDK_API NodeComponent : public Component<NodeComponent>, public NzNode
class NDK_API NodeComponent : public Component<NodeComponent>, public Nz::Node
{
public:
NodeComponent() = default;
~NodeComponent() = default;
void SetParent(Entity* entity, bool keepDerived = false);
using NzNode::SetParent;
using Nz::Node::SetParent;
static ComponentIndex componentIndex;
};

View File

@@ -13,9 +13,9 @@ namespace Ndk
{
NazaraAssert(entity->HasComponent<NodeComponent>(), "Entity must have a NodeComponent");
NzNode::SetParent(entity->GetComponent<NodeComponent>(), keepDerived);
Nz::Node::SetParent(entity->GetComponent<NodeComponent>(), keepDerived);
}
else
NzNode::SetParent(nullptr, keepDerived);
Nz::Node::SetParent(nullptr, keepDerived);
}
}

View File

@@ -25,45 +25,45 @@ namespace Ndk
PhysicsComponent(const PhysicsComponent& physics);
~PhysicsComponent() = default;
void AddForce(const NzVector3f& force, nzCoordSys coordSys = nzCoordSys_Global);
void AddForce(const NzVector3f& force, const NzVector3f& point, nzCoordSys coordSys = nzCoordSys_Global);
void AddTorque(const NzVector3f& torque, nzCoordSys coordSys = nzCoordSys_Global);
void AddForce(const Nz::Vector3f& force, Nz::CoordSys coordSys = Nz::CoordSys_Global);
void AddForce(const Nz::Vector3f& force, const Nz::Vector3f& point, Nz::CoordSys coordSys = Nz::CoordSys_Global);
void AddTorque(const Nz::Vector3f& torque, Nz::CoordSys coordSys = Nz::CoordSys_Global);
void EnableAutoSleep(bool autoSleep);
NzBoxf GetAABB() const;
NzVector3f GetAngularVelocity() const;
Nz::Boxf GetAABB() const;
Nz::Vector3f GetAngularVelocity() const;
float GetGravityFactor() const;
float GetMass() const;
NzVector3f GetMassCenter(nzCoordSys coordSys = nzCoordSys_Local) const;
const NzMatrix4f& GetMatrix() const;
NzVector3f GetPosition() const;
NzQuaternionf GetRotation() const;
NzVector3f GetVelocity() const;
Nz::Vector3f GetMassCenter(Nz::CoordSys coordSys = Nz::CoordSys_Local) const;
const Nz::Matrix4f& GetMatrix() const;
Nz::Vector3f GetPosition() const;
Nz::Quaternionf GetRotation() const;
Nz::Vector3f GetVelocity() const;
bool IsAutoSleepEnabled() const;
bool IsMoveable() const;
bool IsSleeping() const;
void SetAngularVelocity(const NzVector3f& angularVelocity);
void SetAngularVelocity(const Nz::Vector3f& angularVelocity);
void SetGravityFactor(float gravityFactor);
void SetMass(float mass);
void SetMassCenter(const NzVector3f& center);
void SetPosition(const NzVector3f& position);
void SetRotation(const NzQuaternionf& rotation);
void SetVelocity(const NzVector3f& velocity);
void SetMassCenter(const Nz::Vector3f& center);
void SetPosition(const Nz::Vector3f& position);
void SetRotation(const Nz::Quaternionf& rotation);
void SetVelocity(const Nz::Vector3f& velocity);
static ComponentIndex componentIndex;
private:
NzPhysObject& GetPhysObject();
Nz::PhysObject& GetPhysObject();
void OnAttached() override;
void OnComponentAttached(BaseComponent& component) override;
void OnComponentDetached(BaseComponent& component) override;
void OnDetached() override;
std::unique_ptr<NzPhysObject> m_object;
std::unique_ptr<Nz::PhysObject> m_object;
};
}

View File

@@ -12,21 +12,21 @@ namespace Ndk
NazaraUnused(physics);
}
inline void PhysicsComponent::AddForce(const NzVector3f& force, nzCoordSys coordSys)
inline void PhysicsComponent::AddForce(const Nz::Vector3f& force, Nz::CoordSys coordSys)
{
NazaraAssert(m_object, "Invalid physics object");
m_object->AddForce(force, coordSys);
}
inline void PhysicsComponent::AddForce(const NzVector3f& force, const NzVector3f& point, nzCoordSys coordSys)
inline void PhysicsComponent::AddForce(const Nz::Vector3f& force, const Nz::Vector3f& point, Nz::CoordSys coordSys)
{
NazaraAssert(m_object, "Invalid physics object");
m_object->AddForce(force, point, coordSys);
}
inline void PhysicsComponent::AddTorque(const NzVector3f& torque, nzCoordSys coordSys)
inline void PhysicsComponent::AddTorque(const Nz::Vector3f& torque, Nz::CoordSys coordSys)
{
NazaraAssert(m_object, "Invalid physics object");
@@ -40,14 +40,14 @@ namespace Ndk
m_object->EnableAutoSleep(autoSleep);
}
inline NzBoxf PhysicsComponent::GetAABB() const
inline Nz::Boxf PhysicsComponent::GetAABB() const
{
NazaraAssert(m_object, "Invalid physics object");
return m_object->GetAABB();
}
inline NzVector3f PhysicsComponent::GetAngularVelocity() const
inline Nz::Vector3f PhysicsComponent::GetAngularVelocity() const
{
NazaraAssert(m_object, "Invalid physics object");
@@ -68,35 +68,35 @@ namespace Ndk
return m_object->GetMass();
}
inline NzVector3f PhysicsComponent::GetMassCenter(nzCoordSys coordSys) const
inline Nz::Vector3f PhysicsComponent::GetMassCenter(Nz::CoordSys coordSys) const
{
NazaraAssert(m_object, "Invalid physics object");
return m_object->GetMassCenter(coordSys);
}
inline const NzMatrix4f& PhysicsComponent::GetMatrix() const
inline const Nz::Matrix4f& PhysicsComponent::GetMatrix() const
{
NazaraAssert(m_object, "Invalid physics object");
return m_object->GetMatrix();
}
inline NzVector3f PhysicsComponent::GetPosition() const
inline Nz::Vector3f PhysicsComponent::GetPosition() const
{
NazaraAssert(m_object, "Invalid physics object");
return m_object->GetPosition();
}
inline NzQuaternionf PhysicsComponent::GetRotation() const
inline Nz::Quaternionf PhysicsComponent::GetRotation() const
{
NazaraAssert(m_object, "Invalid physics object");
return m_object->GetRotation();
}
inline NzVector3f PhysicsComponent::GetVelocity() const
inline Nz::Vector3f PhysicsComponent::GetVelocity() const
{
NazaraAssert(m_object, "Invalid physics object");
@@ -117,7 +117,7 @@ namespace Ndk
return m_object->IsSleeping();
}
inline void PhysicsComponent::SetAngularVelocity(const NzVector3f& angularVelocity)
inline void PhysicsComponent::SetAngularVelocity(const Nz::Vector3f& angularVelocity)
{
NazaraAssert(m_object, "Invalid physics object");
@@ -139,35 +139,35 @@ namespace Ndk
m_object->SetMass(mass);
}
inline void PhysicsComponent::SetMassCenter(const NzVector3f& center)
inline void PhysicsComponent::SetMassCenter(const Nz::Vector3f& center)
{
NazaraAssert(m_object, "Invalid physics object");
m_object->SetMassCenter(center);
}
inline void PhysicsComponent::SetPosition(const NzVector3f& position)
inline void PhysicsComponent::SetPosition(const Nz::Vector3f& position)
{
NazaraAssert(m_object, "Invalid physics object");
m_object->SetPosition(position);
}
inline void PhysicsComponent::SetRotation(const NzQuaternionf& rotation)
inline void PhysicsComponent::SetRotation(const Nz::Quaternionf& rotation)
{
NazaraAssert(m_object, "Invalid physics object");
m_object->SetRotation(rotation);
}
inline void PhysicsComponent::SetVelocity(const NzVector3f& velocity)
inline void PhysicsComponent::SetVelocity(const Nz::Vector3f& velocity)
{
NazaraAssert(m_object, "Invalid physics object");
m_object->SetVelocity(velocity);
}
inline NzPhysObject& PhysicsComponent::GetPhysObject()
inline Nz::PhysObject& PhysicsComponent::GetPhysObject()
{
return *m_object.get();
}

View File

@@ -17,12 +17,12 @@ namespace Ndk
class NDK_API VelocityComponent : public Component<VelocityComponent>
{
public:
VelocityComponent(const NzVector3f& velocity = NzVector3f::Zero());
VelocityComponent(const Nz::Vector3f& velocity = Nz::Vector3f::Zero());
~VelocityComponent() = default;
NzVector3f linearVelocity;
Nz::Vector3f linearVelocity;
VelocityComponent& operator=(const NzVector3f& vel);
VelocityComponent& operator=(const Nz::Vector3f& vel);
static ComponentIndex componentIndex;
};

View File

@@ -7,12 +7,12 @@
namespace Ndk
{
inline VelocityComponent::VelocityComponent(const NzVector3f& velocity) :
inline VelocityComponent::VelocityComponent(const Nz::Vector3f& velocity) :
linearVelocity(velocity)
{
}
inline VelocityComponent& VelocityComponent::operator=(const NzVector3f& vel)
inline VelocityComponent& VelocityComponent::operator=(const Nz::Vector3f& vel)
{
linearVelocity = vel;
return *this;