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

#include <Viewport.hpp>

Public Member Functions

C3D_API Viewportoperator= (Viewport const &rhs)=delete
 
C3D_API Viewportoperator= (Viewport &&rhs) noexcept=delete
 
C3D_API Viewport (Viewport const &rhs)
 
C3D_API Viewport (Viewport &&rhs) noexcept
 
C3D_API ~Viewport () noexcept=default
 
C3D_API Viewport (Engine const &engine)
 Constructor.
 
C3D_API bool update ()
 Applies the perspective.
 
C3D_API void setPerspective (castor::Angle const &fovy, float aspect, float nearZ, float farZ)
 Builds a centered perspective viewport.
 
C3D_API void setInfinitePerspective (castor::Angle const &fovy, float aspect, float nearZ)
 Builds a centered perspective viewport with infinite far plane.
 
C3D_API void setFrustum (float left, float right, float bottom, float top, float nearZ, float farZ)
 Builds a matrix that Sets a non centered perspective projection from the given parameters.
 
C3D_API void setOrtho (float left, float right, float bottom, float top, float nearZ, float farZ)
 Builds a matrix that Sets an orthogonal projection.
 
C3D_API void resize (const castor::Size &value)
 Sets the viewport render size.
 
C3D_API float getProjectionScale () const
 
C3D_API castor::Matrix4x4f getRescaledProjection (float scale) const
 
C3D_API castor::Matrix4x4f getRescaledSafeBandedProjection (float scale) const
 
castor::Size const & getSize () const noexcept
 
castor::Position const & getPosition () const noexcept
 
ViewportType getType () const noexcept
 
float getRatio () const noexcept
 
float getNear () const noexcept
 
float getFar () const noexcept
 
castor::Angle const & getFovY () const noexcept
 
float getLeft () const noexcept
 
float getRight () const noexcept
 
float getTop () const noexcept
 
float getBottom () const noexcept
 
uint32_t getWidth () const noexcept
 
uint32_t getHeight () const noexcept
 
bool isModified () const noexcept
 
castor::Matrix4x4f const & getProjection () const noexcept
 
castor::Matrix4x4f const & getSafeBandedProjection () const noexcept
 
VkViewport const & getViewport () const noexcept
 
VkRect2D const & getScissor () const noexcept
 
Engine const & getEngine () const noexcept
 
void setPosition (castor::Position const &value) noexcept
 
void updateType (ViewportType value) noexcept
 
void updateRatio (float value) noexcept
 
void updateNear (float value) noexcept
 
void updateFar (float value) noexcept
 
void updateFovY (castor::Angle const &value) noexcept
 
void updateLeft (float value) noexcept
 
void updateRight (float value) noexcept
 
void updateTop (float value) noexcept
 
void updateBottom (float value) noexcept
 

Static Public Attributes

static C3D_API const castor::Array< castor::String, size_t(ViewportType::eCount) > TypeName
 

Constructor & Destructor Documentation

◆ Viewport() [1/3]

C3D_API castor3d::Viewport::Viewport ( Viewport const & rhs)

◆ Viewport() [2/3]

C3D_API castor3d::Viewport::Viewport ( Viewport && rhs)
noexcept

◆ ~Viewport()

C3D_API castor3d::Viewport::~Viewport ( )
defaultnoexcept

◆ Viewport() [3/3]

C3D_API castor3d::Viewport::Viewport ( Engine const & engine)
explicit

Constructor.

Parameters
[in]engineThe engine.

Member Function Documentation

◆ getBottom()

float castor3d::Viewport::getBottom ( ) const
inlinenoexcept

◆ getEngine()

Engine const & castor3d::Viewport::getEngine ( ) const
inlinenoexcept

◆ getFar()

float castor3d::Viewport::getFar ( ) const
inlinenoexcept

Referenced by castor3d::Camera::getFar().

Here is the caller graph for this function:

◆ getFovY()

castor::Angle const & castor3d::Viewport::getFovY ( ) const
inlinenoexcept

Referenced by castor3d::Camera::getFovY().

Here is the caller graph for this function:

◆ getHeight()

uint32_t castor3d::Viewport::getHeight ( ) const
inlinenoexcept

Referenced by castor3d::Camera::getHeight().

Here is the caller graph for this function:

◆ getLeft()

float castor3d::Viewport::getLeft ( ) const
inlinenoexcept

◆ getNear()

float castor3d::Viewport::getNear ( ) const
inlinenoexcept

Referenced by castor3d::Camera::getNear().

Here is the caller graph for this function:

◆ getPosition()

castor::Position const & castor3d::Viewport::getPosition ( ) const
inlinenoexcept

◆ getProjection()

castor::Matrix4x4f const & castor3d::Viewport::getProjection ( ) const
inlinenoexcept

Referenced by castor3d::Camera::getProjection().

Here is the caller graph for this function:

◆ getProjectionScale()

C3D_API float castor3d::Viewport::getProjectionScale ( ) const
Returns
The number of pixels per meter at z = -1.

Referenced by castor3d::Camera::getProjectionScale().

Here is the caller graph for this function:

◆ getRatio()

float castor3d::Viewport::getRatio ( ) const
inlinenoexcept

Referenced by castor3d::Camera::getRatio().

Here is the caller graph for this function:

