Project

General

Profile

SO3Engine
SO3Camera.h
Go to the documentation of this file.
1/*
2-----------------------------------------------------------------------------
3This source file is part of OpenSpace3D
4For the latest info, see http://www.openspace3d.com
5
6Copyright (c) 2012 I-maginer
7
8This program is free software; you can redistribute it and/or modify it under
9the terms of the GNU Lesser General Public License as published by the Free Software
10Foundation; either version 2 of the License, or (at your option) any later
11version.
12
13This program is distributed in the hope that it will be useful, but WITHOUT
14ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
15FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
16
17You should have received a copy of the GNU Lesser General Public License along with
18this program; if not, write to the Free Software Foundation, Inc., 59 Temple
19Place - Suite 330, Boston, MA 02111-1307, USA, or go to
20http://www.gnu.org/copyleft/lesser.txt
21
22-----------------------------------------------------------------------------
23*/
24
33#ifndef __SO3CAMERA_H__
34#define __SO3CAMERA_H__
35
38
39namespace SO3
40{
41
42class SCamera : public SNode
43{
44public:
45protected:
46private:
47 SViewPort* currentViewport;
48 Ogre::Camera* O3Camera;
49 bool quadBufferStereo;
50
51public:
54 SCamera(SScene* parent, const std::string& cameraName);
55
58 ~SCamera();
59
62 Ogre::Camera* GetOgreCameraPointer();
63
67
70 void SetCurrentViewPort(SViewPort* mViewPort);
71
74 void SetAspectRatio(const float& ratio);
75
78 void SetAutoAspectRatio(bool state);
79
82 void SetFrustumOffset(const float& x, const float& y);
83
86 Ogre::Vector2 GetFrustumOffset();
87
90 void SetCustomProjectionMatrix(bool state, Ogre::Matrix4 projmat = Ogre::Matrix4::IDENTITY);
91
94 float GetAspectRatio();
95
98 bool IsFacingPoint(const Ogre::Vector3& point);
99
102 Ogre::Vector3 ToScreenSpace(const Ogre::Vector3& point);
103
107 virtual void SetRenderingDistance(const float& distance);
108
112 virtual float GetRenderingDistance();
113
117 virtual Ogre::Vector3 GetBoundingBoxSize(const bool& childs = false);
118
122 virtual Ogre::Vector3 GetBoundingBoxCenter(const bool& childs = false);
123
127 virtual Ogre::Vector3 GetWorldBoundingBoxSize(const bool& childs = false);
128
132 virtual Ogre::Vector3 GetWorldBoundingBoxCenter(const bool& childs = false);
133
136 void SetNearClipDistance(const float& distance);
137
140 float GetNearClipDistance();
141
144 void SetFarClipDistance(const float& distance);
145
148 float GetFarClipDistance();
149
152 const Ogre::Matrix4& GetProjectionMatrix();
153
156 const Ogre::Affine3& GetViewMatrix();
157 //const Ogre::Matrix4& GetViewMatrix();
158
161 const Ogre::Real GetFocalLength();
162
165 void SetFocalLength(const Ogre::Real& focalLength);
166
169 float GetFOVy();
170
173 void SetFOVy(const float& newFovY);
174
177 float GetLODbias();
178
181 void SetLODbias(const float& bias);
182
185 void SetProjectionType(const Ogre::ProjectionType& type);
186
189 Ogre::ProjectionType GetProjectionType();
190
193 void SetOrthoWindow(const SPoint<float>& size);
194
198
201 unsigned int GetNumRenderedFaces();
202
205 unsigned int GetNumRenderedBatches();
206
207protected:
208private:
212 SCamera();
213};
214
215}
216
217#endif
librairies include
void SetCurrentViewPort(SViewPort *mViewPort)
Definition SO3Camera.cpp:60
float GetFOVy()
virtual float GetRenderingDistance()
Ogre::Vector2 GetFrustumOffset()
void SetAutoAspectRatio(bool state)
Definition SO3Camera.cpp:89
unsigned int GetNumRenderedBatches()
void SetFOVy(const float &newFovY)
void SetFocalLength(const Ogre::Real &focalLength)
float GetAspectRatio()
Definition SO3Camera.cpp:84
virtual Ogre::Vector3 GetWorldBoundingBoxSize(const bool &childs=false)
Ogre::Camera * GetOgreCameraPointer()
Definition SO3Camera.cpp:50
Ogre::ProjectionType GetProjectionType()
void SetNearClipDistance(const float &distance)
virtual Ogre::Vector3 GetBoundingBoxSize(const bool &childs=false)
float GetNearClipDistance()
void SetCustomProjectionMatrix(bool state, Ogre::Matrix4 projmat=Ogre::Matrix4::IDENTITY)
bool IsFacingPoint(const Ogre::Vector3 &point)
float GetLODbias()
void SetProjectionType(const Ogre::ProjectionType &type)
void SetAspectRatio(const float &ratio)
Definition SO3Camera.cpp:72
virtual void SetRenderingDistance(const float &distance)
unsigned int GetNumRenderedFaces()
virtual Ogre::Vector3 GetBoundingBoxCenter(const bool &childs=false)
Ogre::Vector3 ToScreenSpace(const Ogre::Vector3 &point)
SViewPort * getCurrentViewPort()
Definition SO3Camera.cpp:55
const Ogre::Matrix4 & GetProjectionMatrix()
SPoint< float > GetOrthoWindow()
void SetLODbias(const float &bias)
void SetOrthoWindow(const SPoint< float > &size)
virtual Ogre::Vector3 GetWorldBoundingBoxCenter(const bool &childs=false)
float GetFarClipDistance()
void SetFarClipDistance(const float &distance)
const Ogre::Real GetFocalLength()
void SetFrustumOffset(const float &x, const float &y)
Definition SO3Camera.cpp:99
const Ogre::Affine3 & GetViewMatrix()