Castor3D  ..
Classes | Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
Castor3D::Viewport Class Reference

Class to represent a viewport. More...

Classes

class  BinaryParser
 Viewport loader. More...
 
class  TextLoader
 Viewport loader. More...
 

Public Member Functions

C3D_API Viewport (Engine &p_engine, eVIEWPORT_TYPE p_type)
 Constructor. More...
 
virtual C3D_API ~Viewport ()
 Destructor. More...
 
C3D_API bool Render (Pipeline &p_pipeline)
 Renders the viewport specifics. More...
 
const Castor::Size & GetSize () const
 
eVIEWPORT_TYPE GetType () const
 
real GetRatio () const
 
real GetNear () const
 
real GetFar () const
 
Castor::Angle GetFovY () const
 
real GetLeft () const
 
real GetRight () const
 
real GetTop () const
 
real GetBottom () const
 
uint32_t GetWidth () const
 
uint32_t GetHeight () const
 
bool IsModified () const
 
void SetSize (const Castor::Size &p_size)
 Sets the viewport render size. More...
 
void SetType (eVIEWPORT_TYPE p_type)
 Retrieves the viewport projection type. More...
 
void SetRatio (real p_rRatio)
 Retrieves the aspect ratio. More...
 
void SetNear (real p_rNear)
 Retrieves the near plane position. More...
 
void SetFar (real p_rFar)
 Retrieves the far plane position. More...
 
void SetFovY (Castor::Angle const &p_aFovY)
 Retrieves the vertical view angle. More...
 
void SetLeft (real p_rLeft)
 Retrieves the left plane position. More...
 
void SetRight (real p_rRight)
 Retrieves the right plane position. More...
 
void SetTop (real p_rTop)
 Retrieves the top plane position. More...
 
void SetBottom (real p_rBottom)
 Retrieves the bottom plane position. More...
 
const Castor::PlaneEquation< real > & GetFrustumPlane (eFRUSTUM_PLANE p_ePlane) const
 Retrieves the wanted frustum view plane. More...
 
Castor::Matrix4x4r const & GetProjection () const
 

Static Public Member Functions

static C3D_API Viewport Perspective (Engine &p_engine, Castor::Angle const &p_fovy, real p_aspect, real p_near, real p_far)
 Builds a centered perspective viewport. More...
 
static C3D_API Viewport Frustum (Engine &p_engine, real p_left, real p_right, real p_bottom, real p_top, real p_near, real p_far)
 Builds a matrix that sets a non centered perspective projection from the given parameters. More...
 
static C3D_API Viewport Ortho (Engine &p_engine, real p_left, real p_right, real p_bottom, real p_top, real p_near, real p_far)
 Builds a matrix that sets an orthogonal projection. More...
 

Static Public Attributes

static C3D_API const Castor::String string_type [eVIEWPORT_TYPE_COUNT]
 

Detailed Description

Class to represent a viewport.

Author
Sylvain DOREMUS
Version
0.1
Date
09/02/2010
Remarks
Gives its projection type, FOV, ...

Constructor & Destructor Documentation

◆ Viewport()

C3D_API Castor3D::Viewport::Viewport ( Engine p_engine,
eVIEWPORT_TYPE  p_type 
)

Constructor.

Parameters
[in]p_engineThe core engine
[in]p_typeProjection type

◆ ~Viewport()

virtual C3D_API Castor3D::Viewport::~Viewport ( )
virtual

Destructor.

Member Function Documentation

◆ Frustum()

static C3D_API Viewport Castor3D::Viewport::Frustum ( Engine p_engine,
real  p_left,
real  p_right,
real  p_bottom,
real  p_top,
real  p_near,
real  p_far 
)
static

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

Parameters
[in]p_engineThe core engine
[in]p_leftLeft clipping plane value.
[in]p_rightRight clipping plane value.
[in]p_bottomBottom clipping plane value.
[in]p_topTop clipping plane value.
[in]p_nearNear clipping plane value.
[in]p_farFar clipping plane value.
Returns
The viewport.

◆ GetBottom()

real Castor3D::Viewport::GetBottom ( ) const
inline
Returns
The bottom plane position

◆ GetFar()

real Castor3D::Viewport::GetFar ( ) const
inline
Returns
The far plane position

◆ GetFovY()

Castor::Angle Castor3D::Viewport::GetFovY ( ) const
inline
Returns
The view vertical angle

◆ GetFrustumPlane()

const Castor::PlaneEquation< real >& Castor3D::Viewport::GetFrustumPlane ( eFRUSTUM_PLANE  p_ePlane) const
inline

