Ignore:
Timestamp:
May 2, 2012, 1:47:32 PM (9 years ago)
Author:
sam
Message:

orbital: do not let the world objects know anything about the projection
or view matrix unless strictly necessary.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/orbital/mesh.h

    r1330 r1332  
    224224    }
    225225
    226     void Render(mat4 const &modelview, mat4 const &proj)
    227     {
     226    void Render(mat4 const &model)
     227    {
     228        mat4 modelview = Scene::GetDefault()->GetViewMatrix() * model;
    228229        mat3 normalmat = transpose(inverse(mat3(modelview)));
    229230
    230231        m_gpu.shader->Bind();
    231232        m_gpu.shader->SetUniform(m_gpu.modelview, modelview);
    232         m_gpu.shader->SetUniform(m_gpu.proj, proj);
     233        m_gpu.shader->SetUniform(m_gpu.proj, Scene::GetDefault()->GetProjMatrix());
    233234        m_gpu.shader->SetUniform(m_gpu.normalmat, normalmat);
    234235        m_gpu.vdecl->SetStream(m_gpu.vbo, m_gpu.coord, m_gpu.norm, m_gpu.color);
Note: See TracChangeset for help on using the changeset viewer.