SDK/CameraComponent: Moved virtual functions to source file

Former-commit-id: 633046a6f599ce9f8712e11b8195509d9704bfc0 [formerly 080ea253a37d683c72372b406148372f9c1b92d2] [formerly 528dbe2f2c9dcac7b48c11feafb24a12afd43652 [formerly af9843c5eae928fb2f03c0ec1550e7ef95f69108]]
Former-commit-id: f17eed57cd271cfc55ef380bde44917ea26deac7 [formerly 30667bf567620cc339c96388303582b8b8601f68]
Former-commit-id: 66843984b23bee78fdbcefebbf56febddcdb4bb2
This commit is contained in:
Lynix 2016-09-27 18:09:25 +02:00
parent 939e28b990
commit 29ac52770e
3 changed files with 92 additions and 103 deletions

View File

@ -34,21 +34,21 @@ namespace Ndk
inline void EnsureViewMatrixUpdate() const; inline void EnsureViewMatrixUpdate() const;
inline void EnsureViewportUpdate() const; inline void EnsureViewportUpdate() const;
inline float GetAspectRatio() const override; float GetAspectRatio() const override;
inline Nz::Vector3f GetEyePosition() const override; Nz::Vector3f GetEyePosition() const override;
inline Nz::Vector3f GetForward() const override; Nz::Vector3f GetForward() const override;
inline float GetFOV() const; inline float GetFOV() const;
inline const Nz::Frustumf& GetFrustum() const override; const Nz::Frustumf& GetFrustum() const override;
inline unsigned int GetLayer() const; inline unsigned int GetLayer() const;
inline const Nz::Matrix4f& GetProjectionMatrix() const override; const Nz::Matrix4f& GetProjectionMatrix() const override;
inline Nz::ProjectionType GetProjectionType() const; inline Nz::ProjectionType GetProjectionType() const;
inline const Nz::Vector2f& GetSize() const; inline const Nz::Vector2f& GetSize() const;
inline const Nz::RenderTarget* GetTarget() const override; const Nz::RenderTarget* GetTarget() const override;
inline const Nz::Rectf& GetTargetRegion() const; inline const Nz::Rectf& GetTargetRegion() const;
inline const Nz::Matrix4f& GetViewMatrix() const override; const Nz::Matrix4f& GetViewMatrix() const override;
inline const Nz::Recti& GetViewport() const override; const Nz::Recti& GetViewport() const override;
inline float GetZFar() const override; float GetZFar() const override;
inline float GetZNear() const override; float GetZNear() const override;
inline void SetFOV(float fov); inline void SetFOV(float fov);
inline void SetLayer(unsigned int layer); inline void SetLayer(unsigned int layer);

View File

