Spinning Topp Logo BlackTopp Studios
inc
cameraproxy.cpp
Go to the documentation of this file.
1 // © Copyright 2010 - 2016 BlackTopp Studios Inc.
2 /* This file is part of The Mezzanine Engine.
3 
4  The Mezzanine Engine is free software: you can redistribute it and/or modify
5  it under the terms of the GNU General Public License as published by
6  the Free Software Foundation, either version 3 of the License, or
7  (at your option) any later version.
8 
9  The Mezzanine Engine is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  GNU General Public License for more details.
13 
14  You should have received a copy of the GNU General Public License
15  along with The Mezzanine Engine. If not, see <http://www.gnu.org/licenses/>.
16 */
17 /* The original authors have included a copy of the license specified above in the
18  'Docs' folder. See 'gpl.txt'
19 */
20 /* We welcome the use of the Mezzanine engine to anyone, including companies who wish to
21  Build professional software and charge for their product.
22 
23  However there are some practical restrictions, so if your project involves
24  any of the following you should contact us and we will try to work something
25  out:
26  - DRM or Copy Protection of any kind(except Copyrights)
27  - Software Patents You Do Not Wish to Freely License
28  - Any Kind of Linking to Non-GPL licensed Works
29  - Are Currently In Violation of Another Copyright Holder's GPL License
30  - If You want to change our code and not add a few hundred MB of stuff to
31  your distribution
32 
33  These and other limitations could cause serious legal problems if you ignore
34  them, so it is best to simply contact us or the Free Software Foundation, if
35  you have any questions.
36 
37  Joseph Toppi - toppij@gmail.com
38  John Blackwood - makoenergy02@gmail.com
39 */
40 #ifndef _graphicscameraproxy_cpp
41 #define _graphicscameraproxy_cpp
42 
43 /// @file
44 /// @brief This file contains the implementation for the World proxy wrapping camera functionality.
45 
46 #include "Graphics/cameraproxy.h"
47 #include "Graphics/scenemanager.h"
48 #include "Graphics/viewport.h"
49 
50 #include "exception.h"
51 #include "serialization.h"
52 #include "stringtool.h"
53 
54 #include <Ogre.h>
55 
56 namespace
57 {
58  /// @internal
59  /// @brief Converts an Ogre PolygonMode enum value to it's corresponding Mezzanine value.
60  /// @param PolyMode The Ogre value to be converted.
61  /// @return Returns the Mezzanine CameraPolyMode corresponding to the provided Ogre value.
62  Mezzanine::Graphics::CameraPolyMode ConvertPolygonMode(const Ogre::PolygonMode PolyMode)
63  {
64  switch(PolyMode)
65  {
66  case Ogre::PM_POINTS: return Mezzanine::Graphics::CPM_Points; break;
67  case Ogre::PM_WIREFRAME: return Mezzanine::Graphics::CPM_WireFrame; break;
68  case Ogre::PM_SOLID: return Mezzanine::Graphics::CPM_Solid; break;
69  }
71  }
72  /// @internal
73  /// @brief Converts a Mezzanine CameraPolyMode enum value to it's corresponding Ogre value.
74  /// @param PolyMode The Mezzanine value to be converted.
75  /// @return Returns the Ogre PolygonMode corresponding to the provided Mezzanine value.
76  Ogre::PolygonMode ConvertPolygonMode(const Mezzanine::Graphics::CameraPolyMode PolyMode)
77  {
78  switch(PolyMode)
79  {
80  case Mezzanine::Graphics::CPM_Points: return Ogre::PM_POINTS; break;
81  case Mezzanine::Graphics::CPM_WireFrame: return Ogre::PM_WIREFRAME; break;
82  case Mezzanine::Graphics::CPM_Solid: return Ogre::PM_SOLID; break;
83  }
84  return Ogre::PM_SOLID;
85  }
86 
87  /// @internal
88  /// @brief Converts an Ogre ProjectionType enum value to it's corresponding Mezzanine type.
89  /// @param ProjType The Ogre type to be converted.
90  /// @return Returns the Mezzanine ProjectionType corresponding to the provided Ogre type.
91  Mezzanine::Graphics::ProjectionType ConvertProjectionType(const Ogre::ProjectionType ProjType)
92  {
93  switch(ProjType)
94  {
95  case Ogre::PT_ORTHOGRAPHIC: return Mezzanine::Graphics::PT_Orthographic; break;
96  case Ogre::PT_PERSPECTIVE: return Mezzanine::Graphics::PT_Perspective; break;
97  }
99  }
100  /// @internal
101  /// @brief Converts a Mezzanine ProjectionType enum value to it's corresponding Ogre type.
102  /// @param ProjType The Mezzanine type to be converted.
103  /// @return Returns the Ogre ProjectionType corresponding to the provided Mezzanine type.
104  Ogre::ProjectionType ConvertProjectionType(const Mezzanine::Graphics::ProjectionType ProjType)
105  {
106  switch(ProjType)
107  {
108  case Mezzanine::Graphics::PT_Orthographic: return Ogre::PT_ORTHOGRAPHIC; break;
109  case Mezzanine::Graphics::PT_Perspective: return Ogre::PT_PERSPECTIVE; break;
110  }
111  return Ogre::PT_PERSPECTIVE;
112  }
113 
114  /// @internal
115  /// @brief Converts an Ogre OrientationMode enum value to it's corresponding Mezzanine type.
116  /// @param OriMode The Ogre type to be converted.
117  /// @return Returns the Mezzanine OrientationMode corresponding to the provided Ogre type.
118  Mezzanine::Graphics::OrientationMode ConvertOrientationMode(const Ogre::OrientationMode OriMode)
119  {
120  switch(OriMode)
121  {
122  case Ogre::OR_DEGREE_0: return Mezzanine::Graphics::OM_Degree_0; break;
123  case Ogre::OR_DEGREE_90: return Mezzanine::Graphics::OM_Degree_90; break;
124  case Ogre::OR_DEGREE_180: return Mezzanine::Graphics::OM_Degree_180; break;
125  case Ogre::OR_DEGREE_270: return Mezzanine::Graphics::OM_Degree_270; break;
126  }
127  return Mezzanine::Graphics::OM_Degree_0;
128  }
129  /// @internal
130  /// @brief Converts a Mezzanine OrientationMode enum value to it's corresponding Ogre type.
131  /// @param OriMode The Mezzanine type to be converted.
132  /// @return Returns the Ogre OrientationMode corresponding to the provided Mezzanine type.
133  Ogre::OrientationMode ConvertOrientationMode(const Mezzanine::Graphics::OrientationMode OriMode)
134  {
135  switch(OriMode)
136  {
137  case Mezzanine::Graphics::OM_Degree_0: return Ogre::OR_DEGREE_0; break;
138  case Mezzanine::Graphics::OM_Degree_90: return Ogre::OR_DEGREE_90; break;
139  case Mezzanine::Graphics::OM_Degree_180: return Ogre::OR_DEGREE_180; break;
140  case Mezzanine::Graphics::OM_Degree_270: return Ogre::OR_DEGREE_270; break;
141  }
142  return Ogre::OR_DEGREE_0;
143  }
144 }
145 
146 namespace Mezzanine
147 {
148  namespace Graphics
149  {
151  RenderableProxy(ID,Creator),
152  GraphicsCamera(NULL),
153  CameraVP(NULL),
154  UseFixedYaw(true)
155  { this->CreateCamera(); }
156 
157  CameraProxy::CameraProxy(const XML::Node& SelfRoot, SceneManager* Creator) :
158  RenderableProxy(Creator),
159  GraphicsCamera(NULL),
160  CameraVP(NULL),
161  UseFixedYaw(true)
162  {
163  this->CreateCamera();
164  this->ProtoDeSerialize(SelfRoot);
165  }
166 
168  { this->DestroyCamera(); }
169 
171  {
172  this->GraphicsCamera = this->Manager->_GetGraphicsWorldPointer()->createCamera( CameraProxy::GenerateName() );
173  this->GraphicsNode->attachObject( this->GraphicsCamera );
174  this->GraphicsCamera->MovableObject::setUserAny( Ogre::Any( static_cast<RenderableProxy*>( this ) ) );
175  this->GraphicsCamera->setVisibilityFlags(0);
176  this->GraphicsCamera->setQueryFlags(0);
177  }
178 
180  {
181  if( this->GraphicsCamera ) {
182  if( this->CameraVP ) {
183  this->CameraVP->SetCamera(NULL);
184  }
185 
186  this->GraphicsNode->detachObject( this->GraphicsCamera );
187  this->Manager->_GetGraphicsWorldPointer()->destroyCamera( this->GraphicsCamera );
188  }
189  }
190 
192  {
193  static UInt32 NameCounter = 0;
194  StringStream NameStream;
195  NameStream << "Camera" << ++NameCounter;
196  return NameStream.str();
197  }
198 
199  ///////////////////////////////////////////////////////////////////////////////
200  // Utility
201 
203  { return Mezzanine::PT_Graphics_CameraProxy; }
204 
206  { return this->CameraVP; }
207 
209  { return this->UseFixedYaw; }
210 
211  void CameraProxy::LookAt(const Vector3& TargetLoc)
212  { this->GraphicsNode->lookAt( TargetLoc.GetOgreVector3(), Ogre::Node::TS_WORLD ); }
213 
214  void CameraProxy::MoveRelative(const Vector3& ToMove)
215  { this->GraphicsNode->translate( ToMove.GetOgreVector3(), Ogre::Node::TS_LOCAL ); }
216 
218  { this->SetOrientation( Vector3::Neg_Unit_Z().GetRotationToAxis( Dir ) ); }
219 
221  { return ( this->GetOrientation() * Vector3::Neg_Unit_Z() ); }
222 
223  Ray CameraProxy::GetCameraToViewportRay(const Real ScreenX, const Real ScreenY) const
224  { return Ray( this->GraphicsCamera->getCameraToViewportRay(ScreenX,ScreenY) ); }
225 
226  ///////////////////////////////////////////////////////////////////////////////
227  // Camera Properties
228 
230  { this->GraphicsCamera->setPolygonMode( ConvertPolygonMode(PolyMode) ); }
231 
233  { return ConvertPolygonMode( this->GraphicsCamera->getPolygonMode() ); }
234 
236  { this->GraphicsCamera->setProjectionType( ConvertProjectionType(ProjType) ); }
237 
239  { return ConvertProjectionType( this->GraphicsCamera->getProjectionType() ); }
240 
242  { this->GraphicsCamera->setOrientationMode( ConvertOrientationMode(OriMode) ); }
243 
245  { return ConvertOrientationMode( this->GraphicsCamera->getOrientationMode() ); }
246 
247  void CameraProxy::SetOrthoWindow(const Real Width, const Real Height)
248  { this->GraphicsCamera->setOrthoWindow(Width,Height); }
249 
251  { this->GraphicsCamera->setOrthoWindowWidth(Width); }
252 
254  { return this->GraphicsCamera->getOrthoWindowWidth(); }
255 
257  { this->GraphicsCamera->setOrthoWindowHeight(Height); }
258 
260  { return this->GraphicsCamera->getOrthoWindowHeight(); }
261 
263  { this->GraphicsCamera->setNearClipDistance(NearDist); }
264 
266  { return this->GraphicsCamera->getNearClipDistance(); }
267 
269  { this->GraphicsCamera->setFarClipDistance(FarDist); }
270 
272  { return this->GraphicsCamera->getFarClipDistance(); }
273 
275  { this->GraphicsCamera->setFOVy( Ogre::Radian(FOV) ); }
276 
278  { return this->GraphicsCamera->getFOVy().valueRadians(); }
279 
281  { this->GraphicsCamera->setAspectRatio(Ratio); }
282 
284  { return this->GraphicsCamera->getAspectRatio(); }
285 
286  void CameraProxy::SetFixedYawAxis(const Boole UseFixed, const Vector3& Axis)
287  {
288  this->UseFixedYaw = UseFixed;
289  this->FixedYawAxis = Axis;
290  this->GraphicsCamera->setFixedYawAxis(UseFixed,Axis.GetOgreVector3());
291  }
292 
294  { return this->FixedYawAxis; }
295 
296  ///////////////////////////////////////////////////////////////////////////////
297  // Serialization
298 
300  {
302 
303  XML::Node PropertiesNode = SelfRoot.AppendChild( CameraProxy::GetSerializableName() + "Properties" );
304 
305  if( PropertiesNode.AppendAttribute("Version").SetValue("1") &&
306  PropertiesNode.AppendAttribute("PolygonMode").SetValue( this->GetPolygonMode() ) &&
307  PropertiesNode.AppendAttribute("ProjectionType").SetValue( this->GetProjectionType() ) &&
308  PropertiesNode.AppendAttribute("OrientationMode").SetValue( this->GetOrientationMode() ) &&
309  PropertiesNode.AppendAttribute("OrthoWidth").SetValue( this->GetOrthoWindowWidth() ) &&
310  PropertiesNode.AppendAttribute("OrthoHeight").SetValue( this->GetOrthoWindowHeight() ) &&
311  PropertiesNode.AppendAttribute("NearClipDistance").SetValue( this->GetNearClipDistance() ) &&
312  PropertiesNode.AppendAttribute("FarClipDistance").SetValue( this->GetFarClipDistance() ) &&
313  PropertiesNode.AppendAttribute("FieldOfView").SetValue( this->GetFieldOfViewY() ) &&
314  PropertiesNode.AppendAttribute("AspectRatio").SetValue( this->GetAspectRatio() ) &&
315  PropertiesNode.AppendAttribute("UseFixedYaw").SetValue( this->IsFixedYawEnabled() ) )
316  {
317  XML::Node FixedYawAxisNode = PropertiesNode.AppendChild("FixedYawAxis");
318  this->GetFixedYawAxis().ProtoSerialize( FixedYawAxisNode );
319 
320  return;
321  }else{
322  SerializeError("Create XML Attribute Values",CameraProxy::GetSerializableName() + "Properties",true);
323  }
324  }
325 
327  {
329 
330  XML::Attribute CurrAttrib;
331  XML::Node PropertiesNode = SelfRoot.GetChild( CameraProxy::GetSerializableName() + "Properties" );
332 
333  if( !PropertiesNode.Empty() ) {
334  if(PropertiesNode.GetAttribute("Version").AsInt() == 1) {
335  Boole UseFixed = true;
336  Vector3 FixedYaw = Vector3::Unit_Y();
337  Real OrthoWidth = 0, OrthoHeight = 0;
338 
339  CurrAttrib = PropertiesNode.GetAttribute("PolygonMode");
340  if( !CurrAttrib.Empty() )
341  this->SetPolygonMode( static_cast<Graphics::CameraPolyMode>( CurrAttrib.AsWhole() ) );
342 
343  CurrAttrib = PropertiesNode.GetAttribute("ProjectionType");
344  if( !CurrAttrib.Empty() )
345  this->SetProjectionType( static_cast<Graphics::ProjectionType>( CurrAttrib.AsWhole() ) );
346 
347  CurrAttrib = PropertiesNode.GetAttribute("OrientationMode");
348  if( !CurrAttrib.Empty() )
349  this->SetOrientationMode( static_cast<Graphics::OrientationMode>( CurrAttrib.AsWhole() ) );
350 
351  CurrAttrib = PropertiesNode.GetAttribute("OrthoWidth");
352  if( !CurrAttrib.Empty() )
353  OrthoWidth = CurrAttrib.AsReal();
354 
355  CurrAttrib = PropertiesNode.GetAttribute("OrthoHeight");
356  if( !CurrAttrib.Empty() )
357  OrthoHeight = CurrAttrib.AsReal();
358 
359  this->SetOrthoWindow(OrthoWidth,OrthoHeight);
360 
361  CurrAttrib = PropertiesNode.GetAttribute("NearClipDistance");
362  if( !CurrAttrib.Empty() )
363  this->SetNearClipDistance( CurrAttrib.AsReal() );
364 
365  CurrAttrib = PropertiesNode.GetAttribute("FarClipDistance");
366  if( !CurrAttrib.Empty() )
367  this->SetFarClipDistance( CurrAttrib.AsReal() );
368 
369  CurrAttrib = PropertiesNode.GetAttribute("FieldOfView");
370  if( !CurrAttrib.Empty() )
371  this->SetFieldOfViewY( CurrAttrib.AsReal() );
372 
373  CurrAttrib = PropertiesNode.GetAttribute("AspectRatio");
374  if( !CurrAttrib.Empty() )
375  this->SetAspectRatio( CurrAttrib.AsReal() );
376 
377  CurrAttrib = PropertiesNode.GetAttribute("UseFixedYaw");
378  if( !CurrAttrib.Empty() )
379  UseFixed = StringTools::ConvertToBool( CurrAttrib.AsString() );
380 
381  XML::Node FixedYawAxisNode = PropertiesNode.GetChild("FixedYawAxis").GetFirstChild();
382  if( !FixedYawAxisNode.Empty() ) {
383  FixedYaw.ProtoDeSerialize(FixedYawAxisNode);
384  }
385 
386  this->SetFixedYawAxis(UseFixed,FixedYaw);
387  }else{
388  MEZZ_EXCEPTION(ExceptionBase::INVALID_VERSION_EXCEPTION,"Incompatible XML Version for " + (CameraProxy::GetSerializableName() + "Properties" ) + ": Not Version 1.");
389  }
390  }else{
391  MEZZ_EXCEPTION(ExceptionBase::II_IDENTITY_NOT_FOUND_EXCEPTION,CameraProxy::GetSerializableName() + "Properties" + " was not found in the provided XML node, which was expected.");
392  }
393  }
394 
397 
399  { return "CameraProxy"; }
400 
401  ///////////////////////////////////////////////////////////////////////////////
402  // Internal Methods
403 
404  Ogre::Camera* CameraProxy::_GetGraphicsObject() const
405  { return this->GraphicsCamera; }
406 
407  Ogre::MovableObject* CameraProxy::_GetBaseGraphicsObject() const
408  { return this->GraphicsCamera; }
409  }//Graphics
410 }//Mezzanine
411 
412 #endif
void SetCamera(CameraProxy *ViewportCamera)
Sets which CameraProxy is bound to this viewport.
Definition: viewport.cpp:75
virtual void SetDirection(const Vector3 &Dir)
Sets the direction the light will be emitted from this source.
Attribute AppendAttribute(const Char8 *Name)
Creates an Attribute and puts it at the end of this Nodes attributes.
Ogre::Camera * GraphicsCamera
A pointer to the internal Camera this proxy is based on.
Definition: cameraproxy.h:75
A light-weight handle for manipulating attributes in DOM tree.
Definition: attribute.h:74
No projection is used, objects appear to be flat.
virtual void ProtoDeSerializeProperties(const XML::Node &SelfRoot)
Take the data stored in an XML Node and overwrite the properties of this object with it...
bool Boole
Generally acts a single bit, true or false.
Definition: datatypes.h:173
virtual void SetFarClipDistance(const Real FarDist)
Sets the distance in world units at which objects are considered too far to render.
ProjectionType
Values for storing how perspective should be interpretted.
static String GetSerializableName()
Get the name of the the XML tag the proxy class will leave behind as its instances are serialized...
This class contains utilities and functions to allow the manipulation of the Graphical scene...
Definition: scenemanager.h:85
Vector3 FixedYawAxis
A vector3 representing the fixed axis on which this camera will always Yaw/rotate.
Definition: cameraproxy.h:72
virtual Ray GetCameraToViewportRay(const Real ScreenX, const Real ScreenY) const
Gets a Ray from the camera to the viewport.
virtual void SetOrientation(const Quaternion &Ori)
Sets the orientation of this object in parent space.
virtual void DestroyCamera()
Destroys the internal Camera in use by this proxy.
virtual Real GetOrthoWindowWidth() const
Gets the current width of the Orthographic projection window in world units.
virtual void SetOrthoWindowWidth(const Real Width)
Defines the size of the Orthographic projection window in world units.
static String GenerateName()
Generates a name for this Camera to placate the internal system.
Thrown when the requested identity could not be found.
Definition: exception.h:94
Node GetFirstChild() const
Get the first child Node of this Node.
#define MEZZ_EXCEPTION(num, desc)
An easy way to throw exceptions with rich information.
Definition: exception.h:3048
SceneManager * Manager
This is a pointer to the scene manager that created and owns this proxy.
virtual Mezzanine::ProxyType GetProxyType() const
Accessor for the type of proxy.
virtual void ProtoDeSerialize(const XML::Node &SelfRoot)
Take the data stored in an XML Node and overwrite this object with it.
Definition: worldproxy.cpp:114
Thrown when a version is accessed/parsed/required and it cannot work correctly or is missing...
Definition: exception.h:112
virtual ~CameraProxy()
Class destructor.
const Char8 * AsString(const Char8 *def="") const
Attempts to convert the value of the attribute to a String and returns the results.
virtual Real GetOrthoWindowHeight() const
Gets the current height of the Orthographic projection window in world units.
virtual void SetAspectRatio(const Real Ratio)
Sets the aspect ratio of the cameras veiw.
virtual void CreateCamera()
Creates an internal Camera to be used by the calling instance.
virtual void SetProjectionType(const Graphics::ProjectionType ProjType)
Sets the type of projection to be used with this camera.
This is the base proxy class for world proxies wrapping functionality of the graphics subsystem...
virtual void SetNearClipDistance(const Real NearDist)
Sets the distance in world units at which objects are considered too close to render.
virtual void SetOrientationMode(const Graphics::OrientationMode OriMode)
Sets the orientation mode of this cameras frustrum.
bool Empty() const
Is this storing anything at all?
This implements the exception hiearchy for Mezzanine.
virtual void SetOrthoWindow(const Real Width, const Real Height)
Defines the size of the Orthographic projection window in world units.
virtual void LookAt(const Vector3 &TargetLoc)
Sets the direction the camera faces based on a 3D point.
std::stringstream StringStream
A Datatype used for streaming operations with strings.
Definition: datatypes.h:176
virtual Real GetFieldOfViewY() const
Gets the vertical field of view of the camera frustrum.
Ogre::SceneNode * GraphicsNode
A pointer to the internal object storing the proxy transform.
Only points for each of the vertices are rendered.
float Real
A Datatype used to represent a real floating point number.
Definition: datatypes.h:141
The interface for serialization.
bool SetValue(const Char8 *rhs)
Set the value of this.
virtual void ProtoDeSerializeProperties(const XML::Node &SelfRoot)
Take the data stored in an XML Node and overwrite the properties of this object with it...
Whole AsWhole(Whole def=0) const
Attempts to convert the value of the attribute to a Whole and returns the results.
This class is for creating and managing viewports within a game window.
Definition: viewport.h:65
Boole ConvertToBool(const String &ToConvert, const Boole Default)
Converts a string into a Boole.
Definition: stringtool.cpp:379
virtual Quaternion GetOrientation() const
Gets this objects current orientation.
This file contains the declaration for the World proxy wrapping camera functionality.
A light-weight handle for manipulating nodes in DOM tree.
Definition: node.h:89
virtual void SetOrthoWindowHeight(const Real Height)
Defines the size of the Orthographic projection window in world units.
int AsInt(int def=0) const
Attempts to convert the value of the attribute to an int and returns the results. ...
ProxyType
Used by all World proxies to describe what their derived types are.
Definition: enumerations.h:91
uint32_t UInt32
An 32-bit unsigned integer.
Definition: datatypes.h:126
virtual Viewport * GetViewport() const
Gets the Viewport this camera is attached to, if any.
static Vector3 Unit_Y()
Gets a vector representing the Y unit of a Vector3.
Definition: vector3.cpp:134
bool Empty() const
Is this storing anything at all?
Ogre::Vector3 GetOgreVector3() const
Gets a Ogre vector3.
Definition: vector3.cpp:572
Real AsReal(Real def=0) const
Attempts to convert the value of the attribute to a Real and returns the results. ...
virtual Real GetFarClipDistance() const
Gets the distance in world units at which objects are considered too far to render.
Boole UseFixedYaw
A Boole storing whether or not the FixedYawAxis is being used.
Definition: cameraproxy.h:81
virtual void SetPolygonMode(const Graphics::CameraPolyMode PolyMode)
Sets the debug rendering mode for this camera.
virtual Graphics::OrientationMode GetOrientationMode() const
Gets the orientation mode of this cameras frustrum.
virtual Ogre::MovableObject * _GetBaseGraphicsObject() const
Accessor for the internal graphics object.
void ProtoDeSerialize(const XML::Node &OneNode)
Take the data stored in an XML and overwrite this instance of this object with it.
Definition: vector3.cpp:614
CameraProxy(const UInt32 ID, SceneManager *Creator)
Class constructor.
Viewport * CameraVP
This is a pointer to the Viewport this camera is attached to, if any.
Definition: cameraproxy.h:78
virtual void SetFixedYawAxis(const Boole UseFixed, const Vector3 &Axis=Vector3::Unit_Y())
Sets whether or not to lock rotation around the Y axis.
CameraPolyMode
This is used by CameraProxies to quickly set a different render mode that is useful for debugging gra...
Ogre::SceneManager * _GetGraphicsWorldPointer() const
Gets the internal Ogre Scene Manager pointer.
This is used to represent a point in space, or a vector through space.
Definition: vector3.h:77
virtual Vector3 GetDirection() const
Gets the direction the light from this source is being emitted.
The bulk of the engine components go in this namspace.
Definition: actor.cpp:56
virtual Graphics::ProjectionType GetProjectionType() const
Get the type of projection used by the camera.
OrientationMode
Simple enum for communicating the orientation the UI and Camera have relative to the world it is rend...
Definition: enumerations.h:66
virtual void ProtoSerializeProperties(XML::Node &SelfRoot) const
Convert the properties of this class to an XML::Node ready for serialization.
Normal (realistic) perspective.
virtual Ogre::Camera * _GetGraphicsObject() const
Accessor for the internal camera.
virtual String GetDerivedSerializableName() const
Gets the most derived serializable name of this WorldProxy.
virtual void SetFieldOfViewY(const Real FOV)
Sets the vertical field of view of the camera frustrum.
void SerializeError(const String &FailedTo, const String &ClassName, Boole SOrD)
Simply does some string concatenation, then throws an Exception.
Wireframes for all the meshes and geometry are rendered.
Node AppendChild(NodeType Type=NodeElement)
Creates a Node and makes it a child of this one.
static Vector3 Neg_Unit_Z()
Gets a vector representing the negative Z unit of a Vector3.
Definition: vector3.cpp:146
virtual void MoveRelative(const Vector3 &ToMove)
Moves the camera through local space.
virtual Graphics::CameraPolyMode GetPolygonMode() const
Gets the debug rendering mode for this camera.
std::string String
A datatype used to a series of characters.
Definition: datatypes.h:159
virtual Boole IsFixedYawEnabled() const
Gets whether this cameras Yaw rotation is based on a fixed axis.
virtual Real GetAspectRatio() const
Gets the aspect ratio of the cameras veiw.
Attribute GetAttribute(const Char8 *Name) const
Attempt to get an Attribute on this Node with a given name.
virtual Real GetNearClipDistance() const
Gets the distance in world units at which objects are considered too close to render.
void ProtoSerialize(XML::Node &CurrentRoot) const
Convert this class to an XML::Node ready for serialization.
Definition: vector3.cpp:588
This represents a line placed in 3D space and is used with spacial queries.
Definition: ray.h:67
virtual Vector3 GetFixedYawAxis() const
If fixed yaw is enabled, on which axis is yawing disabled.
Node GetChild(const Char8 *Name) const
Attempt to get a child Node with a given name.
OrientationMode
This is used by CameraProxies to determine the orientation of the camera frustrum.
virtual void ProtoSerializeProperties(XML::Node &SelfRoot) const
Convert the properties of this class to an XML::Node ready for serialization.