Public Member Functions | Protected Member Functions | Friends

FBModelVertexData Class Reference

Search for all occurrences

Detailed Description

Definition at line 1619 of file fbmodel.h.

#include <fbmodel.h>

Inheritance diagram for FBModelVertexData:
Inheritance graph
[legend]

List of all members.

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

Constructor & Destructor Documentation

FBModelVertexData ( HFBModel  pModel ) [protected]

Member Function Documentation

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.

Parameters:
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.

Parameters:
pSubRegionIndex Index of the sub region.
void DrawSubRegion ( int  pSubRegionIndex,
bool  pWireFrame = false 
)

Draw Sub Region.

Must be called between Enable/DisableOGLVertexData function calls.

Parameters:
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.

Parameters:
[out] return the count of those duplicated vertexs.
Returns:
A pointer to the original vertex ID mapping for 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.

Parameters:
pArrayId vertex array type to return.
pAfterDeform return deformed vertex array format if pAfterDeform is true, otherwise return original.
Returns:
VertexArray Format.
void* GetVertexArray ( FBGeometryArrayID  pArrayId,
bool  pAfterDeform = true 
)

Return Vertex Array Pointer.

Parameters:
pArrayId vertex array type to return.
pAfterDeform return deformed vertex array if pAfterDeform is true, otherwise return original.
Returns:
VertexArray Pointer. Deformed position & normal vertex arrays could be NULL if not request mapping vertex array.
unsigned int GetVertexArrayVBOId ( FBGeometryArrayID  pArrayId,
bool  pAfterDeform = true 
)

Return Vertex Buffer Object (VBO) Id for the request array.

Parameters:
pArrayId vertex array type to return.
pAfterDeform return deformed vertex array VBO id if pAfterDeform is true, otherwise return original.
Returns:
VertexArray VBO id. Deformed position & normal vertex VBOId could be 0 is model use CPU skinning.
void* GetVertexArrayVBOOffset ( FBGeometryArrayID  pArrayId,
bool  pAfterDeform = true 
)

Return Vertex Buffer Object (VBO) offset for the request array.

Parameters:
pArrayId vertex array type to return.
pAfterDeform return deformed vertex array VBO offset if pAfterDeform is true, otherwise return original.
Returns:
VertexArray VBO offset.
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.

Parameters:
pTextrueMapping Texture Mapping Mode.
pUVset UVSet name if pTextureMapping is kFBTextureMappingUV, otherwise ignore.
Returns:
UVSet Array Format.
void* GetUVSetArray ( FBTextureMapping  pTextrueMapping = kFBTextureMappingUV,
const char *  pUVSet = NULL 
)

Return UV Array Pointer.

Parameters:
pTextrueMapping Texture Mapping Mode.
pUVset UVSet name if pTextureMapping is kFBTextureMappingUV, otherwise ignore.
Returns:
UVSet Array Pointer.
unsigned int GetUVSetVBOId ( FBTextureMapping  pTextrueMapping = kFBTextureMappingUV,
const char *  pUVSet = NULL 
)

Return UVSet Buffer Object (VBO) Id.

Parameters:
pTextrueMapping Texture Mapping Mode.
pUVset UVSet name if pTextureMapping is kFBTextureMappingUV, otherwise ignore.
Returns:
UVSet VBO Id.
void* GetUVSetVBOOffset ( FBTextureMapping  pTextrueMapping = kFBTextureMappingUV,
const char *  pUVSet = NULL 
)

Return UVSet Buffer Object (VBO) offset.

Parameters:
pTextrueMapping Texture Mapping Mode.
pUVset UVSet name if pTextureMapping is kFBTextureMappingUV, otherwise ignore.
Returns:
UVSet VBO Offset.

Friends And Related Function Documentation

friend class DataFBModel [friend]

Definition at line 1624 of file fbmodel.h.


The documentation for this class was generated from the following file:

FBModelVertexData FBModelVertexData FBModelVertexData FBModelVertexData FBModelVertexData FBModelVertexData FBModelVertexData FBModelVertexData FBModelVertexData FBModelVertexData
FBModelVertexData FBModelVertexData FBModelVertexData FBModelVertexData FBModelVertexData FBModelVertexData FBModelVertexData FBModelVertexData FBModelVertexData FBModelVertexData