scg3  0.6
scg::PerspectiveCamera Class Reference

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

#include "PerspectiveCamera.h"

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

Public Member Functions

 PerspectiveCamera ()
 
virtual ~PerspectiveCamera ()
 
void init (GLfloat fovyDeg, 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
 
Camera * setPosition (const glm::vec3 &position)
 
const glm::quat & getOrientation () const
 
Camera * setOrientation (const glm::quat &orientation)
 
const glm::vec3 & getViewDirection () const
 
GLfloat getCenterDist () const
 
virtual Camera * setMatrix (const glm::mat4 &matrix)
 
virtual Camera * translate (glm::vec3 translation)
 
virtual Camera * rotateRad (GLfloat angleRad, glm::vec3 axis)
 
virtual Camera * rotate (GLfloat angleDeg, glm::vec3 axis)
 
virtual Camera * scale (glm::vec3 scaling)
 
Camera * dolly (GLfloat distance)
 
Camera * rotateAzimuthRad (GLfloat angleRad)
 
Camera * rotateAzimuth (GLfloat angleDeg)
 
Camera * rotateElevationRad (GLfloat angleRad)
 
Camera * rotateElevation (GLfloat angleDeg)
 
Camera * rotatePitchRad (GLfloat angleRad)
 
Camera * rotatePitch (GLfloat angleDeg)
 
Camera * rotateRollRad (GLfloat angleRad)
 
Camera * rotateRoll (GLfloat angleDeg)
 
Camera * rotateYawRad (GLfloat angleRad)
 
Camera * rotateYaw (GLfloat angleDeg)
 
bool isDrawCenter () const
 
Camera * setDrawCenter (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 ()
 
Composite * addChild (NodeSP child)
 
Composite * removeChild (Node *node, bool &result)
 
Composite * removeChild (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 PerspectiveCameraSP create ()
 
- Static Public Member Functions inherited from scg::Transformation
static TransformationSP create ()
 

Protected Attributes

GLfloat fovyRad_
 
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_
 
Composite * parent_
 
std::vector< CoreSP > cores_
 
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 perspective projection (composite node).

See Camera base class for further information.

Initial parameters:

  • vertical field of view: 60 deg
  • near distance: 0.01
  • far distance: 1000.0

Definition at line 44 of file PerspectiveCamera.h.

Constructor & Destructor Documentation

◆ PerspectiveCamera()

scg::PerspectiveCamera::PerspectiveCamera ( )

Constructor.

◆ ~PerspectiveCamera()

virtual scg::PerspectiveCamera::~PerspectiveCamera ( )
virtual

Destructor.

Member Function Documentation

◆ create()

static PerspectiveCameraSP scg::PerspectiveCamera::create ( )
static

Create shared pointer.

Examples
scg3_table_scene_example.cpp.

◆ init()

void scg::PerspectiveCamera::init ( GLfloat  fovyDeg,
GLfloat  near,
GLfloat  far 
)

Initialize perspective projection. Aspect ratio is determined in updateProjection() from current viewport dimensions.

Parameters
fovyDegvertical field of view angle (degrees)
nearnear distance
farfar distance

◆ updateProjection()

virtual void scg::PerspectiveCamera::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

◆ far_

GLfloat scg::PerspectiveCamera::far_
protected

Definition at line 83 of file PerspectiveCamera.h.

◆ fovyRad_

GLfloat scg::PerspectiveCamera::fovyRad_
protected

Definition at line 81 of file PerspectiveCamera.h.

◆ near_

GLfloat scg::PerspectiveCamera::near_
protected

Definition at line 82 of file PerspectiveCamera.h.


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