Public Member Functions

sp::tool::MatrixTexture Class Reference
[Texture Mapping]

#include <spUtilityMatrixTexture.hpp>

Inheritance diagram for sp::tool::MatrixTexture:
sp::tool::GeneralPurposeTexture

List of all members.

Public Member Functions

 MatrixTexture (u32 Count)
 ~MatrixTexture ()
void setMatrix (u32 Index, const dim::matrix4f &Matrix, bool ImmediateUpdate=false)
dim::matrix4f getMatrix (u32 Index) const
 Returns a matrix which is stored inside the texture at the specified index.
dim::point2di getTexCoord (u32 Index) const
 Returns the texture coordinate for the given index.
void resize (u32 Count)
 Resizes the texture for the new count of 4x4 matrices.

Detailed Description

A matrix texture can be used to store 4x4 matrices inside a texture object. This can be useful for texture-lookups on a vertex shader, e.g. for hardware-instancing.

See also:
video::Shader
video::Texture
dim::matrix4
VectorTexture
Since:
Version 3.2

Constructor & Destructor Documentation

sp::tool::MatrixTexture::MatrixTexture ( u32  Count  ) 
Exceptions:
io::RenderSystemException When this object will be created before the global render-system has been created.
sp::tool::MatrixTexture::~MatrixTexture (  ) 

Member Function Documentation

dim::matrix4f sp::tool::MatrixTexture::getMatrix ( u32  Index  )  const

Returns a matrix which is stored inside the texture at the specified index.

dim::point2di sp::tool::MatrixTexture::getTexCoord ( u32  Index  )  const [virtual]

Returns the texture coordinate for the given index.

Implements sp::tool::GeneralPurposeTexture.

void sp::tool::MatrixTexture::resize ( u32  Count  )  [virtual]

Resizes the texture for the new count of 4x4 matrices.

Implements sp::tool::GeneralPurposeTexture.

void sp::tool::MatrixTexture::setMatrix ( u32  Index,
const dim::matrix4f Matrix,
bool  ImmediateUpdate = false 
)

Writes the specified matrix into the texture.

Parameters:
[in] Index Specifies the index at which point the matrix will be inserted. Must be smaller than the maximal count of matrices.
[in] Matrix Specifies the matrix which is to be stored inside the texture.
[in] ImmediateUpdate Specifies whether the texture is to be updated immediately. Otherwise you have to update the image buffer by yourself using the "Texture::updateImageBuffer" function.

The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines