[21] | 1 | /** |
---|
| 2 | * This source file is part of OgreColladaPlugin |
---|
| 3 | * an addon for OGRE (Object-oriented Graphics Rendering Engine) |
---|
| 4 | * For the latest info, see http://www.ogre3d.org/ |
---|
| 5 | * |
---|
| 6 | * This program is free software; you can redistribute it and/or modify it under |
---|
| 7 | * the terms of the GNU Lesser General Public License as published by the Free Software |
---|
| 8 | * Foundation; either version 2 of the License, or (at your option) any later |
---|
| 9 | * version. |
---|
| 10 | |
---|
| 11 | * This program is distributed in the hope that it will be useful, but WITHOUT |
---|
| 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS |
---|
| 13 | * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. |
---|
| 14 | |
---|
| 15 | * You should have received a copy of the GNU Lesser General Public License along with |
---|
| 16 | * this program; if not, write to the Free Software Foundation, Inc., 59 Temple |
---|
| 17 | * Place - Suite 330, Boston, MA 02111-1307, USA, or go to |
---|
| 18 | * http://www.gnu.org/copyleft/lesser.txt. |
---|
| 19 | * |
---|
| 20 | * @author Philipp Hartl |
---|
| 21 | * @see README |
---|
| 22 | */ |
---|
| 23 | |
---|
| 24 | #ifndef __COLLADA_CAMERA_H__ |
---|
| 25 | #define __COLLADA_CAMERA_H__ |
---|
| 26 | |
---|
| 27 | #include "OgreColladaPrerequisites.h" |
---|
| 28 | #include "OgreColladaEntity.h" |
---|
| 29 | |
---|
| 30 | namespace Ogre |
---|
| 31 | { |
---|
| 32 | /** |
---|
| 33 | * camera class |
---|
| 34 | */ |
---|
| 35 | class ColladaCamera : public ColladaEntity |
---|
| 36 | { |
---|
| 37 | public: |
---|
| 38 | ColladaCamera(ColladaDocument *d, xmlNode *n); |
---|
| 39 | virtual ~ColladaCamera(void); |
---|
| 40 | |
---|
| 41 | /** |
---|
| 42 | * create an ogre camera object |
---|
| 43 | * |
---|
| 44 | * @see base class |
---|
| 45 | */ |
---|
| 46 | virtual MovableObject *getOgreInstance(void) const; |
---|
| 47 | |
---|
| 48 | /** |
---|
| 49 | * import <camera> node |
---|
| 50 | * |
---|
| 51 | * @see base class |
---|
| 52 | */ |
---|
| 53 | virtual bool doImport(void); |
---|
| 54 | |
---|
| 55 | virtual EntityTypes getEntityType(void) const { return CAMERA; } |
---|
| 56 | |
---|
| 57 | private: |
---|
| 58 | enum CameraType { ORTHOGRAPHIC = 0, PERSPECTIVE, UNKNOWN = -1 }; |
---|
| 59 | |
---|
| 60 | CameraType mType; |
---|
| 61 | float mXFov, mYFov, mZNear, mZFar; // perspective |
---|
| 62 | float mLeft, mRight, mTop, mBottom; // orthographic |
---|
| 63 | |
---|
| 64 | /** |
---|
| 65 | * import an orthographic or perspective camera |
---|
| 66 | * |
---|
| 67 | * @param the <imager> node |
---|
| 68 | * @return true if succeeds, false otherwise |
---|
| 69 | */ |
---|
| 70 | bool importOptics(xmlNode *node); |
---|
| 71 | |
---|
| 72 | /** |
---|
| 73 | * import a specific image sensor of a camera (e.g. CCD) |
---|
| 74 | * |
---|
| 75 | * @param the <imager> node |
---|
| 76 | * @return true if succeeds, false otherwise |
---|
| 77 | */ |
---|
| 78 | bool importImager(xmlNode *node); |
---|
| 79 | }; |
---|
| 80 | } |
---|
| 81 | |
---|
| 82 | #endif // __COLLADA_CAMERA_H__ |
---|