#include <fbmodel.h>
Public Member Functions |
|
bool | IsDeformable () |
Return true if the model is deformable.
|
|
bool | IsDrawable () |
Return true if the deformed vertex data has
been computed for this frame. |
|
int | GetVertexCount () |
Return the Vertex Count. |
|
Sub Patch Management. Each sub patch
contain same type of primitives mapped with same material.
|
|
int | GetSubPatchCount () |
Return number of sub patches. |
|
int | GetSubPatchMaterialId (int pSubPatchIndex) |
Return the mapped material for this sub
patch. |
|
FBMaterial * | GetSubPatchMaterial (int pSubPatchIndex) |
Return the mapped material for this sub
patch. |
|
FBGeometryPrimitiveType | GetSubPatchPrimitiveType (int pSubPatchIndex) |
Return the primitive type for this sub
patch. |
|
int | GetSubPatchIndexOffset (int pSubPatchIndex) |
Return the start offset of the indexes for
this sub patch (see GetIndexArray()). |
|
int | GetSubPatchIndexSize (int pSubPatchIndex) |
Return the size of the indexes for this sub
patch (see GetIndexArray()). |
|
void | DrawSubPatch (int pSubPatchIndex, bool pWireFrame=false) |
Draw Sub Patch. |
|
Sub Regions Management. Each Sub Regions
are composed by one or several patches which
|
|
are composed with same material. |
|
int | GetSubRegionCount () |
Return number of sub regions (mapping with
different materials) |
|
FBMaterial * | GetSubRegionMaterial (int pSubRegionIndex) |
Return sub region's material. |
|
void | DrawSubRegion (int pSubRegionIndex, bool pWireFrame=false) |
Draw Sub Region. |
|
Vertex Array Management
|
|
void | EnableOGLVertexData (bool pAfterdeform=true) |
Enable (Setup) OpenGL Vertex Array (Pos
& Normal) |
|
void | DisableOGLVertexData () |
Disable OpenGL Vertex Array (Pos &
Normal) |
|
void | VertexArrayMappingRequest () |
Deformable model can be skinned on GPU, and
thus the deformed vertex data could reside in GPU memory only.
|
|
const int * | GetVertexArrayDuplicationMap (unsigned int &pDuplicatedVertexCound) |
The FBModel::TessellatedMesh
could contain per-face mapping UVset/Normal or other layer
elements. |
|
void | VertexArrayMappingRelease () |
Release vertex array mapping. |
|
int * | GetIndexArray () |
Return Index Array. |
|
unsigned int | GetIndexArrayVBOId () |
Return Index Array VBO Id. |
|
FBGeometryArrayElementType | GetVertexArrayType (FBGeometryArrayID pArrayId, bool pAfterDeform=true) |
Return Vertex Array Format. |
|
void * | GetVertexArray (FBGeometryArrayID pArrayId, bool pAfterDeform=true) |
Return Vertex Array Pointer. |
|
unsigned int | GetVertexArrayVBOId (FBGeometryArrayID pArrayId, bool pAfterDeform=true) |
Return Vertex Buffer Object (VBO) Id for the
request array. |
|
void * | GetVertexArrayVBOOffset (FBGeometryArrayID pArrayId, bool pAfterDeform=true) |
Return Vertex Buffer Object (VBO) offset for
the request array. |
|
UVset Array Management
|
|
void | EnableOGLUVSet (FBTextureMapping pTextrueMapping=kFBTextureMappingUV, const char *pUVSet=NULL) |
Enable (Setup) OpenGL UV Set Array. |
|
void | DisableOGLUVSet () |
Disable OpenGL UV Set Array. |
|
FBGeometryArrayElementType | GetUVSetArrayFormat (FBTextureMapping pTextrueMapping=kFBTextureMappingUV, const char *pUVSet=NULL) |
Return UV Array Format. |
|
void * | GetUVSetArray (FBTextureMapping pTextrueMapping=kFBTextureMappingUV, const char *pUVSet=NULL) |
Return UV Array Pointer. |
|
unsigned int | GetUVSetVBOId (FBTextureMapping pTextrueMapping=kFBTextureMappingUV, const char *pUVSet=NULL) |
Return UVSet Buffer Object (VBO) Id.
|
|
void * | GetUVSetVBOOffset (FBTextureMapping pTextrueMapping=kFBTextureMappingUV, const char *pUVSet=NULL) |
Return UVSet Buffer Object (VBO) offset.
|
|
Protected Member Functions |
|
FBModelVertexData (HFBModel pModel) | |
Friends |
|
class | DataFBModel |
FBModelVertexData | ( | HFBModel | pModel | ) | [protected] |
bool IsDeformable | ( | ) |
Return true if the model is deformable.
bool IsDrawable | ( | ) |
Return true if the deformed vertex data has been computed for this frame.
int GetVertexCount | ( | ) |
Return the Vertex Count.
int GetSubPatchCount | ( | ) |
Return number of sub patches.
int GetSubPatchMaterialId | ( | int | pSubPatchIndex | ) |
Return the mapped material for this sub patch.
FBMaterial* GetSubPatchMaterial | ( | int | pSubPatchIndex | ) |
Return the mapped material for this sub patch.
FBGeometryPrimitiveType GetSubPatchPrimitiveType | ( | int | pSubPatchIndex | ) |
Return the primitive type for this sub patch.
Most of the time, kFBGeometry_TRIANGLES will return.
int GetSubPatchIndexOffset | ( | int | pSubPatchIndex | ) |
Return the start offset of the indexes for this sub patch (see GetIndexArray()).
int GetSubPatchIndexSize | ( | int | pSubPatchIndex | ) |
Return the size of the indexes for this sub patch (see GetIndexArray()).
void DrawSubPatch | ( | int | pSubPatchIndex, |
bool | pWireFrame =
false |
||
) |
Draw Sub Patch.
Must be called between Enable/DisableOGLVertexData function calls.
pSubRegionIndex | Index of sub region to be drawn. |
pWireFrame | draw wire frame if true. |
int GetSubRegionCount | ( | ) |
Return number of sub regions (mapping with different materials)
FBMaterial* GetSubRegionMaterial | ( | int | pSubRegionIndex | ) |
Return sub region's material.
pSubRegionIndex | Index of the sub region. |
void DrawSubRegion | ( | int | pSubRegionIndex, |
bool | pWireFrame =
false |
||
) |
Draw Sub Region.
Must be called between Enable/DisableOGLVertexData function calls.
pSubRegionIndex | Index of sub region to be drawn. |
pWireFrame | draw wire frame if true. |
void EnableOGLVertexData | ( | bool | pAfterdeform =
true |
) |
Enable (Setup) OpenGL Vertex Array (Pos & Normal)
void DisableOGLVertexData | ( | ) |
Disable OpenGL Vertex Array (Pos & Normal)
void VertexArrayMappingRequest | ( | ) |
Deformable model can be skinned on GPU, and thus the deformed vertex data could reside in GPU memory only.
By calling VertexArrayMappingRequest() to make sure we can always get the deformed vertex array on CPU. Note: this function should be called at least one frame before GetVertexArray(pArrayId, true) to give engine chance to prepare the mapping.
const int* GetVertexArrayDuplicationMap | ( | unsigned int & | pDuplicatedVertexCound | ) |
The FBModel::TessellatedMesh could contain per-face mapping UVset/Normal or other layer elements.
In order to build a valid VBO buffer for accelerated rendering, those control points with multiple attribute data must be duplicated. This function return the duplicated vertexes' ID mapping from FBModel::ModelVertexData vertex array to its FBModel::TessellatedMesh vertex array. Note those duplicated vertexs are always appended after the original vertex array.
[out] | return the count of those duplicated vertexs. |
void VertexArrayMappingRelease | ( | ) |
Release vertex array mapping.
int* GetIndexArray | ( | ) |
Return Index Array.
unsigned int GetIndexArrayVBOId | ( | ) |
Return Index Array VBO Id.
FBGeometryArrayElementType GetVertexArrayType | ( | FBGeometryArrayID | pArrayId, |
bool | pAfterDeform =
true |
||
) |
Return Vertex Array Format.
pArrayId | vertex array type to return. |
pAfterDeform | return deformed vertex array format if pAfterDeform is true, otherwise return original. |
void* GetVertexArray | ( | FBGeometryArrayID | pArrayId, |
bool | pAfterDeform =
true |
||
) |
Return Vertex Array Pointer.
pArrayId | vertex array type to return. |
pAfterDeform | return deformed vertex array if pAfterDeform is true, otherwise return original. |
unsigned int GetVertexArrayVBOId | ( | FBGeometryArrayID | pArrayId, |
bool | pAfterDeform =
true |
||
) |
Return Vertex Buffer Object (VBO) Id for the request array.
pArrayId | vertex array type to return. |
pAfterDeform | return deformed vertex array VBO id if pAfterDeform is true, otherwise return original. |
void* GetVertexArrayVBOOffset | ( | FBGeometryArrayID | pArrayId, |
bool | pAfterDeform =
true |
||
) |
Return Vertex Buffer Object (VBO) offset for the request array.
pArrayId | vertex array type to return. |
pAfterDeform | return deformed vertex array VBO offset if pAfterDeform is true, otherwise return original. |
void EnableOGLUVSet | ( | FBTextureMapping | pTextrueMapping =
kFBTextureMappingUV , |
const char * | pUVSet =
NULL |
||
) |
Enable (Setup) OpenGL UV Set Array.
void DisableOGLUVSet | ( | ) |
Disable OpenGL UV Set Array.
FBGeometryArrayElementType GetUVSetArrayFormat | ( | FBTextureMapping | pTextrueMapping =
kFBTextureMappingUV , |
const char * | pUVSet =
NULL |
||
) |
Return UV Array Format.
pTextrueMapping | Texture Mapping Mode. |
pUVset | UVSet name if pTextureMapping is kFBTextureMappingUV, otherwise ignore. |
void* GetUVSetArray | ( | FBTextureMapping | pTextrueMapping =
kFBTextureMappingUV , |
const char * | pUVSet =
NULL |
||
) |
Return UV Array Pointer.
pTextrueMapping | Texture Mapping Mode. |
pUVset | UVSet name if pTextureMapping is kFBTextureMappingUV, otherwise ignore. |
unsigned int GetUVSetVBOId | ( | FBTextureMapping | pTextrueMapping =
kFBTextureMappingUV , |
const char * | pUVSet =
NULL |
||
) |
Return UVSet Buffer Object (VBO) Id.
pTextrueMapping | Texture Mapping Mode. |
pUVset | UVSet name if pTextureMapping is kFBTextureMappingUV, otherwise ignore. |
void* GetUVSetVBOOffset | ( | FBTextureMapping | pTextrueMapping =
kFBTextureMappingUV , |
const char * | pUVSet =
NULL |
||
) |
Return UVSet Buffer Object (VBO) offset.
pTextrueMapping | Texture Mapping Mode. |
pUVset | UVSet name if pTextureMapping is kFBTextureMappingUV, otherwise ignore. |
friend class DataFBModel
[friend] |