NvModelGL Class Reference
Drawable geometric model using GL VBOs. More...
#include <NvModelGL.h>
Public Member Functions | |
void | drawElements (GLint positionHandle) |
Draw the model using the current shader (positions) Binds the vertex position array to the given attribute array index and draws the model with the currently bound shader. | |
void | drawElements (GLint positionHandle, GLint normalHandle) |
Draw the model using the current shader (positions and normals) Binds the vertex position and normal arrays to the given attribute array indices and draws the model with the currently bound shader. | |
void | drawElements (GLint positionHandle, GLint normalHandle, GLint texcoordHandle) |
Draw the model using the current shader (positions, UVs and normals) Binds the vertex position, UV and normal arrays to the given attribute array indices and draws the model with the currently bound shader. | |
void | drawElements (GLint positionHandle, GLint normalHandle, GLint texcoordHandle, GLint tangentHandle) |
Draw the model using the current shader (positions, UVs, normals and tangents) Binds the vertex position, UV, normal and tangent arrays to the given attribute array indices and draws the model with the currently bound shader. | |
NvModel * | getModel () |
Get the low-level geometry data. | |
void | computeCenter () |
Updates the center point of the model. | |
nv::vec3f | GetMinExt () |
nv::vec3f | GetMaxExt () |
void | bindBuffers () |
void | unbindBuffers () |
Static Public Member Functions | |
static NvModelGL * | CreateFromObj (uint8_t *data, float scale, bool computeNormals=false, bool computeTangents=false) |
Create a renderable model from OBJ data. | |
static NvModelGL * | CreateFromPreprocessed (uint8_t *data) |
Create a renderable model from a preprocessed "NVM" file, which is much faster and more efficient to load than OBJ. | |
static NvModelGL * | CreateFromModel (NvModel *model) |
Create a renderable model from an unoptimized NvModel object. | |
Public Attributes | |
nv::vec3f | m_center |
The computed center of the bounding box of the app. |
Detailed Description
Drawable geometric model using GL VBOs.Supports loading from OBJ file data. Contains positions as well as optional normals, UVs, and tangent vectors
Member Function Documentation
Create a renderable model from an unoptimized NvModel object.
- Parameters:
-
[in] model the unoptimized model to be converted
- Returns:
- a pointer to the new model
static NvModelGL* NvModelGL::CreateFromObj | ( | uint8_t * | data, | |
float | scale, | |||
bool | computeNormals = false , |
|||
bool | computeTangents = false | |||
) | [static] |
Create a renderable model from OBJ data.
- Parameters:
-
[in] data pointer to OBJ file data [in] scale the target radius to which we want the model scaled, or <0 if no scaling should be done [in] computeNormals indicate whether per-vertex normals should be estimated and added [in] computeTangents indicate whether per-vertex tangent vectors should be estimated and added
- Returns:
- a pointer to the new model
static NvModelGL* NvModelGL::CreateFromPreprocessed | ( | uint8_t * | data | ) | [static] |
Create a renderable model from a preprocessed "NVM" file, which is much faster and more efficient to load than OBJ.
- Parameters:
-
[in] data pointer to NVM file data
- Returns:
- a pointer to the new model
void NvModelGL::drawElements | ( | GLint | positionHandle, | |
GLint | normalHandle, | |||
GLint | texcoordHandle, | |||
GLint | tangentHandle | |||
) |
Draw the model using the current shader (positions, UVs, normals and tangents) Binds the vertex position, UV, normal and tangent arrays to the given attribute array indices and draws the model with the currently bound shader.
- Parameters:
-
[in] positionHandle the vertex attribute array index that represents position in the current shader [in] normalHandle the vertex attribute array index that represents normals in the current shader [in] texcoordHandle the vertex attribute array index that represents UVs in the current shader [in] tangentHandle the vertex attribute array index that represents tangents in the current shader
void NvModelGL::drawElements | ( | GLint | positionHandle, | |
GLint | normalHandle, | |||
GLint | texcoordHandle | |||
) |
Draw the model using the current shader (positions, UVs and normals) Binds the vertex position, UV and normal arrays to the given attribute array indices and draws the model with the currently bound shader.
- Parameters:
-
[in] positionHandle the vertex attribute array index that represents position in the current shader [in] normalHandle the vertex attribute array index that represents normals in the current shader [in] texcoordHandle the vertex attribute array index that represents UVs in the current shader
void NvModelGL::drawElements | ( | GLint | positionHandle, | |
GLint | normalHandle | |||
) |
Draw the model using the current shader (positions and normals) Binds the vertex position and normal arrays to the given attribute array indices and draws the model with the currently bound shader.
- Parameters:
-
[in] positionHandle the vertex attribute array index that represents position in the current shader [in] normalHandle the vertex attribute array index that represents normals in the current shader
void NvModelGL::drawElements | ( | GLint | positionHandle | ) |
Draw the model using the current shader (positions) Binds the vertex position array to the given attribute array index and draws the model with the currently bound shader.
- Parameters:
-
[in] positionHandle the vertex attribute array index that represents position in the current shader
NvModel* NvModelGL::getModel | ( | ) |
Get the low-level geometry data.
Returns the underlying geometry model data instance
- Returns:
- a pointer to the NvModel instance that holds the client-memory data
The documentation for this class was generated from the following file: