Camera not longer use a LookAt view matrix
Former-commit-id: c07e1db9f939bcfe9ef09a1fdab88176f79b61e8
This commit is contained in:
@@ -10,7 +10,6 @@
|
||||
|
||||
NzCamera::NzCamera() :
|
||||
m_viewport(0.f, 0.f, 1.f, 1.f),
|
||||
m_upVector(NzVector3f::Up()),
|
||||
m_frustumUpdated(false),
|
||||
m_projectionMatrixUpdated(false),
|
||||
m_viewMatrixUpdated(false),
|
||||
@@ -131,11 +130,6 @@ const NzRenderTarget* NzCamera::GetTarget() const
|
||||
return m_target;
|
||||
}
|
||||
|
||||
const NzVector3f& NzCamera::GetUpVector() const
|
||||
{
|
||||
return m_upVector;
|
||||
}
|
||||
|
||||
const NzMatrix4f& NzCamera::GetViewMatrix() const
|
||||
{
|
||||
if (!m_viewMatrixUpdated)
|
||||
@@ -177,14 +171,6 @@ void NzCamera::SetTarget(const NzRenderTarget& renderTarget)
|
||||
SetTarget(&renderTarget);
|
||||
}
|
||||
|
||||
void NzCamera::SetUpVector(const NzVector3f& upVector)
|
||||
{
|
||||
m_upVector = upVector;
|
||||
|
||||
m_frustumUpdated = false;
|
||||
m_viewMatrixUpdated = false;
|
||||
}
|
||||
|
||||
void NzCamera::SetViewport(const NzRectf& viewport)
|
||||
{
|
||||
m_viewport = viewport;
|
||||
@@ -231,7 +217,13 @@ void NzCamera::Unregister()
|
||||
|
||||
void NzCamera::UpdateFrustum() const
|
||||
{
|
||||
m_frustum.Build(m_fov, m_aspectRatio, m_zNear, m_zFar, m_derivedPosition, m_derivedPosition + m_derivedRotation*NzVector3f::Forward(), m_upVector);
|
||||
if (!m_projectionMatrixUpdated)
|
||||
UpdateProjectionMatrix();
|
||||
|
||||
if (!m_viewMatrixUpdated)
|
||||
UpdateViewMatrix();
|
||||
|
||||
m_frustum.Extract(m_viewMatrix, m_projectionMatrix);
|
||||
m_frustumUpdated = true;
|
||||
}
|
||||
|
||||
@@ -246,7 +238,7 @@ void NzCamera::UpdateViewMatrix() const
|
||||
if (!m_derivedUpdated)
|
||||
UpdateDerived();
|
||||
|
||||
m_viewMatrix.MakeLookAt(m_derivedPosition, m_derivedPosition + m_derivedRotation*NzVector3f::Forward(), m_upVector);
|
||||
m_viewMatrix.MakeViewMatrix(m_derivedPosition, m_derivedRotation);
|
||||
m_viewMatrixUpdated = true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user