Retrieves the wanted frustum view plane.

Parameters
[in]p_ePlaneThe wanted plane index
Returns
The value

◆ GetHeight()

uint32_t Castor3D::Viewport::GetHeight ( ) const
inline
Returns
The viewport height

◆ GetLeft()

real Castor3D::Viewport::GetLeft ( ) const
inline
Returns
The left plane position

◆ GetNear()

real Castor3D::Viewport::GetNear ( ) const
inline
Returns
The near plane position

◆ GetProjection()

Castor::Matrix4x4r const& Castor3D::Viewport::GetProjection ( ) const
inline
Returns
The projection matrix

◆ GetRatio()

real Castor3D::Viewport::GetRatio ( ) const
inline
Returns
The aspect ratio

◆ GetRight()

real Castor3D::Viewport::GetRight ( ) const
inline
Returns
The right plane position

◆ GetSize()

const Castor::Size& Castor3D::Viewport::GetSize ( ) const
inline
Returns
The viewport render size

◆ GetTop()

real Castor3D::Viewport::GetTop ( ) const
inline
Returns
The top plane position

◆ GetType()

eVIEWPORT_TYPE Castor3D::Viewport::GetType ( ) const
inline
Returns
The viewport projection type

◆ GetWidth()

uint32_t Castor3D::Viewport::GetWidth ( ) const
inline
Returns
The viewport width

◆ IsModified()

bool Castor3D::Viewport::IsModified ( ) const
inline
Returns
The viewport modificiation status

◆ Ortho()

static C3D_API Viewport Castor3D::Viewport::Ortho ( Engine p_engine,
real  p_left,
real  p_right,
real  p_bottom,
real  p_top,
real  p_near,
real  p_far 
)
static

Builds a matrix that sets an orthogonal projection.

Parameters
[in]p_engineThe core engine
[in]p_leftLeft clipping plane value.
[in]p_rightRight clipping plane value.
[in]p_bottomBottom clipping plane value.
[in]p_topTop clipping plane value.
[in]p_nearNear clipping plane value.
[in]p_farFar clipping plane value.
Returns
The viewport.

◆ Perspective()

static C3D_API Viewport Castor3D::Viewport::Perspective ( Engine p_engine,
Castor::Angle const &  p_fovy,
real  p_aspect,
real  p_near,
real  p_far 
)
static

Builds a centered perspective viewport.

Parameters
[in]p_engineThe core engine
[in]p_fovyY Field of View.
[in]p_aspectWidth / Height ratio.
[in]p_nearNear clipping plane value.
[in]p_farFar clipping plane value.
Returns
The viewport.

◆ Render()

C3D_API bool Castor3D::Viewport::Render ( Pipeline p_pipeline)

Renders the viewport specifics.

Remarks
Applies the perspective
Returns
true if the frustum view has been modified

◆ SetBottom()

void Castor3D::Viewport::SetBottom ( real  p_rBottom)
inline

Retrieves the bottom plane position.

Returns
The value

◆ SetFar()

void Castor3D::Viewport::SetFar ( real  p_rFar)
inline

Retrieves the far plane position.

Returns
The value

◆ SetFovY()

void Castor3D::Viewport::SetFovY ( Castor::Angle const &  p_aFovY)
inline

Retrieves the vertical view angle.

Returns
The value

◆ SetLeft()

void Castor3D::Viewport::SetLeft ( real  p_rLeft)
inline

Retrieves the left plane position.

Returns
The value

◆ SetNear()

void Castor3D::Viewport::SetNear ( real  p_rNear)
inline

Retrieves the near plane position.

Returns
The value

◆ SetRatio()

void Castor3D::Viewport::SetRatio ( real  p_rRatio)
inline

Retrieves the aspect ratio.

Returns
The value

◆ SetRight()

void Castor3D::Viewport::SetRight ( real  p_rRight)
inline

Retrieves the right plane position.

Returns
The value

◆ SetSize()

void Castor3D::Viewport::SetSize ( const Castor::Size &  p_size)
inline

Sets the viewport render size.

Parameters
[in]p_sizeThe new value

◆ SetTop()

void Castor3D::Viewport::SetTop ( real  p_rTop)
inline

Retrieves the top plane position.

Returns
The value

◆ SetType()

void Castor3D::Viewport::SetType ( eVIEWPORT_TYPE  p_type)
inline

Retrieves the viewport projection type.

Returns
The value

Member Data Documentation

◆ string_type

C3D_API const Castor::String Castor3D::Viewport::string_type[eVIEWPORT_TYPE_COUNT]
static

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