#ifndef Magnum_SceneGraph_Camera3D_hpp #define Magnum_SceneGraph_Camera3D_hpp /* Copyright © 2010, 2011, 2012 Vladimír Vondruš This file is part of Magnum. Magnum is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License version 3 only, as published by the Free Software Foundation. Magnum is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License version 3 for more details. */ /** @file * @brief @ref compilation-speedup-hpp "Template implementation" for Camera3D.h */ #include "AbstractCamera.hpp" #include "Camera3D.h" namespace Magnum { namespace SceneGraph { template Camera3D::Camera3D(AbstractObject<3, T>* object): AbstractCamera<3, T>(object), _near(T(0)), _far(T(0)) {} template Camera3D* Camera3D::setOrthographic(const Math::Vector2& size, T near, T far) { /** @todo Get near/far from the matrix */ _near = near; _far = far; AbstractCamera<3, T>::rawProjectionMatrix = Math::Matrix4::orthographicProjection(size, near, far); AbstractCamera<3, T>::fixAspectRatio(); return this; } template Camera3D* Camera3D::setPerspective(const Math::Vector2& size, T near, T far) { /** @todo Get near/far from the matrix */ _near = near; _far = far; AbstractCamera<3, T>::rawProjectionMatrix = Math::Matrix4::perspectiveProjection(size, near, far); AbstractCamera<3, T>::fixAspectRatio(); return this; } template Camera3D* Camera3D::setPerspective(Math::Rad fov, T aspectRatio, T near, T far) { /** @todo Get near/far from the matrix */ _near = near; _far = far; AbstractCamera<3, T>::rawProjectionMatrix = Math::Matrix4::perspectiveProjection(fov, aspectRatio, near, far); AbstractCamera<3, T>::fixAspectRatio(); return this; } }} #endif