Castor3D  ..
Public Member Functions | Public Attributes | Static Public Attributes | Protected Attributes | Friends | List of all members
Castor3D::Pipeline Class Reference

The rendering pipeline. More...

+ Inheritance diagram for Castor3D::Pipeline:
+ Collaboration diagram for Castor3D::Pipeline:

Public Member Functions

C3D_API Pipeline (RenderSystem &p_renderSystem)
 Constructor. More...
 
virtual C3D_API ~Pipeline ()
 Denstructor. More...
 
C3D_API void Initialise ()
 Initialises the pipeline. More...
 
C3D_API bool Project (Castor::Point3r const &p_screen, Castor::Point4r const &p_viewport, Castor::Point3r &p_result)
 Projects the given screen point to 3D scene point. More...
 
C3D_API bool UnProject (Castor::Point3i const &p_scene, Castor::Point4r const &p_viewport, Castor::Point3r &p_result)
 Unprojects the given scene point to screen point. More...
 
C3D_API void ApplyProjection (FrameVariableBuffer &p_matrixBuffer)
 Puts the current projection matrix into the given frame variables buffer. More...
 
C3D_API void ApplyModel (FrameVariableBuffer &p_matrixBuffer)
 Puts the current model matrix into the given frame variables buffer. More...
 
C3D_API void ApplyView (FrameVariableBuffer &p_matrixBuffer)
 Puts the current vieww matrix into the given frame variables buffer. More...
 
C3D_API void ApplyNormal (FrameVariableBuffer &p_matrixBuffer)
 Puts the current normals matrix into the given frame variables buffer. More...
 
C3D_API void ApplyTexture (uint32_t p_index, FrameVariableBuffer &p_matrixBuffer)
 Puts the current texture 0 matrix into the given frame variables buffer. More...
 
C3D_API void ApplyMatrices (FrameVariableBuffer &p_matrixBuffer, uint64_t p_matricesMask)
 Puts all the matrices in the given frame variables buffer. More...
 
C3D_API void ApplyViewport (int p_windowWidth, int p_windowHeight)
 Applies the given viewport dimension. More...
 
C3D_API void Perspective (Castor::Angle const &p_fovy, real p_aspect, real p_near, real p_far)
 Builds a matrix that sets a centered perspective projection from the given parameters. More...
 
