PGR Copakond OpenGL Engine - Bowling
Loading...
Searching...
No Matches
copakond::Camera Class Reference

Camera for generating view and projection matrices. More...

#include <camera.h>

Inheritance diagram for copakond::Camera:
copakond::Geometry

Public Member Functions

 Camera (const glm::vec3 &startPosition, const glm::vec3 &startLookPoint, float distance)
void lookToPoint (const glm::vec3 &point)
 Orients the camera to look directly at a specific world coordinate.
void setRotation (const glm::vec3 &rotation) override
void setRotationDegrees (const glm::vec3 &rotationDegrees) override
void addFov (float fov)
glm::mat4 getViewMatrix ()
glm::mat4 getProjectionMatrix (float aspectWidth, float aspectHeight)
 Generates perspective projection matrix.
glm::vec3 getPosition () const
glm::vec3 & position ()
glm::vec3 & rotation ()
void processKeyboard (int direction, float deltaTime)
 Processes keyboard movement input.
void processMouseMovement (float deltaX, float deltaY)
void processMouseDrag (float deltaX, float deltaY)
void setFog (const Fog &fog)
Fog getFog () const
Public Member Functions inherited from copakond::Geometry
 Geometry ()
 Geometry (const glm::vec3 &position)
 Geometry (const glm::vec3 &position, const glm::vec3 &rotation)
 Geometry (const glm::vec3 &position, const glm::vec3 &rotation, const glm::vec3 &scale)
virtual ~Geometry ()
virtual void setPosition (const glm::vec3 &position)
virtual void setScale (const glm::vec3 &scale)
glm::mat4 getRotationXMatrix () const
glm::mat4 getRotationYMatrix () const
glm::mat4 getRotationZMatrix () const
glm::mat4 getPositionMatrix () const
glm::mat4 getRotationMatrix () const
glm::mat4 getScaleMatrix () const
glm::mat4 getModelMatrix () const
 Calculates local transformation matrix.
glm::mat4 getWorldPositionMatrix () const
glm::mat4 getWorldRotationMatrix () const
glm::mat4 getWorldScaleMatrix () const
glm::mat4 getWorldModelMatrix () const
 Calculates global transformation matrix by multiplying all ancestor matrices.
glm::vec3 getPosition () const
glm::vec3 getRotation () const
glm::vec3 getScale () const
glm::vec3 getRotationDegrees () const
glm::vec3 getWorldPosition () const
glm::vec3 getWorldRotation () const
glm::vec3 getWorldScale () const
glm::vec3 & position ()
glm::vec3 & rotation ()
glm::vec3 & scale ()
glm::vec3 worldPosition () const
glm::vec3 worldRotation () const
glm::vec3 worldScale () const
bool setParent (Geometry *newParent)
 Attaches this object to a new parent in the scene graph.
GeometrygetParent () const
std::vector< Geometry * > getChildren () const

Additional Inherited Members

Protected Attributes inherited from copakond::Geometry
Geometryparent = nullptr
std::vector< Geometry * > children
glm::vec3 _position
glm::vec3 _rotation
glm::vec3 _scale

Detailed Description

Camera for generating view and projection matrices.

Constructor & Destructor Documentation

◆ Camera()

copakond::Camera::Camera ( const glm::vec3 & startPosition,
const glm::vec3 & startLookPoint,
float distance )

Member Function Documentation

◆ addFov()

void copakond::Camera::addFov ( float fov)

◆ getFog()

Fog copakond::Camera::getFog ( ) const
inline

◆ getPosition()

glm::vec3 copakond::Camera::getPosition ( ) const
inline

◆ getProjectionMatrix()

glm::mat4 copakond::Camera::getProjectionMatrix ( float aspectWidth,
float aspectHeight )

Generates perspective projection matrix.

Parameters
aspectWidthWindow width.
aspectHeightWindow height.

◆ getViewMatrix()

glm::mat4 copakond::Camera::getViewMatrix ( )

◆ lookToPoint()

void copakond::Camera::lookToPoint ( const glm::vec3 & point)

Orients the camera to look directly at a specific world coordinate.

Parameters
pointTarget coordinates in world space.

◆ position()

glm::vec3 & copakond::Camera::position ( )
inline

◆ processKeyboard()

void copakond::Camera::processKeyboard ( int direction,
float deltaTime )

Processes keyboard movement input.

Parameters
directionPredefined movement macro (e.g., FRONT, BACK).
deltaTimeTime elapsed since last frame.

◆ processMouseDrag()

void copakond::Camera::processMouseDrag ( float deltaX,
float deltaY )

◆ processMouseMovement()

void copakond::Camera::processMouseMovement ( float deltaX,
float deltaY )

◆ rotation()

glm::vec3 & copakond::Camera::rotation ( )
inline

◆ setFog()

void copakond::Camera::setFog ( const Fog & fog)
inline

◆ setRotation()

void copakond::Camera::setRotation ( const glm::vec3 & rotation)
overridevirtual

Reimplemented from copakond::Geometry.

◆ setRotationDegrees()

void copakond::Camera::setRotationDegrees ( const glm::vec3 & rotationDegrees)
overridevirtual

Reimplemented from copakond::Geometry.


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