#include <Rendering/SceneComponents/Models/texturizer.h>
◆ NoTexture() [1/2]
◆ NoTexture() [2/2]
◆ clone()
- Returns
- A clone of this object.
- Note
- Subclasses would normally return their own type rather than the Clonable type. The C++ language rules allow a more derived type to be returned from a virtual function and the compiler will still treat it as a valid override.
Implements Texturizer.
◆ getCacheId()
virtual QString getCacheId |
( |
| ) |
const |
|
inlinevirtual |
◆ getDimensions()
unsigned getDimensions |
( |
| ) |
const |
|
inlineoverridevirtual |
- Returns
- The number of dimensions this texturizer supports. This should always be 1, 2 or 3, although it is conceivable that a texturizer might have 4 dimensions (but really that would be a modification of 3 dimensions with the 4th dimension being associated with the w component). A value of zero can also be returned as a special case to denote a texturizer which does not apply a texture at all.
Implements Texturizer.
◆ getNumImages()
unsigned getNumImages |
( |
| ) |
const |
|
inlineoverridevirtual |
- Returns
- The number of images this texturizer holds. Some texturizers provide only one image, whereas others provide a set of images and the image to use for any given element is found by calling getTextureImage(). The getNumImages() function can be used by model processors to work out how many images they will need to handle during processing.
Implements Texturizer.
◆ getTextureCoords()
- Parameters
-
node | The node we want the texture co-ordinate of |
- Precondition
- setTexturedModel must have already been called with the MeshModelInterface that the supplied node belongs to.
- Returns
- The texture co-ordinates for the specified node. While the result returned is a 3D vector corresponding to the (s,t,r) texture co-ordinates, for lower dimensional textures simply ignore the latter components (eg 2D textures ignore the r component). For consistency, lower dimensional texturizers must set components they don't use to zero.
- See also
- getTextureImage(), setTexturedModel()
Implements Texturizer.
◆ getTextureImage()
- Parameters
-
index | The index of the texture image to retrieve. It must be a non-negative number less than the result of getNumImages(). |
- Returns
- The texture image corresponding to the specified index.
Implements Texturizer.
◆ nullObject()
◆ setTexturedModel()
- Parameters
-
model | The model about to be textured. |
glyphing | If true, the texture image selection by getTextureImage() should be based on node states instead of element states, since the the glyph that will be textured reflects the node states and no model elements are normally present or shown. |
Subclasses can reimplement this function to save internal data about the model that will be used for subsequent calls to getTextureCoords() and getTextureImage(). Clients are free to call this function at any time, so the subclass must keep this in mind, although it will usually only be called by a model appearance processor just before it uses the texturizer to process the specified model or before it outputs a glyph.
- Returns
- True if successful or false if there was an error when trying to use the specified model. If the texturizer will not be able to return valid texture co-ordinates (eg texture co-ordinate node states are missing in the model), this function should return false.
Reimplemented from Texturizer.