PVRTBoneBatch.h 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. /******************************************************************************
  2. @File PVRTBoneBatch.h
  3. @Title PVRTBoneBatch
  4. @Version
  5. @Copyright Copyright (C) Imagination Technologies Limited.
  6. @Platform ANSI compatible
  7. @Description Utility functions which process vertices.
  8. ******************************************************************************/
  9. #ifndef _PVRTBONEBATCH_H_
  10. #define _PVRTBONEBATCH_H_
  11. #include "PVRTVertex.h"
  12. /*!***************************************************************************
  13. Handles a batch of bones
  14. *****************************************************************************/
  15. /*!***************************************************************************
  16. @Class CPVRTBoneBatches
  17. @Brief A class for processing vertices into bone batches
  18. *****************************************************************************/
  19. class CPVRTBoneBatches
  20. {
  21. public:
  22. int *pnBatches; /*!< Space for nBatchBoneMax bone indices, per batch */
  23. int *pnBatchBoneCnt; /*!< Actual number of bone indices, per batch */
  24. int *pnBatchOffset; /*!< Offset into triangle array, per batch */
  25. int nBatchBoneMax; /*!< Stored value as was passed into Create() */
  26. int nBatchCnt; /*!< Number of batches to render */
  27. /*!***********************************************************************
  28. @Function Create
  29. @Output pnVtxNumOut vertex count
  30. @Output pVtxOut Output vertices (program must free() this)
  31. @Modified pui32Idx index array for triangle list
  32. @Input nVtxNum vertex count
  33. @Input pVtx vertices
  34. @Input nStride Size of a vertex (in bytes)
  35. @Input nOffsetWeight Offset in bytes to the vertex bone-weights
  36. @Input eTypeWeight Data type of the vertex bone-weights
  37. @Input nOffsetIdx Offset in bytes to the vertex bone-indices
  38. @Input eTypeIdx Data type of the vertex bone-indices
  39. @Input nTriNum Number of triangles
  40. @Input nBatchBoneMax Number of bones a batch can reference
  41. @Input nVertexBones Number of bones affecting each vertex
  42. @Returns PVR_SUCCESS if successful
  43. @Description Fills the bone batch structure
  44. *************************************************************************/
  45. EPVRTError Create(
  46. int * const pnVtxNumOut,
  47. char ** const pVtxOut,
  48. unsigned int * const pui32Idx,
  49. const int nVtxNum,
  50. const char * const pVtx,
  51. const int nStride,
  52. const int nOffsetWeight,
  53. const EPVRTDataType eTypeWeight,
  54. const int nOffsetIdx,
  55. const EPVRTDataType eTypeIdx,
  56. const int nTriNum,
  57. const int nBatchBoneMax,
  58. const int nVertexBones);
  59. /*!***********************************************************************
  60. @Function Release
  61. @Description Destroy the bone batch structure
  62. *************************************************************************/
  63. void Release()
  64. {
  65. { delete pnBatches; pnBatches = 0; }
  66. { delete pnBatchBoneCnt; pnBatchBoneCnt = 0; }
  67. { delete pnBatchOffset; pnBatchOffset = 0; }
  68. nBatchCnt = 0;
  69. }
  70. };
  71. #endif /* _PVRTBONEBATCH_H_ */
  72. /*****************************************************************************
  73. End of file (PVRTBoneBatch.h)
  74. *****************************************************************************/