Eidolon
Public Member Functions | List of all members
Camera Class Reference

#include <RenderTypes.h>

Inheritance diagram for Camera:
Inheritance graph
Collaboration diagram for Camera:
Collaboration graph

Public Member Functions

 Camera ()
 
virtual ~Camera ()
 
virtual const char * getName () const
 
virtual real getAspectRatio () const
 Get the aspect ratio of the notional box this camera sees through and shall render to a target. More...
 
virtual RaygetProjectedRay (real x, real y, bool isAbsolute=true) const
 
virtual vec3 getPosition () const
 
virtual vec3 getLookAt () const
 
virtual rotator getRotation () const
 
virtual mat4 getViewMatrix () const
 
virtual mat4 getProjMatrix () const
 
virtual vec3 getScreenPosition (vec3 pos) const
 Returns the (x,y) screen coordinate of the vector `pos' as drawn with the current camera configuration. More...
 
virtual vec3 getWorldPosition (real x, real y, bool isAbsolute=true) const
 Returns the world position of screen coordinate (x,y), which is either absolute pixel coordinates or relative screen proportion values (see getProjectedRay()) More...
 
virtual void setPosition (const vec3 &v)
 
virtual void setLookAt (const vec3 &v)
 
virtual void setUp (const vec3 &v)
 
virtual void setZUp ()
 
virtual void rotate (const rotator &r)
 
virtual void setRotation (const rotator &r)
 
virtual void setNearClip (real dist)
 
virtual void setFarClip (real dist)
 
virtual void setVertFOV (real rads)
 
virtual void setBGColor (const color &c)
 
virtual void setAspectRatio (real rat)
 
virtual void setViewport (real left=0.0f, real top=0.0f, real width=1.0f, real height=1.0f)
 
virtual void setOrtho (bool isOrtho)
 
virtual void setWireframe (bool isWireframe)
 
virtual void setSecondaryCamera (bool selective)
 
virtual real getVertFOV () const
 
virtual real getNearClip () const
 
virtual real getFarClip () const
 
virtual sval getWidth () const
 
virtual sval getHeight () const
 
virtual bool isPointInViewport (int x, int y) const
 
virtual bool isSecondaryCamera ()
 
virtual void renderToFile (const std::string &filename, sval width, sval height, TextureFormat format=TF_RGB24, real stereoOffset=0.0) throw (RenderException)
 Create an offscreen texture, render to it, then write the contents to the file `filename', assuming it's extension is for an understood format. More...
 
virtual void renderToStream (void *stream, sval width, sval height, TextureFormat format=TF_RGB24, real stereoOffset=0.0) throw (RenderException)
 Create an offscreen texture, render to it, then blit the contents to `stream', which must be large enough for data of the given texture format. More...
 
virtual ImagerenderToImage (sval width, sval height, TextureFormat format=TF_RGB24, real stereoOffset=0.0) throw (RenderException)
 Create an offscreen texture, render to it, then blit the contents to the returned Image object, which can then be used to save the image to file. More...
 

Detailed Description

A notional camera in a scene defined by a point in space and the directional vectors describing its orientation. A viewport relates a camera to a render target, in this case a render UI widget. The viewport can be set to only cover some of the target's area, so multiple cameras can render into the widget in different places. By default cameras are instantiated as primary cameras and by default see all scene objects whose visibility settings haven't been changed. By setting a camera to be seconday it will by default see no scene objects except those Figure objects which explicitly makes themselves visible to that specific camera.

Constructor & Destructor Documentation

◆ Camera()

Camera ( )
inline

◆ ~Camera()

virtual ~Camera ( )
inlinevirtual

Member Function Documentation

◆ getAspectRatio()

virtual real getAspectRatio ( ) const
inlinevirtual

Get the aspect ratio of the notional box this camera sees through and shall render to a target.

Reimplemented in OgreCamera.

◆ getFarClip()

virtual real getFarClip ( ) const
inlinevirtual

Reimplemented in OgreCamera.

◆ getHeight()

virtual sval getHeight ( ) const
inlinevirtual

Reimplemented in OgreCamera.

◆ getLookAt()

virtual vec3 getLookAt ( ) const
inlinevirtual

Reimplemented in OgreCamera.

◆ getName()

virtual const char* getName ( ) const
inlinevirtual

Reimplemented in OgreCamera.

Here is the caller graph for this function:

◆ getNearClip()

virtual real getNearClip ( ) const
inlinevirtual

Reimplemented in OgreCamera.

◆ getPosition()

virtual vec3 getPosition ( ) const
inlinevirtual

Reimplemented in OgreCamera.

◆ getProjectedRay()

virtual Ray* getProjectedRay ( real  x,
real  y,
bool  isAbsolute = true 
) const
inlinevirtual

Get the projected ray from a point on the screen, (x,y) are real render target (widget) screen coordinates if `isAbsolute' is true, otherwise (x,y) are relative screen proportion values ranging over the unit square. In either case the top left corner of the camera's view area is (0,0), the bottom right is (w,h) for view area w-by-h pixels or (1,1) for relative coords.

