00001 /* 00002 ----------------------------------------------------------------------------- 00003 This source file is part of OpenSpace3D 00004 For the latest info, see http://www.openspace3d.com 00005 00006 Copyright (c) 2010 I-maginer 00007 00008 This program is free software; you can redistribute it and/or modify it under 00009 the terms of the GNU Lesser General Public License as published by the Free Software 00010 Foundation; either version 2 of the License, or (at your option) any later 00011 version. 00012 00013 This program is distributed in the hope that it will be useful, but WITHOUT 00014 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 00015 FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. 00016 00017 You should have received a copy of the GNU Lesser General Public License along with 00018 this program; if not, write to the Free Software Foundation, Inc., 59 Temple 00019 Place - Suite 330, Boston, MA 02111-1307, USA, or go to 00020 http://www.gnu.org/copyleft/lesser.txt 00021 00022 You may alternatively use this source under the terms of a specific version of 00023 the OpenSpace3D Unrestricted License provided you have obtained such a license from 00024 I-maginer. 00025 ----------------------------------------------------------------------------- 00026 */ 00027 00036 #ifndef __SO3CAMERA_H__ 00037 #define __SO3CAMERA_H__ 00038 00039 #include "../SCOLBasic/SO3Std.h" 00040 #include "../SO3SceneGraph/SO3NodeScol.h" 00041 00042 namespace SO3 00043 { 00044 00045 class SCamera : public SNode 00046 { 00047 public: 00048 protected: 00049 private: 00050 SViewPort* currentViewport; 00051 Ogre::Camera* O3Camera; 00052 00053 public: 00056 SCamera(SScene* parent, std::string cameraName); 00057 00060 ~SCamera(); 00061 00064 Ogre::Camera* GetOgreCameraPointer(); 00065 00068 SViewPort* getCurrentViewPort(); 00069 00072 void SetCurrentViewPort(SViewPort* mViewPort); 00073 00076 void SetAspectRatio(float ratio); 00077 00080 bool IsFacingPoint(Ogre::Vector3 point); 00081 00084 Ogre::Vector3& ToScreenSpace(Ogre::Vector3& point); 00085 00089 virtual void SetRenderingDistance(float distance); 00090 00094 virtual float GetRenderingDistance(); 00095 00099 virtual Ogre::Vector3 GetBoundingBoxSize(bool childs = false); 00100 00104 virtual Ogre::Vector3 GetBoundingBoxCenter(bool childs = false); 00105 00108 void SetNearClipDistance(float distance); 00109 00112 float GetNearClipDistance(); 00113 00116 void SetFarClipDistance(float distance); 00117 00120 float GetFarClipDistance(); 00121 00124 const Ogre::Matrix4& GetProjectionMatrix(); 00125 00128 const Ogre::Matrix4& GetViewMatrix(); 00129 00130 protected: 00131 private: 00135 SCamera(); 00136 }; 00137 00138 } 00139 00140 #endif
1.6.3