// This file is part of libigl, a simple c++ geometry processing library. // // Copyright (C) 2015 Alec Jacobson // // This Source Code Form is subject to the terms of the Mozilla Public License // v. 2.0. If a copy of the MPL was not distributed with this file, You can // obtain one at http://mozilla.org/MPL/2.0/. #include "model_proj_viewport.h" #include "gl.h" template IGL_INLINE void igl::opengl2::model_proj_viewport( Eigen::PlainObjectBase & model, Eigen::PlainObjectBase & proj, Eigen::PlainObjectBase & viewport) { Eigen::Matrix4d MV,P; Eigen::Vector4i VPi; glGetDoublev(GL_MODELVIEW_MATRIX,MV.data()); glGetDoublev(GL_PROJECTION_MATRIX,P.data()); glGetIntegerv(GL_VIEWPORT,VPi.data()); viewport = VPi.cast(); model = MV.cast(); proj = P.cast(); } #ifdef IGL_STATIC_LIBRARY // Explicit template instantiation template void igl::opengl2::model_proj_viewport, Eigen::Matrix, Eigen::Matrix >(Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); template void igl::opengl2::model_proj_viewport, Eigen::Matrix, Eigen::Matrix >(Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); #endif