Main Page Class List Class Members

NvBlastExtAuthoringTypes.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) 2016-2020 NVIDIA Corporation. All rights reserved.
27
28
29 #ifndef NVBLASTAUTHORINGTYPES_H
30 #define NVBLASTAUTHORINGTYPES_H
31
32 #include "NvBlastTypes.h"
33 #include "NvCTypes.h"
34
35 namespace Nv
36 {
37 namespace Blast
38 {
42 const uint32_t kMaterialInteriorId = 1000;
43
47 const uint32_t kSmoothingGroupInteriorId = 1000;
48
52 const uint32_t kNotValidVertexIndex = UINT32_MAX;
53
57 struct Edge
58 {
59 Edge(uint32_t s = kNotValidVertexIndex, uint32_t e = kNotValidVertexIndex) : s(s), e(e) {}
60 uint32_t s;
61 uint32_t e;
62 };
63
67 struct Vertex
68 {
69 Vertex() {};
70 Vertex(const NvcVec3& p, const NvcVec3& n, const NvcVec2& _uv) : p(p), n(n) { uv[0] = _uv; }
71 NvcVec3 p; // Position
72 NvcVec3 n; // Normal
73 NvcVec2 uv[1]; // UV-coordinates array, currently supported only one UV coordinate.
74 };
75
79 struct Triangle
80 {
81 Triangle() {};
82 Triangle(const Vertex& a, const Vertex& b, const Vertex& c, int32_t ud = 0, int32_t mid = 0, int32_t sid = 0)
83 : a(a), b(b), c(c), userData(ud), materialId(mid), smoothingGroup(sid) {}
84 Vertex a, b, c;
85 int32_t userData;
86 int32_t materialId;
87 int32_t smoothingGroup;
88 };
89
93 struct TriangleIndexed
94 {
95 TriangleIndexed(uint32_t ea, uint32_t eb, uint32_t ec, int32_t mid = 0, int32_t sid = 0, int32_t ud = 0)
96 : ea(ea), eb(eb), ec(ec), materialId(mid), smoothingGroup(sid), userData(ud) {}
97 uint32_t ea, eb, ec;
98 int32_t materialId;
99 int32_t smoothingGroup;
100 int32_t userData;
101 };
102
106 struct Facet
107 {
108 Facet(int32_t fen = 0, uint32_t ec = 0, int64_t ud = 0, int32_t mid = 0, int32_t sid = 0)
109 : firstEdgeNumber(fen), edgesCount(ec), userData(ud), materialId(mid), smoothingGroup(sid) {}
110 int32_t firstEdgeNumber;
111 uint32_t edgesCount;
112 int64_t userData;
113 int32_t materialId;
114 int32_t smoothingGroup;
115 };
116
120 struct HullPolygon
121 {
122 // Polygon base plane
123 float plane[4];
124 // Number vertices in polygon
125 uint16_t vertexCount;
126 // First index in CollisionHull.indices array for this polygon
127 uint16_t indexBase;
128 };
129
133 struct CollisionHull
134 {
135 uint32_t pointsCount;
136 uint32_t indicesCount;
137 uint32_t polygonDataCount;
138 NvcVec3* points;
139 uint32_t* indices;
140 HullPolygon* polygonData;
141 };
142
148 struct AuthoringResult
149 {
150 uint32_t chunkCount; // Number of chunks in Blast asset
151
152 uint32_t bondCount; // Number of bonds in Blast asset
153
154 NvBlastAsset* asset; // Blast asset
155
160 uint32_t* assetToFractureChunkIdMap;
161
167 uint32_t* geometryOffset;
168
169 Triangle* geometry; // Raw array of Triangle for all chunks
170
171 NvBlastChunkDesc* chunkDescs; // Array of chunk descriptors. Contains chunkCount elements
172
173 NvBlastBondDesc* bondDescs; // Array of bond descriptors. Contains bondCount elements
174
180 uint32_t* collisionHullOffset;
181
182 CollisionHull** collisionHull; // Raw array of pointers to collision hull for all chunks.
183
187 const char** materialNames;
192 uint32_t materialCount;
193 };
194
195 struct ConvexDecompositionParams
196 {
197 uint32_t maximumNumberOfHulls = 8; // Maximum number of convex hull generated for one chunk. If equal to 1 convex
198 // decomposition is disabled.
199 uint32_t maximumNumberOfVerticesPerHull = 64; // Controls the maximum number of triangles per convex-hull
200 // (default=64, range=4-1024)
201 uint32_t voxelGridResolution = 1000000; // Voxel grid resolution used for chunk convex decomposition
202 // (default=1,000,000, range=10,000-16,000,000).
203 float concavity = 0.0025f; // Value between 0 and 1, controls how accurate hull generation is
204 };
205
206 } // namespace Blast
207 } // namespace Nv
208
209
210 #endif // ifndef NVBLASTAUTHORINGTYPES_H
Nv::Blast::CollisionHull::indicesCount
uint32_t indicesCount
Definition: NvBlastExtAuthoringTypes.h:136
UINT32_MAX
#define UINT32_MAX
Definition: NvBlastPreprocessorInternal.h:68
Nv::Blast::Edge::e
uint32_t e
Definition: NvBlastExtAuthoringTypes.h:61
Nv::Blast::AuthoringResult::bondDescs
NvBlastBondDesc * bondDescs
Definition: NvBlastExtAuthoringTypes.h:173
Nv::Blast::Triangle::userData
int32_t userData
Definition: NvBlastExtAuthoringTypes.h:85
Nv::Blast::HullPolygon::indexBase
uint16_t indexBase
Definition: NvBlastExtAuthoringTypes.h:127
Nv::Blast::Facet::materialId
int32_t materialId
Definition: NvBlastExtAuthoringTypes.h:113
Nv::Blast::AuthoringResult::chunkDescs
NvBlastChunkDesc * chunkDescs
Definition: NvBlastExtAuthoringTypes.h:171
Nv::Blast::AuthoringResult::collisionHullOffset
uint32_t * collisionHullOffset
Definition: NvBlastExtAuthoringTypes.h:180
Nv::Blast::TriangleIndexed
Definition: NvBlastExtAuthoringTypes.h:93
NvBlastTypes.h
NvBlastBondDesc
Definition: NvBlastTypes.h:322
Nv::Blast::AuthoringResult::chunkCount
uint32_t chunkCount
Definition: NvBlastExtAuthoringTypes.h:150
Nv::Blast::Facet
Definition: NvBlastExtAuthoringTypes.h:106
Nv::Blast::Triangle::materialId
int32_t materialId
Definition: NvBlastExtAuthoringTypes.h:86
Nv::Blast::HullPolygon::vertexCount
uint16_t vertexCount
Definition: NvBlastExtAuthoringTypes.h:125
Nv::Blast::Vertex::n
NvcVec3 n
Definition: NvBlastExtAuthoringTypes.h:72
Nv::Blast::Vertex::Vertex
Vertex(const NvcVec3 &p, const NvcVec3 &n, const NvcVec2 &_uv)
Definition: NvBlastExtAuthoringTypes.h:70
Nv::Blast::CollisionHull::indices
uint32_t * indices
Definition: NvBlastExtAuthoringTypes.h:139
NvcVec2
Definition: NvCTypes.h:43
Nv::Blast::CollisionHull::polygonData
HullPolygon * polygonData
Definition: NvBlastExtAuthoringTypes.h:140
Nv::Blast::HullPolygon
Definition: NvBlastExtAuthoringTypes.h:120
Nv::Blast::Triangle::c
Vertex c
Definition: NvBlastExtAuthoringTypes.h:84
Nv::Blast::AuthoringResult::bondCount
uint32_t bondCount
Definition: NvBlastExtAuthoringTypes.h:152
Nv::Blast::TriangleIndexed::ec
uint32_t ec
Definition: NvBlastExtAuthoringTypes.h:97
Nv::Blast::CollisionHull
Definition: NvBlastExtAuthoringTypes.h:133
Nv::Blast::Triangle::Triangle
Triangle()
Definition: NvBlastExtAuthoringTypes.h:81
Nv::Blast::Triangle::smoothingGroup
int32_t smoothingGroup
Definition: NvBlastExtAuthoringTypes.h:87
Nv::Blast::kMaterialInteriorId
const uint32_t kMaterialInteriorId
Definition: NvBlastExtAuthoringTypes.h:42
Nv::Blast::ConvexDecompositionParams
Definition: NvBlastExtAuthoringTypes.h:195
Nv::Blast::TriangleIndexed::userData
int32_t userData
Definition: NvBlastExtAuthoringTypes.h:100
Nv::Blast::TriangleIndexed::materialId
int32_t materialId
Definition: NvBlastExtAuthoringTypes.h:98
Nv::Blast::kNotValidVertexIndex
const uint32_t kNotValidVertexIndex
Definition: NvBlastExtAuthoringTypes.h:52
Nv::Blast::AuthoringResult
Definition: NvBlastExtAuthoringTypes.h:148
Nv::Blast::TriangleIndexed::smoothingGroup
int32_t smoothingGroup
Definition: NvBlastExtAuthoringTypes.h:99
Nv::Blast::kSmoothingGroupInteriorId
const uint32_t kSmoothingGroupInteriorId
Definition: NvBlastExtAuthoringTypes.h:47
Nv::Blast::AuthoringResult::materialNames
const char ** materialNames
Definition: NvBlastExtAuthoringTypes.h:187
Nv::Blast::Triangle::Triangle
Triangle(const Vertex &a, const Vertex &b, const Vertex &c, int32_t ud=0, int32_t mid=0, int32_t sid=0)
Definition: NvBlastExtAuthoringTypes.h:82
Nv::Blast::AuthoringResult::geometry
Triangle * geometry
Definition: NvBlastExtAuthoringTypes.h:169
Nv::Blast::Facet::firstEdgeNumber
int32_t firstEdgeNumber
Definition: NvBlastExtAuthoringTypes.h:110
Nv::Blast::Triangle
Definition: NvBlastExtAuthoringTypes.h:79
NvBlastChunkDesc
Definition: NvBlastTypes.h:292
Nv::Blast::CollisionHull::points
NvcVec3 * points
Definition: NvBlastExtAuthoringTypes.h:138
Nv::Blast::CollisionHull::pointsCount
uint32_t pointsCount
Definition: NvBlastExtAuthoringTypes.h:135
Nv::Blast::TriangleIndexed::TriangleIndexed
TriangleIndexed(uint32_t ea, uint32_t eb, uint32_t ec, int32_t mid=0, int32_t sid=0, int32_t ud=0)
Definition: NvBlastExtAuthoringTypes.h:95
NvBlastAsset
Definition: NvBlastTypes.h:286
Nv::Blast::AuthoringResult::materialCount
uint32_t materialCount
Definition: NvBlastExtAuthoringTypes.h:192
Nv::Blast::CollisionHull::polygonDataCount
uint32_t polygonDataCount
Definition: NvBlastExtAuthoringTypes.h:137
Nv::Blast::AuthoringResult::collisionHull
CollisionHull ** collisionHull
Definition: NvBlastExtAuthoringTypes.h:182
Nv::Blast::Edge
Definition: NvBlastExtAuthoringTypes.h:57
Nv::Blast::Vertex::Vertex
Vertex()
Definition: NvBlastExtAuthoringTypes.h:69
Nv::Blast::Facet::smoothingGroup
int32_t smoothingGroup
Definition: NvBlastExtAuthoringTypes.h:114
Nv::Blast::Facet::userData
int64_t userData
Definition: NvBlastExtAuthoringTypes.h:112
Nv::Blast::Vertex
Definition: NvBlastExtAuthoringTypes.h:67
Nv::Blast::Vertex::p
NvcVec3 p
Definition: NvBlastExtAuthoringTypes.h:71
Nv::Blast::Facet::edgesCount
uint32_t edgesCount
Definition: NvBlastExtAuthoringTypes.h:111
Nv::Blast::AuthoringResult::asset
NvBlastAsset * asset
Definition: NvBlastExtAuthoringTypes.h:154
Nv
Definition: NvBlastArray.h:37
NvcVec3
Definition: NvCTypes.h:49
Nv::Blast::AuthoringResult::geometryOffset
uint32_t * geometryOffset
Definition: NvBlastExtAuthoringTypes.h:167
Nv::Blast::AuthoringResult::assetToFractureChunkIdMap
uint32_t * assetToFractureChunkIdMap
Definition: NvBlastExtAuthoringTypes.h:160
Nv::Blast::Edge::Edge
Edge(uint32_t s=kNotValidVertexIndex, uint32_t e=kNotValidVertexIndex)
Definition: NvBlastExtAuthoringTypes.h:59
Nv::Blast::Edge::s
uint32_t s
Definition: NvBlastExtAuthoringTypes.h:60
Nv::Blast::Facet::Facet
Facet(int32_t fen=0, uint32_t ec=0, int64_t ud=0, int32_t mid=0, int32_t sid=0)
Definition: NvBlastExtAuthoringTypes.h:108
NvCTypes.h