|
static void | setGLSLVariableNames (const std::string &mcPositionNameIn, const std::string &mcNormalNameIn, const std::string &texCoordsNameIn) |
|
static void | setUseEBOs (bool b) |
|
◆ BasicShapeRenderer()
BasicShapeRenderer::BasicShapeRenderer |
( |
ShaderIF * |
sIF, |
|
|
BasicShape * |
shapeIn |
|
) |
| |
Create a BasicShapeRenderer using the given GLSL shader program and BasicShape instance.
- Parameters
-
sIF | the GLSL shader program to use when rendering |
shapeIn | the BasicShape instance to be rendered |
◆ ~BasicShapeRenderer()
BasicShapeRenderer::~BasicShapeRenderer |
( |
| ) |
|
|
virtual |
◆ getMCBoundingBox()
void BasicShapeRenderer::getMCBoundingBox |
( |
double * |
xyzLimits | ) |
const |
Return the MC bounding box for the BasicShape being rendered
- Parameters
-
xyzLimits | the (xmin, xmax, ymin, ymax, zmin,zmax) limits |
◆ renderShape()
void BasicShapeRenderer::renderShape |
( |
FacePrepFcn |
prepareForFace = nullptr , |
|
|
void * |
caller = nullptr |
|
) |
| |
Draw the BasicShape with the optional prepareForFace callback function and caller
- Parameters
-
prepareForFace | an optional callback function that will be invoked at the start of each real face of the BasicShape. For cylinder, cone, and sphere basic shapes, this will be called only for face ID=0, the curved face. For block BasicShape instances, it will be called for each of the 6 faces of the block. |
caller | the object (typically a ModelView descendent class) that is using this BasicShapeRenderer |
◆ setGLSLVariableNames()
void BasicShapeRenderer::setGLSLVariableNames |
( |
const std::string & |
mcPositionNameIn, |
|
|
const std::string & |
mcNormalNameIn, |
|
|
const std::string & |
texCoordsNameIn |
|
) |
| |
|
static |
Set the GLSL variable names for the three required PVAs: position, normal, and texture coordinates. These are used when the renderer needs to access and/or fill the VBOs and/or enable flags associated with these variables. They default to the conventional: "mcPosition", "mcNormal", and "texCoords".
- Parameters
-
mcPositionNameIn | the GLSL variable name for the model coordinate position (assumed to be a GLSL vec3) |
mcNormalNameIn | the GLSL variable name for the model coordinate normal vector (assumed to be a GLSL vec3) |
texCoordsNameIn | the GLSL variable name for the texture coordinates (assumed to be a GLSL vec2) |
◆ setTexCoordsForBlock()
void BasicShapeRenderer::setTexCoordsForBlock |
( |
int |
faceIndex, |
|
|
float |
sMin = 0.0 , |
|
|
float |
sMax = 1.0 , |
|
|
float |
tMin = 0.0 , |
|
|
float |
tMax = 1.0 |
|
) |
| |
A method that can be used to establish texture coordinates for a specific face of a BasicShape created using BasicShape::makeBlock. This routine will typically be called from the "prepareForFace" callback passed to BasicShapeRenderer::renderShape.
- Parameters
-
faceIndex | the face being drawn (0<=faceIndex<=5; See BasicShape::makeBlock for the faceIndex assignments) |
sMin | the minimum s texture coordinate desired |
sMax | the maximum s texture coordinate desired |
tMin | the minimum t texture coordinate desired |
tMax | the maximum t texture coordinate desired |
◆ setUseEBOs()
static void BasicShapeRenderer::setUseEBOs |
( |
bool |
b | ) |
|
|
inlinestatic |
Control whether EBOs are used in glDrawElements calls or whether an array of integers is passed directly to the glDrawElements call. The default is "true" which seems to work best in terms of platform portability (and probably performance).
- Parameters
-
b | "true" if EBOs should be used; "false" if directly passing index arrays to glDrawElements is to be done. |
The documentation for this class was generated from the following files: