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

#include <Viewport.hpp>

Collaboration diagram for castor3d::Viewport:
Collaboration graph
[legend]

Public Member Functions

C3D_API Viewportoperator= (Viewport const &rhs)=delete
 
C3D_API Viewportoperator= (Viewport &&rhs)=delete
 
C3D_API Viewport (Viewport const &rhs)
 
C3D_API Viewport (Viewport &&rhs)
 
C3D_API Viewport (Engine const &engine)
 Constructor. More...
 
C3D_API ~Viewport ()=default
 Destructor. More...
 
C3D_API bool update ()
 Applies the perspective. More...
 
C3D_API void setPerspective (castor::Angle const &fovy, float aspect, float nearZ, float farZ)
 Builds a centered perspective viewport. More...
 
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. More...
 
C3D_API void setOrtho (float left, float right, float bottom, float top, float nearZ, float farZ)
 Builds a matrix that Sets an orthogonal projection. More...
 
C3D_API void resize (const castor::Size &value)
 Sets the viewport render size. More...
 
C3D_API float getProjectionScale () const
 
castor::Size const & getSize () const
 
castor::Position const & getPosition () const
 
ViewportType getType () const
 
float getRatio () const
 
float getNear () const
 
float getFar () const
 
castor::Angle const & getFovY () const
 
float getLeft () const
 
float getRight () const
 
float getTop () const
 
float getBottom () const
 
uint32_t getWidth () const
 
uint32_t getHeight () const
 
bool isModified () const
 
castor::Matrix4x4f const & getProjection () const
 
castor::Matrix4x4f const & getSafeBandedProjection () const
 
VkViewport const & getViewport () const
 
VkRect2D const & getScissor () const
 
Engine const & getEngine () const
 
void setPosition (const castor::Position &value)
 
void updateType (ViewportType value)
 
void updateRatio (float value)
 
void updateNear (float value)
 
void updateFar (float value)
 
void updateFovY (castor::Angle const &value)
 
void updateLeft (float value)
 
void updateRight (float value)
 
void updateTop (float value)
 
void updateBottom (float value)
 

Static Public Attributes

static C3D_API const std::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)

◆ Viewport() [3/3]

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

Constructor.

Parameters
[in]engineThe engine.

◆ ~Viewport()

C3D_API castor3d::Viewport::~Viewport ( )
default

Destructor.

Member Function Documentation

◆ getBottom()

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

◆ getEngine()

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

◆ getFar()

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

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

Here is the caller graph for this function:

◆ getFovY()

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

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

Here is the caller graph for this function:

◆ getHeight()

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

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

Here is the caller graph for this function:

◆ getLeft()

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

◆ getNear()

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

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

Here is the caller graph for this function:

◆ getPosition()

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

◆ getProjection()

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

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
inline

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

Here is the caller graph for this function:

◆ getRight()

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

◆ getSafeBandedProjection()

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

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

Here is the caller graph for this function:

◆ getScissor()

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

◆ getSize()

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

name Getters.

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

Here is the caller graph for this function:

◆ getTop()

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

◆ getType()

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

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

Here is the caller graph for this function:

◆ getViewport()

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

◆ getWidth()

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

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

Here is the caller graph for this function:

◆ isModified()

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

◆ operator=() [1/2]

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

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

◆ 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 ( const castor::Position &  value)
inline

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)
inline

◆ updateFar()

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

◆ updateFovY()

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

◆ updateLeft()

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

◆ updateNear()

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

◆ updateRatio()

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

◆ updateRight()

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

◆ updateTop()

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

◆ updateType()

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

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

Here is the caller graph for this function:

Member Data Documentation

◆ TypeName

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

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