- Main Page
- Modules
- Namespaces
- Classes
- Files
- Related Pages

- File List
- File Members

# FCDocument/FCDGeometryPolygonsTools.h

Go to the documentation of this file.

    00001 /*
    00002     Copyright (C) 2005-2007 Feeling Software Inc.
    00003     Portions of the code are:
    00004     Copyright (C) 2005-2007 Sony Computer Entertainment America
    00005
    00006     MIT License: http://www.opensource.org/licenses/mit-license.php
    00007 */
    00008
    00014 #ifndef _FCD_GEOMETRY_POLYGONS_TOOLS_H_
    00015 #define _FCD_GEOMETRY_POLYGONS_TOOLS_H_
    00016
    00017 class FCDGeometryMesh;
    00018 class FCDGeometrySource;
    00019 class FCDGeometryPolygons;
    00020 class FCDGeometryPolygonsInput;
    00021
    00024 typedef fm::map<uint32, UInt32List> FCDGeometryIndexTranslationMap;
    00025 typedef fm::pvector<FCDGeometryIndexTranslationMap> FCDGeometryIndexTranslationMapList;
    00026 typedef fm::vector<UInt32List> FCDNewIndicesList;
    00029 namespace FCDGeometryPolygonsTools
    00030 {
    00031
    00034     #define MAX_BUFFER_COUNT    ((uint16)~0)
    00035
    00038     FCOLLADA_EXPORT void Triangulate(FCDGeometryMesh* mesh);
    00039
    00044     FCOLLADA_EXPORT void Triangulate(FCDGeometryPolygons* polygons, bool recalculate = true);
    00045
    00052     FCOLLADA_EXPORT void GenerateTextureTangentBasis(FCDGeometryMesh* mesh, FCDGeometrySource* texcoordSource, bool generateBinormals = true);
    00053
    00062     FCOLLADA_EXPORT void GenerateUniqueIndices(FCDGeometryMesh* mesh, FCDGeometryPolygons* polygons = NULL, FCDGeometryIndexTranslationMap* translationMap = NULL);
    00063
    00073     FCOLLADA_EXPORT void GenerateUniqueIndices(FCDGeometryMesh* mesh, FCDGeometryPolygons* polygonsToProcess, FCDNewIndicesList& outIndices, FCDGeometryIndexTranslationMapList& outTranslationMaps);
    00074
    00081     FCOLLADA_EXPORT void ApplyUniqueIndices(float* targData, float* srcData, uint32 stride, const FCDGeometryIndexTranslationMap* translationMap);
    00082
    00089     FCOLLADA_EXPORT void ApplyUniqueIndices(FCDGeometryMesh* targMesh, FCDGeometryMesh* baseMesh, const UInt32List& newIndices, const FCDGeometryIndexTranslationMapList& translationMaps);
    00090
    00097     FCOLLADA_EXPORT void RevertUniqueIndices(const FCDGeometryPolygonsInput& inSrc, FCDGeometryPolygonsInput& outSrc, const FCDGeometryIndexTranslationMap& translationMap);
    00098
    00106     FCOLLADA_EXPORT void PackVertexBufferV3(uint8* destBuffer, uint32 destBuffStride,
    00107         const FCDGeometrySource* source, uint32 vCount, uint16* vtxPackingMap,
    00108         const FCDGeometryIndexTranslationMap& translationMap);
    00109
    00117     FCOLLADA_EXPORT void PackVertexBufferColor(uint8* destBuffer, uint32 destBuffStride,
    00118         const FCDGeometrySource* source, uint32 vCount, uint16* vtxPackingMap,
    00119         const FCDGeometryIndexTranslationMap& translationMap);
    00120
    00128     FCOLLADA_EXPORT void PackVertexBufferV2(uint8* destBuffer, uint32 destBuffStride,
    00129         const FCDGeometrySource* source, uint32 vCount, uint16* vtxPackingMap,
    00130         const FCDGeometryIndexTranslationMap& translationMap);
    00131
    00141     FCOLLADA_EXPORT uint16 GenerateVertexPackingMap(size_t maxIndex, size_t maxIndices, size_t maxVertices, const uint32* inIndices,
    00142         uint16* outIndices, UInt16List* outPackingMap, uint16* outNVertices=NULL);
    00143
    00148     FCOLLADA_EXPORT uint32 FindLargestUniqueIndex(const FCDGeometryIndexTranslationMap& translationMap);
    00149
    00156     FCOLLADA_EXPORT void FitIndexBuffers(FCDGeometryMesh* mesh, size_t maximumIndexCount);
    00157
    00162     FCOLLADA_EXPORT void ReverseNormals(FCDGeometryMesh* mesh);
    00163 };
    00164
    00165 #endif // _FCD_GEOMETRY_POLYGONS_TOOLS_H_