SDK/CameraComponent: Add projection scale
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user