00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029 #ifndef NVBLASTAUTHORINGTYPES_H
00030 #define NVBLASTAUTHORINGTYPES_H
00031
00032 #include "NvBlastTypes.h"
00033 #include "NvCTypes.h"
00034
00035 namespace Nv
00036 {
00037 namespace Blast
00038 {
00042 const uint32_t kMaterialInteriorId = 1000;
00043
00047 const uint32_t kSmoothingGroupInteriorId = 1000;
00048
00052 const uint32_t kNotValidVertexIndex = UINT32_MAX;
00053
00057 struct Edge
00058 {
00059 Edge(uint32_t s = kNotValidVertexIndex, uint32_t e = kNotValidVertexIndex) : s(s), e(e) {}
00060 uint32_t s;
00061 uint32_t e;
00062 };
00063
00067 struct Vertex
00068 {
00069 Vertex() {};
00070 Vertex(const NvcVec3& p, const NvcVec3& n, const NvcVec2& _uv) : p(p), n(n) { uv[0] = _uv; }
00071 NvcVec3 p;
00072 NvcVec3 n;
00073 NvcVec2 uv[1];
00074 };
00075
00079 struct Triangle
00080 {
00081 Triangle() {};
00082 Triangle(const Vertex& a, const Vertex& b, const Vertex& c, int32_t ud = 0, int32_t mid = 0, int32_t sid = 0)
00083 : a(a), b(b), c(c), userData(ud), materialId(mid), smoothingGroup(sid) {}
00084 Vertex a, b, c;
00085 int32_t userData;
00086 int32_t materialId;
00087 int32_t smoothingGroup;
00088 };
00089
00093 struct TriangleIndexed
00094 {
00095 TriangleIndexed(uint32_t ea, uint32_t eb, uint32_t ec, int32_t mid = 0, int32_t sid = 0, int32_t ud = 0)
00096 : ea(ea), eb(eb), ec(ec), materialId(mid), smoothingGroup(sid), userData(ud) {}
00097 uint32_t ea, eb, ec;
00098 int32_t materialId;
00099 int32_t smoothingGroup;
00100 int32_t userData;
00101 };
00102
00106 struct Facet
00107 {
00108 Facet(int32_t fen = 0, uint32_t ec = 0, int64_t ud = 0, int32_t mid = 0, int32_t sid = 0)
00109 : firstEdgeNumber(fen), edgesCount(ec), userData(ud), materialId(mid), smoothingGroup(sid) {}
00110 int32_t firstEdgeNumber;
00111 uint32_t edgesCount;
00112 int64_t userData;
00113 int32_t materialId;
00114 int32_t smoothingGroup;
00115 };
00116
00120 struct HullPolygon
00121 {
00122
00123 float plane[4];
00124
00125 uint16_t vertexCount;
00126
00127 uint16_t indexBase;
00128 };
00129
00133 struct CollisionHull
00134 {
00135 uint32_t pointsCount;
00136 uint32_t indicesCount;
00137 uint32_t polygonDataCount;
00138 NvcVec3* points;
00139 uint32_t* indices;
00140 HullPolygon* polygonData;
00141 };
00142
00148 struct AuthoringResult
00149 {
00150 uint32_t chunkCount;
00151
00152 uint32_t bondCount;
00153
00154 NvBlastAsset* asset;
00155
00160 uint32_t* assetToFractureChunkIdMap;
00161
00167 uint32_t* geometryOffset;
00168
00169 Triangle* geometry;
00170
00171 NvBlastChunkDesc* chunkDescs;
00172
00173 NvBlastBondDesc* bondDescs;
00174
00180 uint32_t* collisionHullOffset;
00181
00182 CollisionHull** collisionHull;
00183
00187 const char** materialNames;
00192 uint32_t materialCount;
00193 };
00194
00195 struct ConvexDecompositionParams
00196 {
00197 uint32_t maximumNumberOfHulls = 8;
00198
00199 uint32_t maximumNumberOfVerticesPerHull = 64;
00200
00201 uint32_t voxelGridResolution = 1000000;
00202
00203 float concavity = 0.0025f;
00204 };
00205
00206 }
00207 }
00208
00209
00210 #endif // ifndef NVBLASTAUTHORINGTYPES_H