scg3  0.6
scg::OrthographicCamera Class Reference

A camera with orthographic projection(composite node). More...

#include "OrthographicCamera.h"

Inheritance diagram for scg::OrthographicCamera:
[legend]
Collaboration diagram for scg::OrthographicCamera:
[legend]

Public Member Functions

 OrthographicCamera ()
 
virtual ~OrthographicCamera ()
 
void init (GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat near, GLfloat far)
 
virtual void updateProjection ()
 
- Public Member Functions inherited from scg::Camera
 Camera ()
 
virtual ~Camera ()
 
virtual const glm::mat4 & getProjection ()
 
virtual const glm::mat4 & getViewTransform (RenderState *renderState)
 
const glm::vec3 & getPosition () const
 
CamerasetPosition (const glm::vec3 &position)
 
const glm::quat & getOrientation () const
 
CamerasetOrientation (const glm::quat &orientation)
 
const glm::vec3 & getViewDirection () const
 
GLfloat getCenterDist () const
 
virtual CamerasetMatrix (const glm::mat4 &matrix)
 
virtual Cameratranslate (glm::vec3 translation)
 
virtual CamerarotateRad (GLfloat angleRad, glm::vec3 axis)
 
virtual Camerarotate (GLfloat angleDeg, glm::vec3 axis)
 
virtual Camerascale (glm::vec3 scaling)
 
Cameradolly (GLfloat distance)
 
CamerarotateAzimuthRad (GLfloat angleRad)
 
CamerarotateAzimuth (GLfloat angleDeg)
 
CamerarotateElevationRad (GLfloat angleRad)
 
CamerarotateElevation (GLfloat angleDeg)
 
CamerarotatePitchRad (GLfloat angleRad)
 
CamerarotatePitch (GLfloat angleDeg)
 
CamerarotateRollRad (GLfloat angleRad)
 
CamerarotateRoll (GLfloat angleDeg)
 
CamerarotateYawRad (GLfloat angleRad)
 
CamerarotateYaw (GLfloat angleDeg)
 
bool isDrawCenter () const
 
CamerasetDrawCenter (bool isDrawCenter)
 
void accept (Traverser *traverser)
 
virtual void acceptPost (Traverser *traverser)
 
virtual void render (RenderState *renderState)
 
virtual void renderPost (RenderState *renderState)
 
- Public Member Functions inherited from scg::Transformation
 Transformation ()
 
virtual ~Transformation ()
 
const glm::mat4 & getMatrix () const
 
- Public Member Functions inherited from scg::Composite
 Composite ()
 
virtual ~Composite ()=0
 
virtual void destroy ()
 
CompositeaddChild (NodeSP child)
 
CompositeremoveChild (Node *node, bool &result)
 
CompositeremoveChild (Node *node)
 
virtual void traverse (Traverser *traverser)
 
- Public Member Functions inherited from scg::Node
 Node ()
 
virtual ~Node ()=0
 
virtual void clear ()
 
int getNCores () const
 
const std::string & getMetaInfo (const std::string &key) const
 
void setMetaInfo (const std::string &key, const std::string &value)
 
bool isVisible () const
 
void setVisible (bool isVisible=true)
 

Static Public Member Functions

static OrthographicCameraSP create ()
 
- Static Public Member Functions inherited from scg::Transformation
static TransformationSP create ()
 

Protected Attributes

GLfloat left_
 
GLfloat right_
 
GLfloat bottom_
 
GLfloat top_
 
GLfloat near_
 
GLfloat far_
 
- Protected Attributes inherited from scg::Camera
glm::mat4 projection_
 
glm::mat4 viewTransform_
 
glm::vec3 eyePt_
 
glm::vec3 centerPt_
 
GLfloat centerDist_
 
glm::vec3 viewDir_
 
glm::vec3 upDir_
 
glm::vec3 rightDir_
 
glm::quat orientation_
 
bool isDrawCenter_
 
- Protected Attributes inherited from scg::Transformation
glm::mat4 matrix_
 
- Protected Attributes inherited from scg::Composite
NodeSP leftChild_
 
- Protected Attributes inherited from scg::Node
NodeSP rightSibling_
 
Compositeparent_
 
std::vector< CoreSPcores_
 
bool isVisible_
 
std::unordered_map< std::string, std::string > metaInfo_
 

Additional Inherited Members

- Protected Member Functions inherited from scg::Camera
virtual void update_ ()
 
- Protected Member Functions inherited from scg::Node
void addSibling_ (NodeSP sibling)
 
void removeSibling_ (Node *node, bool &result)
 
void processCores_ (RenderState *renderState)
 
void postProcessCores_ (RenderState *renderState)
 

Detailed Description

A camera with orthographic projection(composite node).

See Camera base class for further information.

Initial parameters:

  • left border: -1.0
  • right border: 1.0
  • bottom border: -1.0
  • top border: 1.0
  • near distance: -1.0
  • far distance: 1.0

Definition at line 47 of file OrthographicCamera.h.

Constructor & Destructor Documentation

◆ OrthographicCamera()

scg::OrthographicCamera::OrthographicCamera ( )

◆ ~OrthographicCamera()

virtual scg::OrthographicCamera::~OrthographicCamera ( )
virtual

Member Function Documentation

◆ create()

static OrthographicCameraSP scg::OrthographicCamera::create ( )
static

Create shared pointer.

◆ init()

void scg::OrthographicCamera::init ( GLfloat  left,
GLfloat  right,
GLfloat  bottom,
GLfloat  top,
GLfloat  near,
GLfloat  far 
)

Initialize orthographic projection. Aspect ratio is determined in updateProjection() from current viewport dimensions, left and right borders are adjusted to comply with aspect ratio.

Parameters
leftleft border
rightright border
bottombottom border
toptop border
nearnear distance
farfar distance

◆ updateProjection()

virtual void scg::OrthographicCamera::updateProjection ( )
virtual

Update projection matrix from current viewport dimensions, called by Renderer::render() (or derived class) if window has been resized.

Implements scg::Camera.

Member Data Documentation

◆ bottom_

GLfloat scg::OrthographicCamera::bottom_
protected

Definition at line 85 of file OrthographicCamera.h.

◆ far_

GLfloat scg::OrthographicCamera::far_
protected

Definition at line 88 of file OrthographicCamera.h.

◆ left_

GLfloat scg::OrthographicCamera::left_
protected

Definition at line 83 of file OrthographicCamera.h.

◆ near_

GLfloat scg::OrthographicCamera::near_
protected

Definition at line 87 of file OrthographicCamera.h.

◆ right_

GLfloat scg::OrthographicCamera::right_
protected

Definition at line 84 of file OrthographicCamera.h.

◆ top_

GLfloat scg::OrthographicCamera::top_
protected

Definition at line 86 of file OrthographicCamera.h.


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