Main Page Class List Class Members

NvBlastExtExporter.h
Go to the documentation of this file.
1 // This code contains NVIDIA Confidential Information and is disclosed to you
2 // under a form of NVIDIA software license agreement provided separately to you.
3 //
4 // Notice
5 // NVIDIA Corporation and its licensors retain all intellectual property and
6 // proprietary rights in and to this software and related documentation and
7 // any modifications thereto. Any use, reproduction, disclosure, or
8 // distribution of this software and related documentation without an express
9 // license agreement from NVIDIA Corporation is strictly prohibited.
10 //
11 // ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES
12 // NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO
13 // THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT,
14 // MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE.
15 //
16 // Information and code furnished is believed to be accurate and reliable.
17 // However, NVIDIA Corporation assumes no responsibility for the consequences of use of such
18 // information or for any infringement of patents or other rights of third parties that may
19 // result from its use. No license is granted by implication or otherwise under any patent
20 // or patent rights of NVIDIA Corporation. Details are subject to change without notice.
21 // This code supersedes and replaces all information previously supplied.
22 // NVIDIA Corporation products are not authorized for use as critical
23 // components in life support devices or systems without express written approval of
24 // NVIDIA Corporation.
25 //
26 // Copyright (c) 2020 NVIDIA Corporation. All rights reserved.
27
28
29 #ifndef NVBLASTEXTEXPORTER_H
30 #define NVBLASTEXTEXPORTER_H
31
32 #include "NvBlastTypes.h"
33 #include "NvCTypes.h"
34
35 struct NvBlastAsset;
36
37 namespace Nv
38 {
39 namespace Blast
40 {
41 struct AuthoringResult;
42 struct CollisionHull;
43
44 struct Material
45 {
46 const char* name;
47 const char* diffuse_tex;
48 };
49
50 struct ExporterMeshData
51 {
52 NvBlastAsset* asset; //Blast asset
53
54 uint32_t positionsCount; //Number of positions
55
56 uint32_t normalsCount; //Number of normals
57
58 uint32_t uvsCount; //Number of textures uv
59
60 NvcVec3* positions; //Array of positions
61
62 NvcVec3* normals; // Array of normals
63
64 NvcVec2* uvs; // Array of textures uv
65
66 uint32_t meshCount; //Number of meshes (chunks)
67
68 uint32_t submeshCount; //Number of submeshes
69
70 Material* submeshMats;
71
72
78 uint32_t* submeshOffsets;
79
80 uint32_t* posIndex; //Array of position indices
81
82 uint32_t* normIndex; //Array of normals indices
83
84 uint32_t* texIndex; //Array of texture indices
85
86
92 uint32_t* hullsOffsets;
93
94 CollisionHull** hulls; //Array of pointers to hull for all meshes
95 };
96
100 class IMeshFileReader
101 {
102 public:
103
107 virtual void release() = 0;
108
109 /*
110 Load from the specified file path
111 */
112 virtual void loadFromFile(const char* filename) = 0;
113
117 virtual uint32_t getVerticesCount() const = 0;
118
122 virtual uint32_t getIndicesCount() const = 0;
123
127 virtual NvcVec3* getPositionArray() = 0;
128
132 virtual NvcVec3* getNormalsArray() = 0;
133
137 virtual NvcVec2* getUvArray() = 0;
138
142 virtual int32_t* getMaterialIds() = 0;
143
147 virtual int32_t* getSmoothingGroups() = 0;
148
152 virtual const char* getMaterialName(int32_t id) = 0;
153
157 virtual int32_t getMaterialCount() = 0;
158
159
160
164 virtual uint32_t* getIndexArray() = 0;
165
166
170 virtual bool isCollisionLoaded() = 0;
171
180 virtual uint32_t getCollision(uint32_t*& hullsOffset, CollisionHull**& hulls) = 0;
181
182 };
183
187 class IFbxFileReader : public IMeshFileReader
188 {
189 public:
197 virtual uint32_t getBoneInfluences(uint32_t*& out) = 0;
198
202 virtual uint32_t getBoneCount() = 0;
203 };
204
208 class IMeshFileWriter
209 {
210 public:
211
215 virtual void release() = 0;
216
220 virtual bool appendMesh(const AuthoringResult& aResult, const char* assetName, bool nonSkinned = false) = 0;
221
225 virtual bool appendMesh(const ExporterMeshData& meshData, const char* assetName, bool nonSkinned = false) = 0;
226
230 virtual bool saveToFile(const char* assetName, const char* outputPath) = 0;
231
235 virtual void setInteriorIndex(int32_t index) = 0;
236 };
237
238 }
239 }
240
244 NVBLAST_API Nv::Blast::IMeshFileReader* NvBlastExtExporterCreateObjFileReader();
245
249 NVBLAST_API Nv::Blast::IFbxFileReader* NvBlastExtExporterCreateFbxFileReader();
250
254 NVBLAST_API Nv::Blast::IMeshFileWriter* NvBlastExtExporterCreateObjFileWriter();
255
261 NVBLAST_API Nv::Blast::IMeshFileWriter* NvBlastExtExporterCreateFbxFileWriter(bool outputFBXAscii = false);
262
263 #endif //NVBLASTEXTEXPORTER_H
NvBlastExtExporterCreateFbxFileWriter
NVBLAST_API Nv::Blast::IMeshFileWriter * NvBlastExtExporterCreateFbxFileWriter(bool outputFBXAscii=false)
Nv::Blast::ExporterMeshData::hullsOffsets
uint32_t * hullsOffsets
Definition: NvBlastExtExporter.h:92
NvBlastExtExporterCreateObjFileReader
NVBLAST_API Nv::Blast::IMeshFileReader * NvBlastExtExporterCreateObjFileReader()
NvBlastTypes.h
Nv::Blast::ExporterMeshData::normalsCount
uint32_t normalsCount
Definition: NvBlastExtExporter.h:56
Nv::Blast::ExporterMeshData::hulls
CollisionHull ** hulls
Definition: NvBlastExtExporter.h:94
Nv::Blast::ExporterMeshData::submeshMats
Material * submeshMats
Definition: NvBlastExtExporter.h:70
Nv::Blast::ExporterMeshData::positions
NvcVec3 * positions
Definition: NvBlastExtExporter.h:60
NvcVec2
Definition: NvCTypes.h:43
Nv::Blast::ExporterMeshData::asset
NvBlastAsset * asset
Definition: NvBlastExtExporter.h:52
Nv::Blast::IFbxFileReader
Definition: NvBlastExtExporter.h:187
Nv::Blast::ExporterMeshData::texIndex
uint32_t * texIndex
Definition: NvBlastExtExporter.h:84
Nv::Blast::CollisionHull
Definition: NvBlastExtAuthoringTypes.h:133
NVBLAST_API
#define NVBLAST_API
Definition: NvBlastPreprocessor.h:37
Nv::Blast::ExporterMeshData::normIndex
uint32_t * normIndex
Definition: NvBlastExtExporter.h:82
Nv::Blast::ExporterMeshData::positionsCount
uint32_t positionsCount
Definition: NvBlastExtExporter.h:54
Nv::Blast::ExporterMeshData::meshCount
uint32_t meshCount
Definition: NvBlastExtExporter.h:66
Nv::Blast::AuthoringResult
Definition: NvBlastExtAuthoringTypes.h:148
Nv::Blast::Material::name
const char * name
Definition: NvBlastExtExporter.h:46
Nv::Blast::Material::diffuse_tex
const char * diffuse_tex
Definition: NvBlastExtExporter.h:47
Nv::Blast::ExporterMeshData
Definition: NvBlastExtExporter.h:50
Nv::Blast::ExporterMeshData::normals
NvcVec3 * normals
Definition: NvBlastExtExporter.h:62
Nv::Blast::ExporterMeshData::submeshCount
uint32_t submeshCount
Definition: NvBlastExtExporter.h:68
Nv::Blast::IMeshFileWriter
Definition: NvBlastExtExporter.h:208
NvBlastAsset
Definition: NvBlastTypes.h:286
Nv::Blast::Material
Definition: NvBlastExtExporter.h:44
Nv::Blast::ExporterMeshData::posIndex
uint32_t * posIndex
Definition: NvBlastExtExporter.h:80
Nv::Blast::ExporterMeshData::submeshOffsets
uint32_t * submeshOffsets
Definition: NvBlastExtExporter.h:78
Nv::Blast::ExporterMeshData::uvsCount
uint32_t uvsCount
Definition: NvBlastExtExporter.h:58
NvBlastExtExporterCreateObjFileWriter
NVBLAST_API Nv::Blast::IMeshFileWriter * NvBlastExtExporterCreateObjFileWriter()
NvBlastExtExporterCreateFbxFileReader
NVBLAST_API Nv::Blast::IFbxFileReader * NvBlastExtExporterCreateFbxFileReader()
Nv
Definition: NvBlastArray.h:37
NvcVec3
Definition: NvCTypes.h:49
Nv::Blast::ExporterMeshData::uvs
NvcVec2 * uvs
Definition: NvBlastExtExporter.h:64
Nv::Blast::IMeshFileReader
Definition: NvBlastExtExporter.h:100
NvCTypes.h