Main Page Class List Class Members

- Main Page
- User's Guide
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

# sdk/extensions/exporter/source/NvBlastExtExporterFbxWriter.h

Go to the documentation of this file.

    00001 // This code contains NVIDIA Confidential Information and is disclosed to you
    00002 // under a form of NVIDIA software license agreement provided separately to you.
    00003 //
    00004 // Notice
    00005 // NVIDIA Corporation and its licensors retain all intellectual property and
    00006 // proprietary rights in and to this software and related documentation and
    00007 // any modifications thereto. Any use, reproduction, disclosure, or
    00008 // distribution of this software and related documentation without an express
    00009 // license agreement from NVIDIA Corporation is strictly prohibited.
    00010 //
    00011 // ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES
    00012 // NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO
    00013 // THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT,
    00014 // MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE.
    00015 //
    00016 // Information and code furnished is believed to be accurate and reliable.
    00017 // However, NVIDIA Corporation assumes no responsibility for the consequences of use of such
    00018 // information or for any infringement of patents or other rights of third parties that may
    00019 // result from its use. No license is granted by implication or otherwise under any patent
    00020 // or patent rights of NVIDIA Corporation. Details are subject to change without notice.
    00021 // This code supersedes and replaces all information previously supplied.
    00022 // NVIDIA Corporation products are not authorized for use as critical
    00023 // components in life support devices or systems without express written approval of
    00024 // NVIDIA Corporation.
    00025 //
    00026 // Copyright (c) 2020 NVIDIA Corporation. All rights reserved.
    00027
    00028
    00029 #ifndef NVBLASTEXTEXPORTERFBXWRITER_H
    00030 #define NVBLASTEXTEXPORTERFBXWRITER_H
    00031
    00032 #include "NvBlastExtExporter.h"
    00033 #include <memory>
    00034 #include <vector>
    00035 #include <map>
    00036
    00037 namespace fbxsdk
    00038 {
    00039     class FbxScene;
    00040     class FbxNode;
    00041     class FbxMesh;
    00042     class FbxSkin;
    00043     class FbxManager;
    00044     class FbxSurfaceMaterial;
    00045     class FbxDisplayLayer;
    00046 }
    00047
    00048 struct NvBlastAsset;
    00049
    00050 namespace Nv
    00051 {
    00052 namespace Blast
    00053 {
    00054 class Mesh;
    00055 struct Triangle;
    00056 struct CollisionHull;
    00057
    00058 class FbxFileWriter : public IMeshFileWriter
    00059 {
    00060 public:
    00061
    00065     FbxFileWriter();
    00066     //~FbxFileWriter() = default;
    00067
    00068     virtual void release() override;
    00069
    00073     fbxsdk::FbxScene* getScene();
    00074
    00078     virtual bool appendMesh(const AuthoringResult& aResult, const char* assetName, bool nonSkinned) override;
    00079
    00084     virtual bool appendMesh(const ExporterMeshData& meshData, const char* assetName, bool nonSkinned) override;
    00085
    00089     virtual bool saveToFile(const char* assetName, const char* outputPath) override;
    00090
    00094     virtual void setInteriorIndex(int32_t index) override;
    00095
    00099     bool bOutputFBXAscii;
    00100
    00101 private:
    00102     std::vector<fbxsdk::FbxSurfaceMaterial*> mMaterials;
    00103     fbxsdk::FbxScene* mScene;
    00104     fbxsdk::FbxDisplayLayer* mRenderLayer;
    00105
    00106     //TODO we should track for every memory allocation and deallocate it not only for sdkManager
    00107     std::shared_ptr<fbxsdk::FbxManager> sdkManager;
    00108     std::map<uint32_t, fbxsdk::FbxNode*> chunkNodes;
    00109     std::map<uint32_t, NvcVec3> worldChunkPivots;
    00110
    00111     bool appendNonSkinnedMesh(const AuthoringResult& aResult, const char* assetName);
    00112     bool appendNonSkinnedMesh(const ExporterMeshData& meshData, const char* assetName);
    00113     void createMaterials(const ExporterMeshData& meshData);
    00114     void createMaterials(const AuthoringResult& aResult);
    00115
    00120     bool appendCollisionMesh(uint32_t meshCount, uint32_t* offsets, CollisionHull** hulls, const char* assetName);
    00121
    00122     uint32_t addCollisionHulls(uint32_t chunkIndex, fbxsdk::FbxDisplayLayer* displayLayer, fbxsdk::FbxNode* parentNode, uint32_t hullsCount, CollisionHull** hulls);
    00123     uint32_t createChunkRecursive(uint32_t currentCpIdx, uint32_t chunkIndex, fbxsdk::FbxNode *meshNode, fbxsdk::FbxNode* parentNode, fbxsdk::FbxSkin* skin, const AuthoringResult& aResult);
    00124     uint32_t createChunkRecursive(uint32_t currentCpIdx, uint32_t chunkIndex, fbxsdk::FbxNode *meshNode, fbxsdk::FbxNode* parentNode, fbxsdk::FbxSkin* skin, const ExporterMeshData& meshData);
    00125
    00126     void createChunkRecursiveNonSkinned(const std::string& meshName, uint32_t chunkIndex, fbxsdk::FbxNode* parentNode,
    00127         const std::vector<fbxsdk::FbxSurfaceMaterial*>& materials, const AuthoringResult& aResult);
    00128
    00129     void createChunkRecursiveNonSkinned(const std::string& meshName, uint32_t chunkIndex, fbxsdk::FbxNode* parentNode,
    00130         const std::vector<fbxsdk::FbxSurfaceMaterial*>& materials, const ExporterMeshData& meshData);
    00131
    00132     void addControlPoints(fbxsdk::FbxMesh* mesh, const ExporterMeshData& meshData);
    00133     void addBindPose();
    00134
    00135     void generateSmoothingGroups(fbxsdk::FbxMesh* mesh, FbxSkin* skin);
    00136     void removeDuplicateControlPoints(fbxsdk::FbxMesh* mesh, FbxSkin* skin);
    00137
    00138     int32_t mInteriorIndex;
    00139 };
    00140
    00141 }
    00142 }
    00143
    00144 #endif // NVBLASTEXTEXPORTERFBXWRITER_H

Copyright © 2015-2017 NVIDIA Corporation, 2701 San Tomas Expressway, Santa Clara, CA 95050 U.S.A. All rights reserved. www.nvidia.com