Lugdunum  0.1.0
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
lug::Graphics::Render::Camera::Camera Class Referenceabstract

Class for camera. More...

#include <Camera.hpp>

Inheritance diagram for lug::Graphics::Render::Camera::Camera:
[legend]
Collaboration diagram for lug::Graphics::Render::Camera::Camera:
[legend]

Public Member Functions

 Camera (const Camera &)=delete
 
 Camera (Camera &&)=delete
 
Cameraoperator= (const Camera &)=delete
 
Cameraoperator= (Camera &&)=delete
 
virtual ~Camera ()=default
 
void setZNear (float znear)
 Sets the znear (distance of near plane). More...
 
float getZNear () const
 Gets the znear (distance of near plane). More...
 
void setZFar (float zfar)
 Sets the zfar (distance of far plane). More...
 
float getZFar () const
 Gets the zfar (distance of far plane) More...
 
const Math::Mat4x4f & getProjectionMatrix ()
 Gets the projection matrix. Computes it if needed, but internally the projection matrix is cached. More...
 
const Math::Mat4x4f & getViewMatrix ()
 Gets the view matrix. Computes it if needed, but internally the view matrix is cached. More...
 
void update (const Renderer &renderer, const View &renderView, Queue &renderQueue)
 Update the render queue of the Camera by fetching the visible objects of the attached scene. More...
 
void setRenderView (View *renderView)
 
Scene::NodegetParent () const
 
void setParent (Scene::Node *parent)
 
void needUpdateProj ()
 
void needUpdateView ()
 
void lookAt (const Math::Vec3f &targetPosition, const Math::Vec3f &up, Node::TransformSpace space=Node::TransformSpace::Local)
 
- Public Member Functions inherited from lug::Graphics::Resource
 Resource (Type type, const std::string &name)
 
 Resource (const Resource &)=delete
 
 Resource (Resource &&)=delete
 
Resourceoperator= (const Resource &)=delete
 
Resourceoperator= (Resource &&)=delete
 
virtual ~Resource ()=default
 
Type getType () const
 Returns the type of the Resource. More...
 
Handle getHandle () const
 Returns the handle of the Resource. More...
 
const std::string & getName () const
 Gets the name of the Resource. More...
 
void setName (const std::string &name)
 Sets the name of the Resource. More...
 
- Public Member Functions inherited from lug::Graphics::Render::DirtyObject
 DirtyObject ()=default
 
 DirtyObject (const DirtyObject &)=delete
 
 DirtyObject (DirtyObject &&)=delete
 
DirtyObjectoperator= (const DirtyObject &)=delete
 
DirtyObjectoperator= (DirtyObject &&)=delete
 
 ~DirtyObject ()=default
 
void setDirty ()
 
void setDirty (uint32_t currentFrame)
 
void clearDirty ()
 
void clearDirty (uint32_t currentFrame)
 
bool isDirty (uint32_t currentFrame) const
 
bool isDirty () const
 

Protected Member Functions

 Camera (const std::string &name)
 
virtual void updateProj ()=0
 
void updateView ()
 

Protected Attributes

Scene::Node_parent {nullptr}
 
View_renderView {nullptr}
 
float _znear {0.1f}
 
float _zfar {100.0f}
 
bool _needUpdateProj {true}
 
bool _needUpdateView {true}
 
Math::Mat4x4f _projMatrix {Math::Mat4x4f::identity()}
 
Math::Mat4x4f _viewMatrix {Math::Mat4x4f::identity()}
 
- Protected Attributes inherited from lug::Graphics::Resource
std::string _name
 

Additional Inherited Members

- Public Types inherited from lug::Graphics::Resource
enum  Type : uint8_t {
  Type::Scene, Type::SceneNode, Type::Material, Type::Mesh,
  Type::Light, Type::Texture, Type::Pipeline, Type::Camera,
  Type::SkyBox
}
 Type of the resource. More...
 

Detailed Description

Class for camera.

This class represents a Camera in the 3D engine. A Camera can be attached to only one Render::View and one Scene::Node.

Definition at line 30 of file Camera.hpp.

Constructor & Destructor Documentation

◆ Camera() [1/3]

lug::Graphics::Render::Camera::Camera::Camera ( const Camera )
delete

◆ Camera() [2/3]

lug::Graphics::Render::Camera::Camera::Camera ( Camera &&  )
delete

◆ ~Camera()

virtual lug::Graphics::Render::Camera::Camera::~Camera ( )
virtualdefault

◆ Camera() [3/3]

lug::Graphics::Render::Camera::Camera::Camera ( const std::string &  name)
explicitprotected