◆ getRescaledProjection()

C3D_API castor::Matrix4x4f castor3d::Viewport::getRescaledProjection ( float scale) const

name Getters.

◆ getRescaledSafeBandedProjection()

C3D_API castor::Matrix4x4f castor3d::Viewport::getRescaledSafeBandedProjection ( float scale) const

◆ getRight()

float castor3d::Viewport::getRight ( ) const
inlinenoexcept

◆ getSafeBandedProjection()

castor::Matrix4x4f const & castor3d::Viewport::getSafeBandedProjection ( ) const
inlinenoexcept

Referenced by castor3d::Camera::getProjection().

Here is the caller graph for this function:

◆ getScissor()

VkRect2D const & castor3d::Viewport::getScissor ( ) const
inlinenoexcept

◆ getSize()

castor::Size const & castor3d::Viewport::getSize ( ) const
inlinenoexcept

Referenced by castor3d::Camera::getSize(), and castor3d::Camera::resize().

Here is the caller graph for this function:

◆ getTop()

float castor3d::Viewport::getTop ( ) const
inlinenoexcept

◆ getType()

ViewportType castor3d::Viewport::getType ( ) const
inlinenoexcept

Referenced by castor3d::Camera::getViewportType().

Here is the caller graph for this function:

◆ getViewport()

VkViewport const & castor3d::Viewport::getViewport ( ) const
inlinenoexcept

◆ getWidth()

uint32_t castor3d::Viewport::getWidth ( ) const
inlinenoexcept

Referenced by castor3d::Camera::getWidth().

Here is the caller graph for this function:

◆ isModified()

bool castor3d::Viewport::isModified ( ) const
inlinenoexcept

◆ operator=() [1/2]

C3D_API Viewport & castor3d::Viewport::operator= ( Viewport && rhs)
deletenoexcept

◆ operator=() [2/2]

C3D_API Viewport & castor3d::Viewport::operator= ( Viewport const & rhs)
delete

◆ resize()

C3D_API void castor3d::Viewport::resize ( const castor::Size & value)

Sets the viewport render size.

Parameters
[in]valueThe new value

Referenced by castor3d::Camera::resize().

Here is the caller graph for this function:

◆ setFrustum()

C3D_API void castor3d::Viewport::setFrustum ( float left,
float right,
float bottom,
float top,
float nearZ,
float farZ )

Builds a matrix that Sets a non centered perspective projection from the given parameters.

Parameters
[in]leftLeft clipping plane value.
[in]rightRight clipping plane value.
[in]bottomBottom clipping plane value.
[in]topTop clipping plane value.
[in]nearZNear clipping plane value.
[in]farZFar clipping plane value.

◆ setInfinitePerspective()

C3D_API void castor3d::Viewport::setInfinitePerspective ( castor::Angle const & fovy,
float aspect,
float nearZ )

Builds a centered perspective viewport with infinite far plane.

Parameters
[in]fovyY Field of View.
[in]aspectWidth / Height ratio.
[in]nearZNear clipping plane value.

◆ setOrtho()

C3D_API void castor3d::Viewport::setOrtho ( float left,
float right,
float bottom,
float top,
float nearZ,
float farZ )

Builds a matrix that Sets an orthogonal projection.

Parameters
[in]leftLeft clipping plane value.
[in]rightRight clipping plane value.
[in]bottomBottom clipping plane value.
[in]topTop clipping plane value.
[in]nearZNear clipping plane value.
[in]farZFar clipping plane value.

◆ setPerspective()

C3D_API void castor3d::Viewport::setPerspective ( castor::Angle const & fovy,
float aspect,
float nearZ,
float farZ )

Builds a centered perspective viewport.

Parameters
[in]fovyY Field of View.
[in]aspectWidth / Height ratio.
[in]nearZNear clipping plane value.
[in]farZFar clipping plane value.

◆ setPosition()

void castor3d::Viewport::setPosition ( castor::Position const & value)
inlinenoexcept

name Mutators.

◆ update()

C3D_API bool castor3d::Viewport::update ( )

Applies the perspective.

Returns
true if the frustum view has been modified

◆ updateBottom()

void castor3d::Viewport::updateBottom ( float value)
inlinenoexcept

◆ updateFar()

void castor3d::Viewport::updateFar ( float value)
inlinenoexcept

◆ updateFovY()

void castor3d::Viewport::updateFovY ( castor::Angle const & value)
inlinenoexcept

◆ updateLeft()

void castor3d::Viewport::updateLeft ( float value)
inlinenoexcept

◆ updateNear()

void castor3d::Viewport::updateNear ( float value)
inlinenoexcept

◆ updateRatio()

void castor3d::Viewport::updateRatio ( float value)
inlinenoexcept

◆ updateRight()

void castor3d::Viewport::updateRight ( float value)
inlinenoexcept

◆ updateTop()

void castor3d::Viewport::updateTop ( float value)
inlinenoexcept

◆ updateType()

void castor3d::Viewport::updateType ( ViewportType value)
inlinenoexcept

Referenced by castor3d::Camera::setViewportType().

Here is the caller graph for this function:

Member Data Documentation

◆ TypeName

C3D_API const castor::Array< castor::String, size_t( ViewportType::eCount ) > castor3d::Viewport::TypeName
static

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