Castor3D 0.16.0
Multiplatform 3D engine
|
#include <Camera.hpp>
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 |
Viewport & | getViewport () |
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 |
HdrConfig & | getHdrConfig () |
ColourGradingConfig const & | getColourGradingConfig () const noexcept |
ColourGradingConfig & | getColourGradingConfig () 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 |
SceneNode * | getParent () 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 |
SceneNode * | m_sceneNode {} |
OnSceneNodeChangedConnection | m_notifyIndex |
Protected Attributes inherited from castor::NamedBaseT< T > | |
T | m_name |
C3D_API castor3d::Camera::Camera | ( | castor::String const & | name, |
Scene & | scene, | ||
SceneNode & | node, | ||
Viewport | viewport, | ||
bool | ownProjMtx = false ) |
Constructor.
[in] | name | The camera name. |
[in] | scene | The parent scene. |
[in] | node | The parent scene node. |
[in] | viewport | Viewport to copy. |
[in] | ownProjMtx | Tells if the projection matrix is held by the viewport false , or not true . |
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.
[in] | name | The camera name. |
[in] | scene | The parent scene. |
[in] | node | The parent scene node. |
[in] | ownProjMtx | Tells if the projection matrix is held by the viewport false , or not true . |
|
inlinenoexcept |
|
inlinenoexcept |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
References castor3d::Viewport::getProjection(), and castor3d::Viewport::getSafeBandedProjection().
|
inline |
|
inline |
C3D_API castor::Matrix4x4f castor3d::Camera::getRescaledProjection | ( | float | scale, |
bool | safeBanded ) const |
name Getters.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
C3D_API bool castor3d::Camera::isVisible | ( | Geometry const & | geometry, |
Submesh const & | submesh ) const |
Checks if a submesh is visible, through a geometry.
[in] | geometry | The geometry. |
[in] | submesh | The submesh. |
false
if the submesh is not visible.
|
inline |
References castor3d::Viewport::getSize(), castor3d::MovableObject::markDirty(), and castor3d::Viewport::resize().
|
inline |
|
inlinenoexcept |
|
inline |
C3D_API void castor3d::Camera::setProjection | ( | castor::Matrix4x4f const & | projection | ) |
Sets the projection matrix, updates the viewport and the frustum.
[in] | projection | The projection matrix. |
|
inline |
name Mutators.
References castor3d::MovableObject::markDirty().
|
inline |
References castor3d::MovableObject::markDirty(), and castor3d::Viewport::updateType().
C3D_API void castor3d::Camera::update | ( | ) |
Updates the viewport, the view matrix, and the frustum.
C3D_API void castor3d::Camera::updateFrustum | ( | ) |
Updates the frustum.
|
friend |
|
mutable |
The signal raised when the camera has changed.