Castor3D
..
|
The rendering pipeline. More...
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 |
The rendering pipeline.
C3D_API Castor3D::Pipeline::Pipeline | ( | RenderSystem & | p_renderSystem | ) |
Constructor.
[in] | p_renderSystem | The render system. |
|
virtual |
Denstructor.
C3D_API void Castor3D::Pipeline::ApplyMatrices | ( | FrameVariableBuffer & | p_matrixBuffer, |
uint64_t | p_matricesMask | ||
) |
Puts all the matrices in the given frame variables buffer.
[in] | p_matrixBuffer | The matrix variables buffer. |
[in] | p_matricesMask | A bitwise OR combination of MASK_MTXMODE, to select the matrices to apply. |
C3D_API void Castor3D::Pipeline::ApplyModel | ( | FrameVariableBuffer & | p_matrixBuffer | ) |
Puts the current model matrix into the given frame variables buffer.
[in] | p_matrixBuffer | The matrix variables buffer. |
C3D_API void Castor3D::Pipeline::ApplyNormal | ( | FrameVariableBuffer & | p_matrixBuffer | ) |
Puts the current normals matrix into the given frame variables buffer.
[in] | p_matrixBuffer | The matrix variables buffer. |
C3D_API void Castor3D::Pipeline::ApplyProjection | ( | FrameVariableBuffer & | p_matrixBuffer | ) |
Puts the current projection matrix into the given frame variables buffer.
[in] | p_matrixBuffer | The matrix variables buffer. |
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.
[in] | p_index | The texture index. |
[in] | p_matrixBuffer | The matrix variables buffer. |
C3D_API void Castor3D::Pipeline::ApplyView | ( | FrameVariableBuffer & | p_matrixBuffer | ) |
Puts the current vieww matrix into the given frame variables buffer.
[in] | p_matrixBuffer | The matrix variables buffer. |
C3D_API void Castor3D::Pipeline::ApplyViewport | ( | int | p_windowWidth, |
int | p_windowHeight | ||
) |
Applies the given viewport dimension.
[in] | p_windowWidth,p_windowHeight | The dimensions. |
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.
[in] | p_left | Left clipping plane value |
[in] | p_right | Right clipping plane value |
[in] | p_bottom | Bottom clipping plane value |
[in] | p_top | Top clipping plane value |
[in] | p_near | Near clipping plane value |
[in] | p_far | Far clipping plane value |
|
inline |
|
inline |
|
inline |
Retrieves the texture matrix for given index.
[in] | p_index | The texture index. |
References Castor3D::C3D_MAX_TEXTURE_MATRICES, and m_mtxTexture.
|
inline |
C3D_API void Castor3D::Pipeline::Initialise | ( | ) |
Initialises the pipeline.
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.
[in] | p_eye | The eye position. |
[in] | p_center | The point to look at. |
[in] | p_up | The up direction.. |
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.
[in] | p_left | Left clipping plane value |
[in] | p_right | Right clipping plane value |
[in] | p_bottom | Bottom clipping plane value |
[in] | p_top | Top clipping plane value |
[in] | p_near | Near clipping plane value |
[in] | p_far | Far clipping plane value |
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.
[in] | p_fovy | Y Field of View |
[in] | p_aspect | Width / Height ratio |
[in] | p_near | Near clipping plane value |
[in] | p_far | Far clipping plane value |
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.
[in] | p_screen | The screen coordinates. |
[in] | p_viewport | The viewport. |
[out] | p_result | Receives the scene coordinates. |
false
if the current mode is not valid.
|
inline |
|
inline |
|
inline |
Sets the projection matrix.
[in] | p_index | The texture index. |
[in] | p_mtx | The new matrix. |
References Castor3D::C3D_MAX_TEXTURE_MATRICES, and m_mtxTexture.
|
inline |
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.
[in] | p_scene | The scene coordinates. |
[in] | p_viewport | The viewport. |
[out] | p_result | Receives the screen coordinates. |
false
if the current mode is not valid.
|
virtual |
Updates the used implementation.
|
friend |
|
protected |
The driver specific Pipeline implementation.
Castor::Matrix4x4r Castor3D::Pipeline::m_mtxIdentity |
The identity matrix.
|
protected |
The model matrix.
Referenced by GetModelMatrix(), and SetModelMatrix().
|
protected |
The normals matrix.
|
protected |
The projection matrix.
Referenced by GetProjectionMatrix(), and SetProjectionMatrix().
|
protected |
The texture matrices.
Referenced by GetTextureMatrix(), and SetTextureMatrix().
|
protected |
The view matrix.
Referenced by GetViewMatrix(), and SetViewMatrix().
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |