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 
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 
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 
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 
188 {
189 public:
197  virtual uint32_t getBoneInfluences(uint32_t*& out) = 0;
198 
202  virtual uint32_t getBoneCount() = 0;
203 };
204 
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 
245 
250 
255 
262 
263 #endif //NVBLASTEXTEXPORTER_H
uint32_t * hullsOffsets
Definition: NvBlastExtExporter.h:92
Nv::Blast::IMeshFileWriter * NvBlastExtExporterCreateObjFileWriter()
uint32_t normalsCount
Definition: NvBlastExtExporter.h:56
CollisionHull ** hulls
Definition: NvBlastExtExporter.h:94
Material * submeshMats
Definition: NvBlastExtExporter.h:70
NvcVec3 * positions
Definition: NvBlastExtExporter.h:60
Definition: NvCTypes.h:43
NvBlastAsset * asset
Definition: NvBlastExtExporter.h:52
Nv::Blast::IMeshFileReader * NvBlastExtExporterCreateObjFileReader()
Definition: NvBlastExtExporter.h:187
uint32_t * texIndex
Definition: NvBlastExtExporter.h:84
Definition: NvBlastExtAuthoringTypes.h:133
#define NVBLAST_API
Definition: NvBlastPreprocessor.h:37
uint32_t * normIndex
Definition: NvBlastExtExporter.h:82
uint32_t positionsCount
Definition: NvBlastExtExporter.h:54
uint32_t meshCount
Definition: NvBlastExtExporter.h:66
Definition: NvBlastExtAuthoringTypes.h:148
const char * name
Definition: NvBlastExtExporter.h:46
const char * diffuse_tex
Definition: NvBlastExtExporter.h:47
Definition: NvBlastExtExporter.h:50
NvcVec3 * normals
Definition: NvBlastExtExporter.h:62
uint32_t submeshCount
Definition: NvBlastExtExporter.h:68
Definition: NvBlastExtExporter.h:208
Definition: NvBlastTypes.h:286
Definition: NvBlastExtExporter.h:44
uint32_t * posIndex
Definition: NvBlastExtExporter.h:80
uint32_t * submeshOffsets
Definition: NvBlastExtExporter.h:78
uint32_t uvsCount
Definition: NvBlastExtExporter.h:58
Nv::Blast::IFbxFileReader * NvBlastExtExporterCreateFbxFileReader()
Definition: NvBlastExtAuthoring.h:34
Nv::Blast::IMeshFileWriter * NvBlastExtExporterCreateFbxFileWriter(bool outputFBXAscii=false)
Definition: NvCTypes.h:49
NvcVec2 * uvs
Definition: NvBlastExtExporter.h:64
Definition: NvBlastExtExporter.h:100