C3D_API void Frustum (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...
 
C3D_API void Ortho (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 orthogonal projection from the given parameters. More...
 
C3D_API void LookAt (Castor::Point3r const &p_eye, Castor::Point3r const &p_center, Castor::Point3r const &p_up)
 Builds a view matrix that looks at a given point. More...
 
virtual C3D_API void UpdateImpl ()
 Updates the used implementation. More...
 
void SetModelMatrix (Castor::Matrix4x4r const &p_mtx)
 Sets the model matrix. More...
 
void SetViewMatrix (Castor::Matrix4x4r const &p_mtx)
 Sets the view matrix. More...
 
void SetProjectionMatrix (Castor::Matrix4x4r const &p_mtx)
 Sets the projection matrix. More...
 
void SetTextureMatrix (uint32_t p_index, Castor::Matrix4x4r const &p_mtx)
 Sets the projection matrix. More...
 
Castor::Matrix4x4r const & GetModelMatrix () const
 Retrieves the model matrix. More...
 
Castor::Matrix4x4r const & GetViewMatrix () const
 Retrieves the view matrix. More...
 
Castor::Matrix4x4r const & GetProjectionMatrix () const
 Retrieves the projection matrix. More...
 
Castor::Matrix4x4r const & GetTextureMatrix (uint32_t p_index) const
 Retrieves the texture matrix for given index. More...
 

Public Attributes

Castor::Matrix4x4r m_mtxIdentity
 The identity matrix. More...
 

Static Public Attributes

static const Castor::String MtxProjection
 
static const Castor::String MtxModel
 
static const Castor::String MtxView
 
static const Castor::String MtxNormal
 
static const Castor::String MtxTexture [C3D_MAX_TEXTURE_MATRICES]
 
static const Castor::String MtxBones
 

Protected Attributes

Castor::Matrix4x4r m_mtxModel
 The model matrix. More...
 
Castor::Matrix4x4r m_mtxView
 The view matrix. More...
 
Castor::Matrix4x4r m_mtxProjection
 The projection matrix. More...
 
Castor::Matrix4x4r m_mtxNormal
 The normals matrix. More...
 
Castor::Matrix4x4r m_mtxTexture [C3D_MAX_TEXTURE_MATRICES]
 The texture matrices. More...
 
IPipelineImplWPtr m_impl
 The driver specific Pipeline implementation. More...
 

Friends

class IPipelineImpl
 

Detailed Description

The rendering pipeline.

Author
Sylvain DOREMUS
Version
0.6.1.0
Date
03/01/2011
Remarks
Defines the various matrices, applies the transformations it can support.

Constructor & Destructor Documentation

◆ Pipeline()

C3D_API Castor3D::Pipeline::Pipeline ( RenderSystem p_renderSystem)

Constructor.

Parameters
[in]p_renderSystemThe render system.

◆ ~Pipeline()

virtual C3D_API Castor3D::Pipeline::~Pipeline ( )
virtual

Denstructor.

Member Function Documentation

◆ ApplyMatrices()

C3D_API void Castor3D::Pipeline::ApplyMatrices ( FrameVariableBuffer p_matrixBuffer,
uint64_t  p_matricesMask 
)

Puts all the matrices in the given frame variables buffer.

Parameters
[in]p_matrixBufferThe matrix variables buffer.
[in]p_matricesMaskA bitwise OR combination of MASK_MTXMODE, to select the matrices to apply.

◆ ApplyModel()

C3D_API void Castor3D::Pipeline::ApplyModel ( FrameVariableBuffer p_matrixBuffer)

Puts the current model matrix into the given frame variables buffer.

Parameters
[in]p_matrixBufferThe matrix variables buffer.

◆ ApplyNormal()

C3D_API void Castor3D::Pipeline::ApplyNormal ( FrameVariableBuffer p_matrixBuffer)

Puts the current normals matrix into the given frame variables buffer.

Parameters
[in]p_matrixBufferThe matrix variables buffer.

◆ ApplyProjection()

C3D_API void Castor3D::Pipeline::ApplyProjection ( FrameVariableBuffer p_matrixBuffer)

Puts the current projection matrix into the given frame variables buffer.

Parameters
[in]p_matrixBufferThe matrix variables buffer.

◆ ApplyTexture()

C3D_API void Castor3D::Pipeline::ApplyTexture ( uint32_t  p_index,
FrameVariableBuffer p_matrixBuffer 
)

Puts the current texture 0 matrix into the given frame variables buffer.

Parameters
[in]p_indexThe texture index.
[in]p_matrixBufferThe matrix variables buffer.

◆ ApplyView()

C3D_API void Castor3D::Pipeline::ApplyView ( FrameVariableBuffer p_matrixBuffer)

Puts the current vieww matrix into the given frame variables buffer.

Parameters
[in]p_matrixBufferThe matrix variables buffer.

◆ ApplyViewport()

C3D_API void Castor3D::Pipeline::ApplyViewport ( int  p_windowWidth,
int  p_windowHeight 
)

Applies the given viewport dimension.

Parameters
[in]p_windowWidth,p_windowHeightThe dimensions.

◆ Frustum()

C3D_API void Castor3D::Pipeline::Frustum ( 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.

Parameters
[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

◆ GetModelMatrix()

Castor::Matrix4x4r const& Castor3D::Pipeline::GetModelMatrix ( ) const
inline

Retrieves the model matrix.

Returns
The matrix.

References m_mtxModel.

◆ GetProjectionMatrix()

Castor::Matrix4x4r const& Castor3D::Pipeline::GetProjectionMatrix ( ) const
inline

Retrieves the projection matrix.

Returns
The matrix.

References m_mtxProjection.

◆ GetTextureMatrix()

Castor::Matrix4x4r const& Castor3D::Pipeline::GetTextureMatrix ( uint32_t  p_index) const
inline

Retrieves the texture matrix for given index.

Parameters
[in]p_indexThe texture index.
Returns
The matrix.

References Castor3D::C3D_MAX_TEXTURE_MATRICES, and m_mtxTexture.

◆ GetViewMatrix()

Castor::Matrix4x4r const& Castor3D::Pipeline::GetViewMatrix ( ) const
inline

Retrieves the view matrix.

Returns
The matrix.

References m_mtxView.

◆ Initialise()

C3D_API void Castor3D::Pipeline::Initialise ( )

Initialises the pipeline.

◆ LookAt()

C3D_API void Castor3D::Pipeline::LookAt ( Castor::Point3r const &  p_eye,
Castor::Point3r const &  p_center,
Castor::Point3r const &  p_up 
)

Builds a view matrix that looks at a given point.

Parameters
[in]p_eyeThe eye position.
[in]p_centerThe point to look at.
[in]p_upThe up direction..

◆ Ortho()

C3D_API void Castor3D::Pipeline::Ortho ( 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 orthogonal projection from the given parameters.

Parameters
[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

◆ Perspective()

C3D_API void Castor3D::Pipeline::Perspective ( Castor::Angle const &  p_fovy,
real  p_aspect,
real  p_near,
real  p_far 
)

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

Parameters
[in]p_fovyY Field of View
[in]p_aspectWidth / Height ratio
[in]p_nearNear clipping plane value
[in]p_farFar clipping plane value

◆ Project()

C3D_API bool Castor3D::Pipeline::Project ( Castor::Point3r const &  p_screen,
Castor::Point4r const &  p_viewport,
Castor::Point3r &  p_result 
)

Projects the given screen point to 3D scene point.

Parameters
[in]p_screenThe screen coordinates.
[in]p_viewportThe viewport.
[out]p_resultReceives the scene coordinates.
Returns
false if the current mode is not valid.

◆ SetModelMatrix()

void Castor3D::Pipeline::SetModelMatrix ( Castor::Matrix4x4r const &  p_mtx)
inline

Sets the model matrix.

Parameters
[in]p_mtxThe new matrix.

References m_mtxModel.

◆ SetProjectionMatrix()

void Castor3D::Pipeline::SetProjectionMatrix ( Castor::Matrix4x4r const &  p_mtx)
inline

Sets the projection matrix.

Parameters
[in]p_mtxThe new matrix.

References m_mtxProjection.

◆ SetTextureMatrix()

void Castor3D::Pipeline::SetTextureMatrix ( uint32_t  p_index,
Castor::Matrix4x4r const &  p_mtx 
)
inline

Sets the projection matrix.

Parameters
[in]p_indexThe texture index.
[in]p_mtxThe new matrix.

References Castor3D::C3D_MAX_TEXTURE_MATRICES, and m_mtxTexture.

◆ SetViewMatrix()

void Castor3D::Pipeline::SetViewMatrix ( Castor::Matrix4x4r const &  p_mtx)
inline

Sets the view matrix.

Parameters
[in]p_mtxThe new matrix.

References m_mtxView.

◆ UnProject()

C3D_API bool Castor3D::Pipeline::UnProject ( Castor::Point3i const &  p_scene,
Castor::Point4r const &  p_viewport,
Castor::Point3r &  p_result 
)

Unprojects the given scene point to screen point.

Parameters
[in]p_sceneThe scene coordinates.
[in]p_viewportThe viewport.
[out]p_resultReceives the screen coordinates.
Returns
false if the current mode is not valid.

◆ UpdateImpl()

virtual C3D_API void Castor3D::Pipeline::UpdateImpl ( )
virtual

Updates the used implementation.

Friends And Related Function Documentation

◆ IPipelineImpl

friend class IPipelineImpl
friend

Member Data Documentation

◆ m_impl

IPipelineImplWPtr Castor3D::Pipeline::m_impl
protected

The driver specific Pipeline implementation.

◆ m_mtxIdentity

Castor::Matrix4x4r Castor3D::Pipeline::m_mtxIdentity

The identity matrix.

◆ m_mtxModel

Castor::Matrix4x4r Castor3D::Pipeline::m_mtxModel
protected

The model matrix.

Referenced by GetModelMatrix(), and SetModelMatrix().

◆ m_mtxNormal

Castor::Matrix4x4r Castor3D::Pipeline::m_mtxNormal
protected

The normals matrix.

◆ m_mtxProjection

Castor::Matrix4x4r Castor3D::Pipeline::m_mtxProjection
protected

The projection matrix.

Referenced by GetProjectionMatrix(), and SetProjectionMatrix().

◆ m_mtxTexture

Castor::Matrix4x4r Castor3D::Pipeline::m_mtxTexture[C3D_MAX_TEXTURE_MATRICES]
protected

The texture matrices.

Referenced by GetTextureMatrix(), and SetTextureMatrix().

◆ m_mtxView

Castor::Matrix4x4r Castor3D::Pipeline::m_mtxView
protected

The view matrix.

Referenced by GetViewMatrix(), and SetViewMatrix().

◆ MtxBones

const Castor::String Castor3D::Pipeline::MtxBones
static

◆ MtxModel

const Castor::String Castor3D::Pipeline::MtxModel
static

◆ MtxNormal

const Castor::String Castor3D::Pipeline::MtxNormal
static

◆ MtxProjection

const Castor::String Castor3D::Pipeline::MtxProjection
static

◆ MtxTexture

const Castor::String Castor3D::Pipeline::MtxTexture[C3D_MAX_TEXTURE_MATRICES]
static

◆ MtxView

const Castor::String Castor3D::Pipeline::MtxView
static

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