ApplyOrthographicParams camera method missing

Mar 24, 2013 at 1:38 AM
Edited Mar 24, 2013 at 1:42 AM
There is a method in your camera class for projection matrix config. But there is no method for ortho matrix config.

Your ApplyProjectionParams Method:
void Camera::SetProjectionParams( float zn, float zf, float aspect, float fov )
{
    m_fNear = zn;
    m_fFar = zf;
    m_fAspect = aspect;
    m_fFov = fov;

    ApplyProjectionParams();
}

void Camera::ApplyProjectionParams()
{
    m_ProjMatrix = Matrix4f::PerspectiveFovLHMatrix( m_fFov, m_fAspect, m_fNear, m_fFar );

    if ( m_pCameraView ) {
        m_pCameraView->SetProjMatrix( m_ProjMatrix );
    }
}
Ive added this one for Orthographic. It works perfect.
void Camera::SetOrthographicsParams( float zn, float zf, float width, float height ) {
    m_fNear = zn;
    m_fFar = zf;
    m_width = width;
    m_height = height;

    ApplyOrthographicParams();
}

void Camera::ApplyOrthographicParams()
{
    m_ProjMatrix = Matrix4f::OrthographicLHMatrix( m_width, m_height, m_fNear, m_fFar ); 

    if ( m_pCameraView ) {
        m_pCameraView->SetProjMatrix( m_ProjMatrix );
    }
}
using:
m_pCamera->SetOrthographicsParams(nearClip, farClip, 1024, 768);
Coordinator
Mar 24, 2013 at 12:11 PM
I will add this in to the next commit - thanks for the suggestion!
Coordinator
Mar 26, 2013 at 11:09 AM
This has been added and roughly tested out. Please let me know if it works for you!