Castor3D 0.16.0
Multiplatform 3D engine
Public Member Functions | Public Attributes | Friends | List of all members
castor3d::Camera Class Reference

#include <Camera.hpp>

Inheritance diagram for castor3d::Camera:
Inheritance graph
[legend]
Collaboration diagram for castor3d::Camera:
Collaboration graph
[legend]

Public Member Functions

C3D_API Camera (castor::String const &name, Scene &scene, SceneNode &node, Viewport viewport, bool ownProjMtx=false)
 Constructor.
 
C3D_API Camera (castor::String const &name, Scene &scene, SceneNode &node, bool ownProjMtx=false)
 Constructor, needs the camera renderer, the name, window size and projection type. Creates a viewport renderer and a viewport.
 
C3D_API void updateFrustum ()
 Updates the frustum.
 
C3D_API void update ()
 Updates the viewport, the view matrix, and the frustum.
 
C3D_API void setProjection (castor::Matrix4x4f const &projection)
 Sets the projection matrix, updates the viewport and the frustum.
 
C3D_API bool isVisible (Geometry const &geometry, Submesh const &submesh) const
 Checks if a submesh is visible, through a geometry.
 
C3D_API castor::Matrix4x4f getRescaledProjection (float scale, bool safeBanded) const
 
Viewport const & getViewport () const
 
ViewportgetViewport ()
 
castor::Matrix4x4f const & getView () const
 
castor::Matrix4x4f const & getProjection (bool safeBanded) const
 
ViewportType getViewportType () const
 
castor::Size const & getSize () const
 
uint32_t getWidth () const
 
uint32_t getHeight () const
 
float getNear () const
 
float getFar () const
 
float getRatio () const
 
castor::Angle const & getFovY () const
 
float getProjectionScale () const
 
bool isVisible (castor::BoundingBox const &box, castor::Matrix4x4f const &transformations) const
 
bool isVisible (castor::BoundingSphere const &sphere, castor::Matrix4x4f const &transformations, castor::Point3f const &scale) const
 
bool isVisible (castor::Point3f const &point) const
 
Frustum const & getFrustum () const
 
HdrConfig const & getHdrConfig () const
 
HdrConfiggetHdrConfig ()
 
ColourGradingConfig const & getColourGradingConfig () const noexcept
 
ColourGradingConfiggetColourGradingConfig () noexcept
 
void setView (castor::Matrix4x4f const &view)
 
void resize (uint32_t width, uint32_t height)
 
void resize (castor::Size const &size)
 
void setViewportType (ViewportType value)
 
void setHdrConfig (HdrConfig value)
 
void setColourGradingConfig (ColourGradingConfig config) noexcept
 
- Public Member Functions inherited from castor3d::MovableObject
C3D_API MovableObject (castor::String const &name, Scene &scene, MovableType type, SceneNode &node)
 Constructor.
 
C3D_API MovableObject (castor::String const &name, Scene &scene, MovableType type)
 Constructor.
 
virtual C3D_API ~MovableObject () noexcept
 Destructor.
 
C3D_API void detach ()
 Detaches the movable object from it's parent.
 
virtual C3D_API void attachTo (SceneNode &node)
 Attaches the movable object to a node.
 
C3D_API void markDirty ()
 Adds the object to dirty object list in the scene.
 
C3D_API EngineRPtr getEngine () const noexcept
 
SceneNodegetParent () const noexcept
 
MovableType getMovableType () const noexcept
 
- Public Member Functions inherited from castor::OwnedBy< Scene >
Scene * getOwner () const
 
- Public Member Functions inherited from castor::NamedBaseT< T >
 NamedBaseT (T name) noexcept
 Constructor.
 
T const & getName () const noexcept
 Retrieves the name.
 
void rename (T name) noexcept
 

Public Attributes

OnCameraChanged onGpuChanged
 

Friends

class Scene
 

Additional Inherited Members

- Protected Member Functions inherited from castor::OwnedBy< Scene >
 OwnedBy (Scene &owner)
 Constructor.
 
- Protected Attributes inherited from castor3d::MovableObject
MovableType m_type
 
SceneNodem_sceneNode {}
 
OnSceneNodeChangedConnection m_notifyIndex
 
- Protected Attributes inherited from castor::NamedBaseT< T >
m_name
 

Constructor & Destructor Documentation

◆ Camera() [1/2]

C3D_API castor3d::Camera::Camera ( castor::String const & name,
Scene & scene,
SceneNode & node,
Viewport viewport,
bool ownProjMtx = false )

Constructor.

Parameters
[in]nameThe camera name.
[in]sceneThe parent scene.
[in]nodeThe parent scene node.
[in]viewportViewport to copy.
[in]ownProjMtxTells if the projection matrix is held by the viewport false, or not true.

◆ Camera() [2/2]

C3D_API castor3d::Camera::Camera ( castor::String const & name,
Scene & scene,
SceneNode & node,
bool ownProjMtx = false )

Constructor, needs the camera renderer, the name, window size and projection type. Creates a viewport renderer and a viewport.

Parameters
[in]nameThe camera name.
[in]sceneThe parent scene.
[in]nodeThe parent scene node.
[in]ownProjMtxTells if the projection matrix is held by the viewport false, or not true.

Member Function Documentation

◆ getColourGradingConfig() [1/2]

ColourGradingConfig const & castor3d::Camera::getColourGradingConfig ( ) const
inlinenoexcept

◆ getColourGradingConfig() [2/2]

ColourGradingConfig & castor3d::Camera::getColourGradingConfig ( )
inlinenoexcept

◆ getFar()

float castor3d::Camera::getFar ( ) const
inline

References castor3d::Viewport::getFar().

Here is the call graph for this function:

◆ getFovY()

castor::Angle const & castor3d::Camera::getFovY ( ) const
inline

References castor3d::Viewport::getFovY().

Here is the call graph for this function:

◆ getFrustum()

Frustum const & castor3d::Camera::getFrustum ( ) const
inline

◆ getHdrConfig() [1/2]

HdrConfig & castor3d::Camera::getHdrConfig ( )
inline

◆ getHdrConfig() [2/2]

HdrConfig const & castor3d::Camera::getHdrConfig ( ) const
inline

◆ getHeight()

uint32_t castor3d::Camera::getHeight ( ) const
inline

References castor3d::Viewport::getHeight().

Here is the call graph for this function:

◆ getNear()

float castor3d::Camera::getNear ( ) const
inline

References castor3d::Viewport::getNear().

Here is the call graph for this function:

◆ getProjection()

castor::Matrix4x4f const & castor3d::Camera::getProjection ( bool safeBanded) const
inline

References castor3d::Viewport::getProjection(), and castor3d::Viewport::getSafeBandedProjection().

Here is the call graph for this function:

◆ getProjectionScale()

float castor3d::Camera::getProjectionScale ( ) const
inline

References castor3d::Viewport::getProjectionScale().

Here is the call graph for this function:

◆ getRatio()

float castor3d::Camera::getRatio ( ) const
inline

References castor3d::Viewport::getRatio().

Here is the call graph for this function:

◆ getRescaledProjection()

C3D_API castor::Matrix4x4f castor3d::Camera::getRescaledProjection ( float scale,
bool safeBanded ) const

name Getters.

◆ getSize()

castor::Size const & castor3d::Camera::getSize ( ) const
inline

References castor3d::Viewport::getSize().

Here is the call graph for this function:

◆ getView()

castor::Matrix4x4f const & castor3d::Camera::getView ( ) const
inline

◆ getViewport() [1/2]

Viewport & castor3d::Camera::getViewport ( )
inline

◆ getViewport() [2/2]

Viewport const & castor3d::Camera::getViewport ( ) const
inline

◆ getViewportType()

ViewportType castor3d::Camera::getViewportType ( ) const
inline

References castor3d::Viewport::getType().

Here is the call graph for this function:

◆ getWidth()

uint32_t castor3d::Camera::getWidth ( ) const
inline

References castor3d::Viewport::getWidth().

Here is the call graph for this function:

◆ isVisible() [1/4]

bool castor3d::Camera::isVisible ( castor::BoundingBox const & box,
castor::Matrix4x4f const & transformations ) const
inline

References castor3d::Frustum::isVisible().

Here is the call graph for this function:

◆ isVisible() [2/4]

bool castor3d::Camera::isVisible ( castor::BoundingSphere const & sphere,
castor::Matrix4x4f const & transformations,
castor::Point3f const & scale ) const
inline

References castor3d::Frustum::isVisible().

Here is the call graph for this function:

◆ isVisible() [3/4]

bool castor3d::Camera::isVisible ( castor::Point3f const & point) const
inline

References castor3d::Frustum::isVisible().

Here is the call graph for this function:

◆ isVisible() [4/4]

C3D_API bool castor3d::Camera::isVisible ( Geometry const & geometry,
Submesh const & submesh ) const

Checks if a submesh is visible, through a geometry.

Parameters
[in]geometryThe geometry.
[in]submeshThe submesh.
Returns
false if the submesh is not visible.

◆ resize() [1/2]

void castor3d::Camera::resize ( castor::Size const & size)
inline

References castor3d::Viewport::getSize(), castor3d::MovableObject::markDirty(), and castor3d::Viewport::resize().

Here is the call graph for this function:

◆ resize() [2/2]

void castor3d::Camera::resize ( uint32_t width,
uint32_t height )
inline

References resize().

Referenced by resize().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setColourGradingConfig()

void castor3d::Camera::setColourGradingConfig ( ColourGradingConfig config)
inlinenoexcept

◆ setHdrConfig()

void castor3d::Camera::setHdrConfig ( HdrConfig value)
inline

◆ setProjection()

C3D_API void castor3d::Camera::setProjection ( castor::Matrix4x4f const & projection)

Sets the projection matrix, updates the viewport and the frustum.

Parameters
[in]projectionThe projection matrix.

◆ setView()

void castor3d::Camera::setView ( castor::Matrix4x4f const & view)
inline

name Mutators.

References castor3d::MovableObject::markDirty().

Here is the call graph for this function:

◆ setViewportType()

void castor3d::Camera::setViewportType ( ViewportType value)
inline

References castor3d::MovableObject::markDirty(), and castor3d::Viewport::updateType().

Here is the call graph for this function:

◆ update()

C3D_API void castor3d::Camera::update ( )

Updates the viewport, the view matrix, and the frustum.

◆ updateFrustum()

C3D_API void castor3d::Camera::updateFrustum ( )

Updates the frustum.

Friends And Related Symbol Documentation

◆ Scene

friend class Scene
friend

Member Data Documentation

◆ onGpuChanged

OnCameraChanged castor3d::Camera::onGpuChanged
mutable

The signal raised when the camera has changed.


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