SDK/CameraComponent: Add projection scale

This commit is contained in:
Lynix
2020-01-05 14:35:31 +01:00
parent 380c5eb9ae
commit c378ad26a9
4 changed files with 30 additions and 4 deletions

View File

@@ -154,11 +154,10 @@ namespace Ndk
}
/*!
* \brief Sets the layer of the camera in case of multiples fields
* \brief Sets the layer of the camera in case of multiples layers
*
* \param layer Layer of the camera
*/
void CameraComponent::SetLayer(unsigned int layer)
{
m_layer = layer;
@@ -166,10 +165,21 @@ namespace Ndk
m_entity->Invalidate(); // Invalidate the entity to make it passes through RenderSystem validation
}
/*!
* \brief Sets the camera projection scale
*
* \param scale New projection scale
*/
inline void CameraComponent::SetProjectionScale(const Nz::Vector3f& scale)
{
m_projectionScale = scale;
InvalidateProjectionMatrix();
}
/*!
* \brief Operation to perform when component is attached to an entity
*/
void CameraComponent::OnAttached()
{
if (m_entity->HasComponent<NodeComponent>())
@@ -304,6 +314,8 @@ namespace Ndk
break;
}
m_projectionMatrix *= Nz::Matrix4f::Scale(m_projectionScale);
m_projectionMatrixUpdated = true;
}