@ -95,40 +95,15 @@ namespace Ndk
UpdateViewport(); UpdateViewport();
} }
/*!
* \brief Gets the aspect ratio of the camera
* \return Aspect ratio of the camera
*/
inline float CameraComponent::GetAspectRatio() const
{
EnsureViewportUpdate();
return m_aspectRatio;
}
/*! /*!
* \brief Gets the field of view of the camera * \brief Gets the field of view of the camera
* \return Field of view of the camera * \return Field of view of the camera
*/ */
float CameraComponent::GetFOV() const
inline float CameraComponent::GetFOV() const
{ {
return m_fov; return m_fov;
} }
/*!
* \brief Gets the frutum of the camera
* \return A constant reference to the frustum of the camera
*/
inline const Nz::Frustumf& CameraComponent::GetFrustum() const
{
EnsureFrustumUpdate();
return m_frustum;
}
/*! /*!
* \brief Gets the layer of the camera * \brief Gets the layer of the camera
* \return Layer of the camera * \return Layer of the camera
@ -139,18 +114,6 @@ namespace Ndk
return m_layer; return m_layer;
} }
/*!
* \brief Gets the projection matrix of the camera
* \return A constant reference to the projection matrix of the camera
*/
inline const Nz::Matrix4f& CameraComponent::GetProjectionMatrix() const
{
EnsureProjectionMatrixUpdate();
return m_projectionMatrix;
}
/*! /*!
* \brief Gets the projection type of the camera * \brief Gets the projection type of the camera
* \return Projection type of the camera * \return Projection type of the camera
@ -171,16 +134,6 @@ namespace Ndk
return m_size; return m_size;
} }
/*!
* \brief Gets the target of the camera
* \return A constant reference to the render target of the camera
*/
inline const Nz::RenderTarget* CameraComponent::GetTarget() const
{
return m_target;
}
/*! /*!
* \brief Gets the target region of the camera * \brief Gets the target region of the camera
* \return A constant reference to the target region of the camera * \return A constant reference to the target region of the camera
@ -191,50 +144,6 @@ namespace Ndk
return m_targetRegion; return m_targetRegion;
} }
/*!
* \brief Gets the view matrix of the camera
* \return A constant reference to the view matrix of the camera
*/
inline const Nz::Matrix4f& CameraComponent::GetViewMatrix() const
{
EnsureViewMatrixUpdate();
return m_viewMatrix;
}
/*!
* \brief Gets the view port of the camera
* \return A constant reference to the view port of the camera
*/
inline const Nz::Recti& CameraComponent::GetViewport() const
{
EnsureViewportUpdate();
return m_viewport;
}
/*!
* \brief Gets the Z far distance of the camera
* \return Z far distance of the camera
*/
inline float CameraComponent::GetZFar() const
{
return m_zFar;
}
/*!
* \brief Gets the Z near distance of the camera
* \return Z near distance of the camera
*/
inline float CameraComponent::GetZNear() const
{
return m_zNear;
}
/*! /*!
* \brief Sets the field of view of the camera * \brief Sets the field of view of the camera
* *

View File

@ -35,6 +35,17 @@ namespace Ndk
Nz::Renderer::SetViewport(m_viewport); Nz::Renderer::SetViewport(m_viewport);
} }
/*!
* \brief Gets the aspect ratio of the camera
* \return Aspect ratio of the camera
*/
float CameraComponent::GetAspectRatio() const
{
EnsureViewportUpdate();
return m_aspectRatio;
}
/*! /*!
* \brief Gets the eye position of the camera * \brief Gets the eye position of the camera
* *
@ -53,7 +64,6 @@ namespace Ndk
* *
* \remark Produces a NazaraAssert if entity is invalid or has no NodeComponent * \remark Produces a NazaraAssert if entity is invalid or has no NodeComponent
*/ */
Nz::Vector3f CameraComponent::GetForward() const Nz::Vector3f CameraComponent::GetForward() const
{ {
NazaraAssert(m_entity && m_entity->HasComponent<NodeComponent>(), "CameraComponent requires NodeComponent"); NazaraAssert(m_entity && m_entity->HasComponent<NodeComponent>(), "CameraComponent requires NodeComponent");
@ -61,6 +71,76 @@ namespace Ndk
return m_entity->GetComponent<NodeComponent>().GetForward(); return m_entity->GetComponent<NodeComponent>().GetForward();
} }
/*!
* \brief Gets the frutum of the camera
* \return A constant reference to the frustum of the camera
*/
const Nz::Frustumf& CameraComponent::GetFrustum() const
{
EnsureFrustumUpdate();
return m_frustum;
}
/*!
* \brief Gets the projection matrix of the camera
* \return A constant reference to the projection matrix of the camera
*/
const Nz::Matrix4f& CameraComponent::GetProjectionMatrix() const
{
EnsureProjectionMatrixUpdate();
return m_projectionMatrix;
}
/*!
* \brief Gets the target of the camera
* \return A constant reference to the render target of the camera
*/
const Nz::RenderTarget* CameraComponent::GetTarget() const
{
return m_target;
}
/*!
* \brief Gets the view matrix of the camera
* \return A constant reference to the view matrix of the camera
*/
const Nz::Matrix4f& CameraComponent::GetViewMatrix() const
{
EnsureViewMatrixUpdate();
return m_viewMatrix;
}
/*!
* \brief Gets the view port of the camera
* \return A constant reference to the view port of the camera
*/
const Nz::Recti& CameraComponent::GetViewport() const
{
EnsureViewportUpdate();
return m_viewport;
}
/*!
* \brief Gets the Z far distance of the camera
* \return Z far distance of the camera
*/
float CameraComponent::GetZFar() const
{
return m_zFar;
}
/*!
* \brief Gets the Z near distance of the camera
* \return Z near distance of the camera
*/
float CameraComponent::GetZNear() const
{
return m_zNear;
}
/*! /*!
* \brief Sets the layer of the camera in case of multiples fields * \brief Sets the layer of the camera in case of multiples fields
* *