#include <sglTexGen.hpp>
Inheritance diagram for sglTexGen::
Public Types | |
enum | TexCoordEnum { eS = GL_S, eT = GL_T, eR = GL_R, eQ = GL_Q } |
enum | ModeEnum { eOFF = -1, eOBJECT_LINEAR = GL_OBJECT_LINEAR, eEYE_LINEAR = GL_EYE_LINEAR, eSPHERE_MAP = GL_SPHERE_MAP, eREFLECTION_MAP = GL_REFLECTION_MAP_ARB, eNORMAL_MAP = GL_NORMAL_MAP_ARB } |
Public Methods | |
sglTexGen () | |
virtual | ~sglTexGen () |
void | setMode (TexCoordEnum coord, ModeEnum mode) |
ModeEnum | getMode (TexCoordEnum coord) const |
void | setPlane (TexCoordEnum coord, float x, float y, float z, float w) |
void | getPlane (TexCoordEnum coord, float &x, float &y, float &z, float &w) const |
void | applyToUnit (sglCurrState *, unsigned int) const |
virtual bool | getSorted () const |
virtual void | printInfo (ostream &ostrm, const char *indent_string) const |
When object linear or eye linear mode is used for any of the coordinates then the generated coordinate is a linear combination of the vertex (x, y, z, w) a reference plane can be defined for each coordinate to define the coefficients of the linear combination. In the case of the object linear mode these planes are defined with respect to the object's coordinate system; therefore, the texture coordinates will be fixed with respect to the object. In the case of eye linear mode, the planes are defined with respect to the view point coordinate system so they will move with the view point. Planes are only used by the object and eye linear modes.
Texture coordinate generation can be disabled by calling setMode for all the texture coordinate generation with sglTexGen::eOFF for the mode parameter.
Example
sglTexGen *tgen = new sglTexGen; // default mode is OFF tgen->setMode(sglTexGen::S, sglTexGen::OBJECT_LINEAR); tgen->setPlane(sglTexGen::S, 1.0f, 0.0f, 0.0f, 0.0f); tgen->setMode(sglTexGen::T, sglTexGen::OBJECT_LINEAR); tgen->setPlane(sglTexGen::T, 0.0f, 1.0f, 0.0f, 0.0f); // OR sphere map which ignores plane equations. tgen->setMode(sglTexGen::eS, sglTexGen::eSPHERE_MAP); tgen->setMode(sglTexGen::eT, sglTexGen::eSPHERE_MAP);
Definition at line 74 of file sglTexGen.hpp.
|
Tokens that wrap OpenGLs texture coordinate specification.
Definition at line 78 of file sglTexGen.hpp. |
|
The tokens for the various texture generation functions.
Definition at line 94 of file sglTexGen.hpp. |
|
Default constructor. All texture coordinate generation is disabled.
|
|
Virtual destructor.
|
|
Set the texture coordinate generation functions for a specified coordinate
|
|
Query the current generation function for the specifed coordinate.
|
|
Define the planes for either object linear or eye linear mode. The default planes are perpendicular to their respective dimensions and intersecting the origin. Note a single set of four planes are stored in this object and are used in either object or eye linear modes. Switching modes will retain the previous planes.
|
|
Query the current plane for the given coordinate.
|
|
Apply this state change to the current rendering state for the given texture unit.
Reimplemented from sglTexturingStatelet. |
|
Query the sorting mode for this statelet.
Reimplemented from sglStatelet. Definition at line 165 of file sglTexGen.hpp. |
|
Output the state of this node to the specified ostream.
Reimplemented from sglStatelet. |