Reimplemented in OgreCamera.

◆ getProjMatrix()

virtual mat4 getProjMatrix ( ) const
inlinevirtual

Reimplemented in OgreCamera.

◆ getRotation()

virtual rotator getRotation ( ) const
inlinevirtual

Reimplemented in OgreCamera.

◆ getScreenPosition()

virtual vec3 getScreenPosition ( vec3  pos) const
inlinevirtual

Returns the (x,y) screen coordinate of the vector `pos' as drawn with the current camera configuration.

Reimplemented in OgreCamera.

Here is the caller graph for this function:

◆ getVertFOV()

virtual real getVertFOV ( ) const
inlinevirtual

Reimplemented in OgreCamera.

◆ getViewMatrix()

virtual mat4 getViewMatrix ( ) const
inlinevirtual

Reimplemented in OgreCamera.

◆ getWidth()

virtual sval getWidth ( ) const
inlinevirtual

Reimplemented in OgreCamera.

◆ getWorldPosition()

virtual vec3 getWorldPosition ( real  x,
real  y,
bool  isAbsolute = true 
) const
inlinevirtual

Returns the world position of screen coordinate (x,y), which is either absolute pixel coordinates or relative screen proportion values (see getProjectedRay())

Here is the call graph for this function:
Here is the caller graph for this function:

◆ isPointInViewport()

virtual bool isPointInViewport ( int  x,
int  y 
) const
inlinevirtual

Reimplemented in OgreCamera.

◆ isSecondaryCamera()

virtual bool isSecondaryCamera ( )
inlinevirtual

Reimplemented in OgreCamera.

◆ renderToFile()

virtual void renderToFile ( const std::string &  filename,
sval  width,
sval  height,
TextureFormat  format = TF_RGB24,
real  stereoOffset = 0.0 
)
throw (RenderException
)
inlinevirtual

Create an offscreen texture, render to it, then write the contents to the file `filename', assuming it's extension is for an understood format.

Reimplemented in OgreCamera.

◆ renderToImage()

virtual Image* renderToImage ( sval  width,
sval  height,
TextureFormat  format = TF_RGB24,
real  stereoOffset = 0.0 
)
throw (RenderException
)
inlinevirtual

Create an offscreen texture, render to it, then blit the contents to the returned Image object, which can then be used to save the image to file.

Reimplemented in OgreCamera.

◆ renderToStream()

virtual void renderToStream ( void *  stream,
sval  width,
sval  height,
TextureFormat  format = TF_RGB24,
real  stereoOffset = 0.0 
)
throw (RenderException
)
inlinevirtual

Create an offscreen texture, render to it, then blit the contents to `stream', which must be large enough for data of the given texture format.

Reimplemented in OgreCamera.

◆ rotate()

virtual void rotate ( const rotator r)
inlinevirtual

Reimplemented in OgreCamera.

Here is the caller graph for this function:

◆ setAspectRatio()

virtual void setAspectRatio ( real  rat)
inlinevirtual

Reimplemented in OgreCamera.

Here is the caller graph for this function:

◆ setBGColor()

virtual void setBGColor ( const color c)
inlinevirtual

Reimplemented in OgreCamera.

◆ setFarClip()

virtual void setFarClip ( real  dist)
inlinevirtual

Reimplemented in OgreCamera.

◆ setLookAt()

virtual void setLookAt ( const vec3 v)
inlinevirtual

Reimplemented in OgreCamera.

◆ setNearClip()

virtual void setNearClip ( real  dist)
inlinevirtual

Reimplemented in OgreCamera.

◆ setOrtho()

virtual void setOrtho ( bool  isOrtho)
inlinevirtual

Reimplemented in OgreCamera.

◆ setPosition()

virtual void setPosition ( const vec3 v)
inlinevirtual

Reimplemented in OgreCamera.

Here is the caller graph for this function:

◆ setRotation()

virtual void setRotation ( const rotator r)
inlinevirtual

Reimplemented in OgreCamera.

Here is the caller graph for this function:

◆ setSecondaryCamera()

virtual void setSecondaryCamera ( bool  selective)
inlinevirtual

Reimplemented in OgreCamera.

◆ setUp()

virtual void setUp ( const vec3 v)
inlinevirtual

Reimplemented in OgreCamera.

◆ setVertFOV()

virtual void setVertFOV ( real  rads)
inlinevirtual

Reimplemented in OgreCamera.

◆ setViewport()

virtual void setViewport ( real  left = 0.0f,
real  top = 0.0f,
real  width = 1.0f,
real  height = 1.0f 
)
inlinevirtual

Reimplemented in OgreCamera.

◆ setWireframe()

virtual void setWireframe ( bool  isWireframe)
inlinevirtual

Reimplemented in OgreCamera.

◆ setZUp()

virtual void setZUp ( )
inlinevirtual

Reimplemented in OgreCamera.


The documentation for this class was generated from the following file: