Castor3D 0.12.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. More...
 
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. More...
 
C3D_API void attachTo (SceneNode &node) override
 Attaches this light to a Material. More...
 
C3D_API void updateFrustum ()
 Updates the frustum. More...
 
C3D_API void update ()
 Updates the viewport, the view matrix, and the frustum. More...
 
C3D_API void setProjection (castor::Matrix4x4f const &projection)
 Sets the projection matrix, updates the viewport and the frustum. More...
 
C3D_API bool isVisible (Geometry const &geometry, Submesh const &submesh) const
 Checks if a submesh is visible, through a geometry. More...
 
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 ()
 
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 setExposure (float value)
 
void setGamma (float value)
 
- Public Member Functions inherited from castor3d::MovableObject
C3D_API MovableObject (castor::String const &name, Scene &scene, MovableType type, SceneNode &node)
 Constructor. More...
 
C3D_API MovableObject (castor::String const &name, Scene &scene, MovableType type)
 Constructor. More...
 
virtual C3D_API ~MovableObject ()
 Destructor. More...
 
C3D_API void detach ()
 Detaches the movable object from it's parent. More...
 
virtual C3D_API void attachTo (SceneNode &node)
 Attaches the movable object to a node. More...
 
C3D_API EngineRPtr getEngine () const
 
SceneNodegetParent () const
 
MovableType getType () const
 

Public Attributes

OnCameraChanged onChanged
 

Friends

class Scene
 

Additional Inherited Members

- Protected Attributes inherited from castor3d::MovableObject
MovableType m_type
 
castor::String m_strNodeName
 
SceneNodem_sceneNode
 
OnSceneNodeChangedConnection m_notifyIndex
 

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

◆ attachTo()

C3D_API void castor3d::Camera::attachTo ( SceneNode node)
overridevirtual

Attaches this light to a Material.

Parameters
[in]nodeThe new light's parent node

Reimplemented from castor3d::MovableObject.

◆ 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:

◆ 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

name Getters.

◆ 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(), onChanged, 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:

◆ setExposure()

void castor3d::Camera::setExposure ( float  value)
inline

◆ setGamma()

void castor3d::Camera::setGamma ( float  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 onChanged.

◆ setViewportType()

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

References onChanged, 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 Function Documentation

◆ Scene

friend class Scene
friend

Member Data Documentation

◆ onChanged

OnCameraChanged castor3d::Camera::onChanged
mutable

The signal raised when the camera has changed.

Referenced by resize(), setExposure(), setGamma(), setView(), and setViewportType().


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