Definition at line 12 of file Camera.cpp.

Member Function Documentation

◆ operator=() [1/2]

Camera& lug::Graphics::Render::Camera::Camera::operator= ( const Camera )
delete

◆ operator=() [2/2]

Camera& lug::Graphics::Render::Camera::Camera::operator= ( Camera &&  )
delete

◆ setZNear()

void Camera::setZNear ( float  znear)
inline

Sets the znear (distance of near plane).

Parameters
[in]znearThe near value.

Definition at line 29 of file Camera.inl.

◆ getZNear()

float Camera::getZNear ( ) const
inline

Gets the znear (distance of near plane).

Returns
The near value.

Definition at line 10 of file Camera.inl.

◆ setZFar()

void Camera::setZFar ( float  zfar)
inline

Sets the zfar (distance of far plane).

Parameters
[in]zfarThe far value.

Definition at line 33 of file Camera.inl.

◆ getZFar()

float Camera::getZFar ( ) const
inline

Gets the zfar (distance of far plane)

Returns
The zfar value.

Definition at line 1 of file Camera.inl.

◆ getProjectionMatrix()

const Math::Mat4x4f & Camera::getProjectionMatrix ( )
inline

Gets the projection matrix. Computes it if needed, but internally the projection matrix is cached.

Returns
The projection matrix.

Definition at line 33 of file Camera.inl.

◆ getViewMatrix()

const Math::Mat4x4f & Camera::getViewMatrix ( )
inline

Gets the view matrix. Computes it if needed, but internally the view matrix is cached.

Returns
The view matrix.

Definition at line 41 of file Camera.inl.

◆ update()

void lug::Graphics::Render::Camera::Camera::update ( const Renderer renderer,
const View renderView,
Queue renderQueue 
)

Update the render queue of the Camera by fetching the visible objects of the attached scene.

Parameters
[in]rendererThe renderer
[in]renderViewThe render view
[in]renderQueueThe render queue

Definition at line 22 of file Camera.cpp.

◆ setRenderView()

void Camera::setRenderView ( View renderView)
inline

Definition at line 19 of file Camera.inl.

◆ getParent()

Scene::Node * Camera::getParent ( ) const
inline

Definition at line 24 of file Camera.inl.

◆ setParent()

void Camera::setParent ( Scene::Node parent)
inline

Definition at line 28 of file Camera.inl.

◆ needUpdateProj()

void Camera::needUpdateProj ( )
inline

Definition at line 49 of file Camera.inl.

◆ needUpdateView()

void Camera::needUpdateView ( )
inline

Definition at line 54 of file Camera.inl.

◆ lookAt()

void lug::Graphics::Render::Camera::Camera::lookAt ( const Math::Vec3f &  targetPosition,
const Math::Vec3f &  up,
Node::TransformSpace  space = Node::TransformSpace::Local 
)

Definition at line 14 of file Camera.cpp.

◆ updateProj()

virtual void lug::Graphics::Render::Camera::Camera::updateProj ( )
protectedpure virtual

◆ updateView()

void lug::Graphics::Render::Camera::Camera::updateView ( )
protected

Definition at line 28 of file Camera.cpp.

Member Data Documentation

◆ _parent

Scene::Node* lug::Graphics::Render::Camera::Camera::_parent {nullptr}
protected

Definition at line 111 of file Camera.hpp.

◆ _renderView

View* lug::Graphics::Render::Camera::Camera::_renderView {nullptr}
protected

Definition at line 113 of file Camera.hpp.

◆ _znear

float lug::Graphics::Render::Camera::Camera::_znear {0.1f}
protected

Definition at line 115 of file Camera.hpp.

◆ _zfar

float lug::Graphics::Render::Camera::Camera::_zfar {100.0f}
protected

Definition at line 116 of file Camera.hpp.

◆ _needUpdateProj

bool lug::Graphics::Render::Camera::Camera::_needUpdateProj {true}
protected

Definition at line 118 of file Camera.hpp.

◆ _needUpdateView

bool lug::Graphics::Render::Camera::Camera::_needUpdateView {true}
protected

Definition at line 119 of file Camera.hpp.

◆ _projMatrix

Math::Mat4x4f lug::Graphics::Render::Camera::Camera::_projMatrix {Math::Mat4x4f::identity()}
protected

Definition at line 121 of file Camera.hpp.

◆ _viewMatrix

Math::Mat4x4f lug::Graphics::Render::Camera::Camera::_viewMatrix {Math::Mat4x4f::identity()}
protected

Definition at line 122 of file Camera.hpp.


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