void MeshSceneNode::render(Renderer *renderer, Program *program, Camera *cam, const glm::mat4 ¤t, const glm::mat4 ¤tRotation) { auto material=getMaterial(); const glm::mat4 tmpMatrix=current*m_relative.getMatrix(); const glm::mat4 tmpRotation=currentRotation*m_relative.getRotationMatrix(); if(m_last != tmpMatrix) transformAABB(tmpMatrix); Frustum frustum = cam->getFrustum(); if((frustum.AABBinFrustum(m_aabb)) && material) { program->setUniform("mvp", cam->getVPMatrix()*tmpMatrix); program->setUniform("model", tmpMatrix); program->setUniform("nmat", tmpRotation); program->setUniform("eyePos", cam->getPos()); renderer->drawElements(program, m_vao, PT_TRIANGLES, m_indicesCount); } }