hx3d  1
2D/3D Simple Game Framework
Public Member Functions | Public Attributes | List of all members
hx3d::graphics::Camera Class Referenceabstract

2D/3D camera. More...

#include <camera.hpp>

Public Member Functions

 Camera (const float width, const float height, const float near, const float far)
 Create a camera with a viewport width and height. More...
 
void lookAt (glm::vec3 target)
 Look at target. More...
 
void translate (const glm::vec3 vec)
 Translate the camera. More...
 
void rotate (const float angle, const glm::vec3 axis)
 Rotate the camera on one/multiple axes. More...
 
void rotateAround (const glm::vec3 center, const float angle, const glm::vec3 axis)
 Rotate the camera around one point, on one/multiple axes. More...
 
virtual void update ()=0
 Update the camera.
 

Public Attributes

glm::vec3 position
 Camera position.
 
glm::vec3 direction
 Camera direction.
 
glm::vec3 up
 Camera up vector.
 
glm::mat4 projection
 Projection matrix.
 
glm::mat4 view
 View matrix.
 
float near
 Near pane.
 
float far
 Far pane.
 
float viewportWidth
 Viewport width.
 
float viewportHeight
 Viewport height.
 

Detailed Description

2D/3D camera.

See also
OrthographicCamera
PerspectiveCamera

Definition at line 41 of file camera.hpp.

Constructor & Destructor Documentation

hx3d::graphics::Camera::Camera ( const float  width,
const float  height,
const float  near,
const float  far 
)

Create a camera with a viewport width and height.

Parameters
widthViewport width
heightViewport height
nearNear
farFar

Definition at line 31 of file camera.cpp.

Member Function Documentation

void hx3d::graphics::Camera::lookAt ( glm::vec3  target)

Look at target.

Parameters
targetTarget

Definition at line 41 of file camera.cpp.

void hx3d::graphics::Camera::rotate ( const float  angle,
const glm::vec3  axis 
)

Rotate the camera on one/multiple axes.

Parameters
angleAngle in degrees
axisDirection(s)

Definition at line 71 of file camera.cpp.

void hx3d::graphics::Camera::rotateAround ( const glm::vec3  center,
const float  angle,
const glm::vec3  axis 
)

Rotate the camera around one point, on one/multiple axes.

Parameters
centerPoint
angleAngle in degrees
axisDirection(s)

Definition at line 76 of file camera.cpp.

void hx3d::graphics::Camera::translate ( const glm::vec3  vec)

Translate the camera.

Parameters
vecQuantity

Definition at line 67 of file camera.cpp.


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