GL Studio C++ Runtime API
|
#include <gls_geometry_resource.h>
Classes | |
struct | VertexSortData |
struct | VertexStructureDefinition |
Public Member Functions | |
virtual unsigned int | StatsIndexBufferVertexCount (unsigned int bufferNumber) DISTI_METHOD_OVERRIDE |
virtual unsigned int | StatsIndexBufferPolygonCount (unsigned int bufferNumber) DISTI_METHOD_OVERRIDE |
virtual unsigned int | GetDataChangedCounter () const DISTI_METHOD_OVERRIDE |
virtual void | GetExtents (Vector &min, Vector &max, const GlsMatrixType *matrix=NULL) DISTI_METHOD_OVERRIDE |
virtual void | UpdateBoundingVolume () DISTI_METHOD_OVERRIDE |
virtual bool | BoundingVolumeHit (const Vector &point, const Vector &direction) DISTI_METHOD_OVERRIDE |
virtual bool | HitTest (unsigned char pickType, const Vector &pickLinePoint, const Vector &pickLineDirection, Vector &collisionPoint) DISTI_METHOD_OVERRIDE |
virtual void | DrawSetup (VertexAttribIndexLookup *shaderProgram) DISTI_METHOD_OVERRIDE |
virtual void | DrawIndexBuffer (unsigned int bufferNumber) DISTI_METHOD_OVERRIDE |
virtual void | DrawCleanup (VertexAttribIndexLookup *shaderProgram) DISTI_METHOD_OVERRIDE |
virtual void | FreeOpenGLBuffers () DISTI_METHOD_OVERRIDE |
void | CopyVertexAndIndexBuffers (GlsGeometry_Generic *rhs) |
void | ChangeType (const TypeDesc &type) |
bool | LockBuffers () |
void | UnlockBuffers () |
unsigned int | VertexCount () const |
void | VertexCount (unsigned int count) |
void | SetVertex (GLuint vertIndex, const float *value) |
void | SetVertex (GLuint vertIndex, const Vector *value) |
void | SetVertices (const float *floatArray, unsigned int numVertices, unsigned int startVertIndex=0, unsigned int stride=VERTEX_ATTRIBUTE_SIZE) |
void | SetVertex (GLuint vertIndex, float x, float y, float z) |
const float * | GetVertex (GLuint vertIndex) |
void | SetNormal (GLuint vertIndex, float x, float y, float z) |
void | SetNormals (const float *floatArray, unsigned int numVertices, unsigned int startVertIndex=0, unsigned int stride=NORMAL_ATTRIBUTE_SIZE) |
const float * | GetNormal (GLuint vertIndex) |
void | SetColor (GLuint vertIndex, unsigned char red, unsigned char green, unsigned char blue, unsigned char alpha) |
void | SetColors (const unsigned int *rgbaArray, unsigned int numVertices, unsigned int startVertIndex=0, unsigned int stride=COLOR_ATTRIBUTE_SIZE) |
void | SetColors (const unsigned int *array) |
unsigned char * | GetColor (GLuint vertIndex) |
void | SetSecondaryColor (GLuint vertIndex, unsigned char red, unsigned char green, unsigned char blue) |
void | SetSecondaryColors (const unsigned int *rgbArray, unsigned int numVertices, unsigned int startVertIndex=0, unsigned int stride=SECONDARY_COLOR_ATTRIBUTE_SIZE) |
unsigned char * | GetSecondaryColor (GLuint vertIndex) |
void | SetTextureCoord (GLuint vertIndex, unsigned int whichTexture, const float *textureCoord) |
void | SetTextureCoord (GLuint vertIndex, unsigned int whichTexture, float textureCoordU, float textureCoordV) |
const float * | GetTextureCoord (GLuint vertIndex, unsigned int whichTexture) |
void | StoreVertexAttrib (GLuint vertIndex, GLuint attribIndex, void *value, GLuint sizeBytes) |
void | SetVertexAttrib1fv (GLuint vertIndex, GLuint attribIndex, const GLfloat *v) |
void | SetVertexAttrib2fv (GLuint vertIndex, GLuint attribIndex, const GLfloat *v) |
void | SetVertexAttrib3fv (GLuint vertIndex, GLuint attribIndex, const GLfloat *v) |
void | SetVertexAttrib4fv (GLuint vertIndex, GLuint attribIndex, const GLfloat *v) |
void * | GetVertexAttrib (GLuint vertIndex, GLuint attribIndex) |
void | NumIndexBuffers (unsigned int count) |
unsigned int | GetIndexBufferSize (unsigned int bufferNum) const |
void | SetIndexBufferSize (unsigned int bufferNum, unsigned int newSize) |
void | SetIndex (unsigned int bufferNum, unsigned int index, unsigned int indexValue) |
void | SetIndices (unsigned int bufferNum, const unsigned int *indexArray, unsigned int numIndices, unsigned int startIndex=0, unsigned int stride=sizeof(unsigned int)) |
unsigned int | GetIndex (unsigned int bufferNum, unsigned int index) |
void | MergeIndexBuffers (unsigned int dstBufferNum, unsigned int srcBufferNum) |
void | VertexSort (VertexSortData *sortData) |
void | DumpVertices () |
void | DumpNormals () |
void | DumpIndices () |
unsigned int | NumIndexBuffers () const |
Public Member Functions inherited from GlsGeometryResource | |
void | AddObserver (Observer *observer) |
void | RemoveObserver (Observer *observer) |
virtual void | DrawSetup (VertexAttribIndexLookup *shaderProgram)=0 |
virtual void | DrawIndexBuffer (unsigned int bufferNumber)=0 |
virtual void | DrawCleanup (VertexAttribIndexLookup *shaderProgram)=0 |
virtual void | FreeOpenGLBuffers ()=0 |
virtual unsigned int | GetDataChangedCounter () const =0 |
virtual void | GetExtents (Vector &min, Vector &max, const GlsMatrixType *matrix=NULL)=0 |
virtual void | UpdateBoundingVolume ()=0 |
virtual bool | BoundingVolumeHit (const Vector &point, const Vector &direction)=0 |
virtual bool | HitTest (unsigned char pickType, const Vector &pickLinePoint, const Vector &pickLineDirection, Vector &collisionPoint)=0 |
virtual unsigned int | StatsIndexBufferVertexCount (unsigned int bufferNumber)=0 |
virtual unsigned int | StatsIndexBufferPolygonCount (unsigned int bufferNumber)=0 |
const TypeDesc & | Type () |
void | IncrementReference () |
void | DecrementReference () |
unsigned int | NumIndexBuffers () const |
const Vector & | BoundingVolumeCenter () const |
float | BoundingVolumeRadius () const |
void | SetResourceId (unsigned int id) |
unsigned int | GetResourceId () |
Protected Member Functions | |
void | CopyVertexBufferOnly (GlsGeometry_Generic *rhs) |
bool | BestHit (const Vector &point, const Vector &directionVector, Vector &collisionPoint) |
bool | FirstHit (const Vector &point, const Vector &directionVector, Vector &collisionPoint) |
void | InitializeMembers () |
Shared initialization code used by all constructors. | |
void | InitFromBinaryResource (GlsResourceFileMgr::BinaryResource *resource) |
unsigned int | GetTexcoordByteOffset (unsigned int whichTexture) |
void | Destroy () DISTI_METHOD_OVERRIDE |
Protected Member Functions inherited from GlsGeometryResource | |
void | OnGeometryResourceChanged () |
Called to call all observer callbacks when the attribute changes. | |
virtual void | Destroy ()=0 |
Protected Attributes | |
bool | _bufferLock |
Flag indicating that the vertex buffer is being written to. | |
char * | _vertexBuffer |
Underlying storage for vertices. | |
unsigned int | _vertexBufferCount |
The number of vertices in the buffer. | |
GLuint | _vertexBufferID |
The OpenGL index for this vertex buffer object. | |
bool | _vertexBufferUpdated |
Is the video card vertex buffer up to date? | |
GlsGeometry_Generic_IndexBufferData * | _indexBuffers |
VertexStructureDefinition | _structure |
Describes the internal storage pattern for vertices, i.e. does it have colors? textures? normals? | |
Protected Attributes inherited from GlsGeometryResource | |
DynamicArray< Observer * > | _observers |
The held list of observers w/ callbacks. | |
unsigned int | _resourceID |
unsigned int | _referenceCount |
TypeDesc | _type |
unsigned int | _numIndexBuffers |
Vector | _boundingVolumeCenter |
Center location of the bounding volume. | |
float | _boundingVolumeRadius |
Radius of the bounding volume. | |
Additional Inherited Members | |
Public Types inherited from GlsGeometryResource | |
enum | BadId { BAD_ID = 0xffffffff } |
Static Public Attributes inherited from GlsGeometryResource | |
static const unsigned int | MAX_TEXTURE_COORDS = 2 |
GL_MAX_TEXTURE_COORDS. GlsGeometryResource currently only supports two sets of texture coordinates. | |
static const unsigned int | MAX_VERTEX_ATTRIBS = 16 |
GL_MAX_VERTEX_ATTRIBS. | |
static const unsigned int | VERTEX_ATTRIBUTE_SIZE = 3 * sizeof( float ) |
Size of vertex storage, in bytes. | |
static const unsigned int | NORMAL_ATTRIBUTE_SIZE = 3 * sizeof( float ) |
Size of normal storage, in bytes. | |
static const unsigned int | COLOR_ATTRIBUTE_SIZE = 4 * sizeof( unsigned char ) |
Size of color storage, in bytes. | |
static const unsigned int | SECONDARY_COLOR_ATTRIBUTE_SIZE = 3 * sizeof( unsigned char ) |
Size of secondary color storage, in bytes. | |
static const unsigned int | TEXTURE_COORDINATE_ATTRIBUTE_SIZE = 2 * sizeof( float ) |
Size of texture coordinate storage, in bytes. | |
static const unsigned int | TANGENT_ATTRIBUTE_SIZE = 3 * sizeof( float ) |
Size of tangent storage, in bytes. | |
static const unsigned int | BINORMAL_ATTRIBUTE_SIZE = 3 * sizeof( float ) |
Size of binormal storage, in bytes. | |
static const unsigned int | s_invalidDataChangedCounter = 0 |
Static Protected Attributes inherited from GlsGeometryResource | |
static bool | _enableVBO |
If true, OpenGL supports vertex buffer objects (1.5 or greater). | |
Flexible implementation of GlsGeometryResource that can store any type of geometry This resource is used in the editor and may be used at runtime if there is not a more efficient implementation for the desired TypeDesc.
|
protected |
Utility routine used by Hit. Performs a "BestHit" test, which performs a hit test on the object and guarantees that the collision point returned by Hit is the closest collision point to the observer.
point | The geometry coordinate of the click, relative to the object |
directionVector | The direction of the pick vector |
collisionPoint | Set to the point on the object hit by directionVector |
Determines if the given ray hits the geometry bounding volume. Note: All parameters should be in this object's coordinates.
point | The starting point of the ray. |
direction | The direction vector of the ray. |
Implements GlsGeometryResource.
void ChangeType | ( | const TypeDesc & | type | ) |
Changes the Type of this geometry resource. This is a slow operation; it creates new storage according to the typeDesc and copys the existing vertex data. If a vertex attribute does not map to the new type it will be lost. Any new attributes will be uninitialized. Requires that the OpenGL context is current if this GlsGeometryResource has been previously drawn.
type | The TypeDesc to use for the new structure |
void CopyVertexAndIndexBuffers | ( | GlsGeometry_Generic * | rhs | ) |
Copy the geometry from another resource into this one. Does not change the Type of this resource: only vertex attributes that both resources have in common will be copied.
rhs | the resource to copy from |
|
protected |
Copies vertex data from this buffer into the incoming geometry object.
rhs | The object to copy vertex data into. |
|
static |
Copy vertex attributes from srcGeom to dstGeom Does not change the Type of the resource: only vertex attributes that both resources have in common will be copied.
dstGeom | the resource to copy to |
dstOffset | vertex offset to start copying at |
srcGeom | the resource to copy from |
srcOffset | vertex offset to start copying from |
vertexCount | number of vertices to copy |
|
static |
Create an empty GlsGeometry_Generic with default TypeDesc.
|
static |
Create GlsGeometry_Generic from binary resource.
data | The data to create object from. |
|
static |
Create GlsGeometry_Generic from TypeDesc.
type | The storage format type to use. |
|
static |
Construct a GlsGeometryResource from a binary resource The initial reference count is 1. Call DecrementReference to free the GlsGeometryResource when you are done with it.
resource | pointer to a ResourceRef containing geometry data |
|
protectedvirtual |
Deletes this object from the heap that it was allocated on
Implements GlsGeometryResource.
|
virtual |
Restore the OpenGL state after rendering.
shaderProgram | Must be the same value that was passed to DrawSetup |
Implements GlsGeometryResource.
|
virtual |
Draw the geometry specified by the given index buffer This method should only be called between calls to DrawSetup and DrawCleanup.
bufferNumber | Which index buffer to draw |
Implements GlsGeometryResource.
|
virtual |
Setup the OpenGL state for rendering this geometry. To draw, call DrawIndexBuffer for each index buffer in the resource. After drawing, call DrawCleanup to restore the OpenGL state.
shaderProgram | interface to the shader program, used to lookup correct VertexAttrib index values (may be NULL) |
Implements GlsGeometryResource.
void DumpIndices | ( | ) |
Dump all the Indices to the terminal
void DumpNormals | ( | ) |
Dump all the Normals to the terminal
void DumpVertices | ( | ) |
Dump all the vertices to the terminal
|
protected |
Utility routine used by Hit. Performs a "FirstHit" test, which performs a hit test on the object but does not guarantee that the collision point returned by Hit is the closest collision point to the observer
point | The logical coordinate of the click, relative to the object |
directionVector | The direction of the pick vector |
collisionPoint | Set to the point on the object hit by directionVector |
|
virtual |
Force the GlsGeometryResource to free any buffers it has allocated in the current OpenGL context.
Implements GlsGeometryResource.
|
static |
Generate tangents/binormals for all vertices in the given GlsGeometryResource and adds them as vertex attributes.
geom | The vertices to generate from. |
unsigned char * GetColor | ( | GLuint | vertIndex | ) |
Gets the color value of the given vertex index
vertIndex | The index of the color value to get, 0 to VertexCount() - 1 |
|
virtual |
Since calculating metrics like the extents can be an expensive operation, the user can call this function to see if the geometry resource has changed. Caching the expensive-to-calculate values is the responsibility of the caller.
Implements GlsGeometryResource.
|
virtual |
Calculate and return the geometry extents
min | Returns the minimum x,y,z values |
max | Returns the maximum x,y,z values |
matrix | (Optional) matrix to transform the vertices into the desired coordinate system |
Implements GlsGeometryResource.
unsigned int GetIndex | ( | unsigned int | bufferNum, |
unsigned int | index | ||
) |
Gets an index from an index buffer
bufferNum | Which index buffer to read from |
index | The index of the Index to get, 0 to GetIndexBufferSize(bufferNum) - 1 |
unsigned int GetIndexBufferSize | ( | unsigned int | bufferNum | ) | const |
Gets the size of an index buffer
bufferNum | Which index buffer to return the size of |
const float * GetNormal | ( | GLuint | vertIndex | ) |
Get a pointer to the Normal for a given Vertex index. Do not change the Normal, change it through the Set function!
vertIndex | The index of the Normal to get, 0 to VertexCount() - 1 |
unsigned char * GetSecondaryColor | ( | GLuint | vertIndex | ) |
Get the secondary color of the vertex at the given index.
vertIndex | The index of the secondary color value to get, 0 to VertexCount() - 1 |
|
protected |
whichTexture | The texture index to locate. |
const float * GetTextureCoord | ( | GLuint | vertIndex, |
unsigned int | whichTexture | ||
) |
Get a TextureCoord
vertIndex | The index of the TextureCoord value to change, 0 to VertexCount() - 1 |
whichTexture | Which set of texture coordinates to change, 0 to NumTextureCoordinateArrays() - 1. |
const float * GetVertex | ( | GLuint | vertIndex | ) |
Return a pointer to an array of 3 or 4 floats which is the vertex for the given index.
vertIndex | The index of the vertex to get, 0 to VertexCount() - 1 |
void * GetVertexAttrib | ( | GLuint | vertIndex, |
GLuint | attribIndex | ||
) |
Get pointer to the raw vertex attribute data, be careful with this!
vertIndex | The index of the vertex. |
attribIndex | The index of the generic vertex attribute. |
|
virtual |
Hit test the geometry against a picking line. All values are in geometry space.
pickType | The type of picking (see PickableType_e), must be PICK_FIRST or PICK_BEST |
pickLinePoint | A point on the pick line. |
pickLineDirection | The direction of the pick line. |
collisionPoint | If the method returns true, this contains the point that was hit. |
Implements GlsGeometryResource.
|
protected |
Initialize this object from the incoming binary resource.
resource | The binary resource to initialize with. |
bool LockBuffers | ( | ) |
Attempt to Lock the Buffers, Non-Blocking
void MergeIndexBuffers | ( | unsigned int | dstBufferNum, |
unsigned int | srcBufferNum | ||
) |
Merge two index buffers by adding the indexes from the source buffer to the dest buffer, then deleting the source buffer.
dstBufferNum | Which index buffer to add to. |
srcBufferNum | Which index buffer to delete. |
|
inline |
void NumIndexBuffers | ( | unsigned int | count | ) |
Get the number of available index buffers
count | Set the number of index buffers in this geometry resource. |
void SetColor | ( | GLuint | vertIndex, |
unsigned char | red, | ||
unsigned char | green, | ||
unsigned char | blue, | ||
unsigned char | alpha | ||
) |
Set a color value
vertIndex | The index of the color value to change, 0 to VertexCount() - 1 |
red | Red |
green | Green |
blue | Blue |
alpha | Alpha |
void SetColors | ( | const unsigned int * | array | ) |
Initialize Color from an array
array | an array of color values in RGBA order of size VertexCount() |
void SetColors | ( | const unsigned int * | rgbaArray, |
unsigned int | numVertices, | ||
unsigned int | startVertIndex = 0 , |
||
unsigned int | stride = COLOR_ATTRIBUTE_SIZE |
||
) |
Initialize the vertex colors from an array of unsigned int containing rgba color data.
Steps through the array reading the color data for each vertex. The method will read 1 integer for each color.
rgbaArray | pointer to the array to read from. The array must be at least (numVertices * stride) bytes. |
numVertices | Number of vertices to read from of the array |
startVertIndex | (optional) The vertex buffer index to start copying into |
stride | (optional) The distance between each color in the rgbaArray (in bytes) |
void SetIndex | ( | unsigned int | bufferNum, |
unsigned int | index, | ||
unsigned int | indexValue | ||
) |
Change the Vertex index
bufferNum | Which index buffer to modify |
index | The index of the Index to change, 0 to GetIndexBufferSize(bufferNum)) - 1 |
indexValue | Index must be less than GetIndexBufferSize(bufferNum) |
void SetIndexBufferSize | ( | unsigned int | bufferNum, |
unsigned int | newSize | ||
) |
Set the size of the specified index buffer
bufferNum | Which index buffer to set the size of |
newSize | How many items the Index Buffer can hold. |
void SetIndices | ( | unsigned int | bufferNum, |
const unsigned int * | indexArray, | ||
unsigned int | numIndices, | ||
unsigned int | startIndex = 0 , |
||
unsigned int | stride = sizeof(unsigned int) |
||
) |
Initialize the Index buffer from an array of index values
Steps through the array reading the color data for each vertex. The method will read 3 bytes for each color.
bufferNum | Which index buffer to modify |
indexArray | pointer to the array to read from. The array must be at least (numIndices * stride) bytes. |
numIndices | Number of indices to read from of the array |
startIndex | (optional) The index buffer element to start copying into |
stride | (optional) The distance between each index in the array (in bytes) |
void SetNormal | ( | GLuint | vertIndex, |
float | x, | ||
float | y, | ||
float | z | ||
) |
Set a Normal
vertIndex | The index of the vertex to change, 0 to VertexCount() - 1 |
x | X Normal value to assign |
y | Y Normal value to assign |
z | Z Normal value to assign |
void SetNormals | ( | const float * | floatArray, |
unsigned int | numVertices, | ||
unsigned int | startVertIndex = 0 , |
||
unsigned int | stride = NORMAL_ATTRIBUTE_SIZE |
||
) |
Initialize the vertex normals from an array of floats.
Steps through the array reading the normal data for each vertex. The method will read 3 floats for each normal.
floatArray | Pointer to the array to read from. The array must be at least (numVertices * stride) bytes. |
numVertices | Number of vertices to read from of the array |
startVertIndex | (optional) The vertex buffer index to start copying into |
stride | (optional) The distance between each normal in the floatArray (in bytes) |
void SetSecondaryColor | ( | GLuint | vertIndex, |
unsigned char | red, | ||
unsigned char | green, | ||
unsigned char | blue | ||
) |
Set a secondary color value (specular)
red | Red |
green | Green |
blue | Blue |
vertIndex | The index of the secondary color value to change, 0 to VertexCount() - 1 |
void SetSecondaryColors | ( | const unsigned int * | rgbArray, |
unsigned int | numVertices, | ||
unsigned int | startVertIndex = 0 , |
||
unsigned int | stride = SECONDARY_COLOR_ATTRIBUTE_SIZE |
||
) |
Initialize the vertex secondary colors from an array of unsigned int containing rgb color data. (Secondary colors do not include alpha)
Steps through the array reading the color data for each vertex. The method will read 3 bytes for each color.
rgbArray | pointer to the array to read from. The array must be at least (numVertices * stride) bytes. |
numVertices | Number of vertices to read from of the array |
startVertIndex | (optional) The vertex buffer index to start copying into |
stride | (optional) The distance between each color in the array (in bytes) |
void SetTextureCoord | ( | GLuint | vertIndex, |
unsigned int | whichTexture, | ||
const float * | textureCoord | ||
) |
Set a TextureCoord
textureCoord | TextureCoord value to assign. Must point to a float array containing TextureCoordinateDepth() elements |
vertIndex | The index of the TextureCoord value to change, 0 to VertexCount() - 1 |
whichTexture | Which set of texture coordinates to change, 0 to NumTextureCoordinateArrays() - 1. |
void SetTextureCoord | ( | GLuint | vertIndex, |
unsigned int | whichTexture, | ||
float | textureCoordU, | ||
float | textureCoordV | ||
) |
Two float version of SetTextureCoord().
vertIndex | The index of the TextureCoord value to change, 0 to VertexCount() - 1. |
whichTexture | Which set of texture coordinates to change, 0 to NumTextureCoordinateArrays() - 1. |
textureCoordU | The new U coordinate to set. |
textureCoordV | The new V coordinate to set. |
void SetVertex | ( | GLuint | vertIndex, |
const float * | value | ||
) |
Set a vertex
vertIndex | The index of the vertex to change, 0 to VertexCount() - 1 |
*value | Vertex can either be 3 or 4 floats depending on the type |
|
inline |
Vector version of SetVertex().
vertIndex | The index of the vertex to change, 0 to VertexCount() - 1. |
value | The Vector to set, uses its internal float array. |
void SetVertex | ( | GLuint | vertIndex, |
float | x, | ||
float | y, | ||
float | z | ||
) |
Set the vertex at a given index to a coordinate
vertIndex | The index of the vertex to change, 0 to VertexCount() - 1 |
x | The x-coord |
y | The y-coord |
z | The z-coord |
|
inline |
One float version of StoreVertexAttrib().
vertIndex | The index of the vertex. |
attribIndex | The index of the generic vertex attribute to be modified. |
v | A pointer to an array of floats. |
|
inline |
Two float version of StoreVertexAttrib().
vertIndex | The index of the vertex. |
attribIndex | The index of the generic vertex attribute to be modified. |
v | A pointer to an array of floats. |
|
inline |
Three float version of StoreVertexAttrib().
vertIndex | The index of the vertex. |
attribIndex | The index of the generic vertex attribute to be modified. |
v | A pointer to an array of floats. |
|
inline |
Four float version of StoreVertexAttrib().
vertIndex | The index of the vertex. |
attribIndex | The index of the generic vertex attribute to be modified. |
v | A pointer to an array of floats. |
|
static |
Return the appropriate VertexStructureDefinition type derived from the incoming TypeDesc.
vertStruct | The returned vertex structure. |
type | The type to generate a vertex structure definiton for. |
void SetVertices | ( | const float * | floatArray, |
unsigned int | numVertices, | ||
unsigned int | startVertIndex = 0 , |
||
unsigned int | stride = VERTEX_ATTRIBUTE_SIZE |
||
) |
Initialize the vertex data from an array of floats.
Steps through the array reading the data for each vertex. If Type() is POSITION_XYZ, the method will read 3 floats per vertex. If Type() is POSITION_XYZW, the method will read 4 floats per vertex.
floatArray | Pointer to the array to read from. The array must be at least (numVertices * stride) bytes. |
numVertices | Number of vertices to read from of the array |
startVertIndex | (optional) The vertex buffer index to start copying into |
stride | (optional) The distance between each vertex in the floatArray (in bytes) |
|
inlinevirtual |
bufferNumber | The index of the buffer to count up. |
Implements GlsGeometryResource.
|
inlinevirtual |
bufferNumber | The index of the buffer to count up. |
Implements GlsGeometryResource.
void StoreVertexAttrib | ( | GLuint | vertIndex, |
GLuint | attribIndex, | ||
void * | value, | ||
GLuint | sizeBytes | ||
) |
Store a generic vertex attribute value
vertIndex | The index of the vertex |
attribIndex | The index of the generic vertex attribute to be modified |
value | void pointer to the value |
sizeBytes | size of the value in bytes |
|
static |
Apply a transform to the vertex attributes of the given mesh The transform affects vertex position, normals, ATTRIB_TANGENT, and ATTRIB_BINORMAL
dstGeom | The resource to modify. |
transform | The matrix used to convert vertex attributes. |
vertexOffset | Start of the range of verts to transform. |
vertexCount | Number of verts to transform. |
void UnlockBuffers | ( | ) |
Release the lock on the buffers. Note: If the Vertex data was changed, you should typically call UpdateBoundingVolume() before unlocking.
|
virtual |
Updates the bounding volume of this object This method should be called if the vertices change for picking and culling to work correctly.
Implements GlsGeometryResource.
unsigned int VertexCount | ( | ) | const |
Get the size of the vertex buffer
void VertexCount | ( | unsigned int | count | ) |
Set the size of the vertex buffer
count | How many items the Vertex Buffer contains. |
void VertexSort | ( | VertexSortData * | sortData | ) |
Sort the vertices, based on the input data
*sortData | An array of VertexSortData structures, one for each primitive (set of three vertices). The data in this is array is used to reorder the primitives. e.g.: Input: order 0,1,0,5,2 index 0,1,2,3,4 Sorted: order 0,0,1,2,5 index 0,2,1,4,3 |
|
protected |
Index buffers array