aboutsummaryrefslogtreecommitdiff
path: root/sdk/extensions/authoring/include
diff options
context:
space:
mode:
authorBryan Galdrikian <[email protected]>2017-10-24 15:25:02 -0700
committerBryan Galdrikian <[email protected]>2017-10-24 15:25:02 -0700
commitb0c11962f6012430da3bcaa2727288046b33d648 (patch)
treecf13338fa4fd7072badf64f751f94abeeb437003 /sdk/extensions/authoring/include
parentlinux build fix - all configs (diff)
downloadblast-b0c11962f6012430da3bcaa2727288046b33d648.tar.xz
blast-b0c11962f6012430da3bcaa2727288046b33d648.zip
Changes for 1.1.1
See README.md
Diffstat (limited to 'sdk/extensions/authoring/include')
-rw-r--r--sdk/extensions/authoring/include/NvBlastExtAuthoring.h74
-rw-r--r--sdk/extensions/authoring/include/NvBlastExtAuthoringBondGenerator.h20
-rw-r--r--sdk/extensions/authoring/include/NvBlastExtAuthoringCollisionBuilder.h22
-rw-r--r--sdk/extensions/authoring/include/NvBlastExtAuthoringFractureTool.h11
-rw-r--r--sdk/extensions/authoring/include/NvBlastExtAuthoringTypes.h4
5 files changed, 125 insertions, 6 deletions
diff --git a/sdk/extensions/authoring/include/NvBlastExtAuthoring.h b/sdk/extensions/authoring/include/NvBlastExtAuthoring.h
index ce21c65..dd49677 100644
--- a/sdk/extensions/authoring/include/NvBlastExtAuthoring.h
+++ b/sdk/extensions/authoring/include/NvBlastExtAuthoring.h
@@ -47,9 +47,13 @@ namespace Nv
class ConvexMeshBuilder;
class BlastBondGenerator;
class MeshCleaner;
+ struct CollisionParams;
+ struct CollisionHull;
}
}
+struct NvBlastExtAssetUtilsBondDesc;
+
/**
Constructs mesh object from array of triangles.
User should call release() after usage.
@@ -96,6 +100,37 @@ Create ConvexMeshBuilder
NVBLAST_API Nv::Blast::ConvexMeshBuilder* NvBlastExtAuthoringCreateConvexMeshBuilder(physx::PxCooking* cooking,
physx::PxPhysicsInsertionCallback* insertionCallback);
+
+/**
+Transforms collision hull in place using scale, rotation, transform.
+\param[in, out] hull Pointer to the hull to be transformed (modified).
+\param[in] scale Pointer to scale to be applied. Can be nullptr.
+\param[in] rotation Pointer to rotation to be applied. Can be nullptr.
+\param[in] translation Pointer to translation to be applied. Can be nullptr.
+*/
+NVBLAST_API void NvBlastExtAuthoringTransformCollisionHullInPlace
+(
+ Nv::Blast::CollisionHull* hull,
+ const physx::PxVec3* scaling,
+ const physx::PxQuat* rotation,
+ const physx::PxVec3* translation
+);
+
+/**
+Transforms collision hull in place using scale, rotation, transform.
+\param[in] hull Pointer to the hull to be transformed (modified).
+\param[in] scale Pointer to scale to be applied. Can be nullptr.
+\param[in] rotation Pointer to rotation to be applied. Can be nullptr.
+\param[in] translation Pointer to translation to be applied. Can be nullptr.
+*/
+NVBLAST_API Nv::Blast::CollisionHull* NvBlastExtAuthoringTransformCollisionHull
+(
+ const Nv::Blast::CollisionHull* hull,
+ const physx::PxVec3* scaling,
+ const physx::PxQuat* rotation,
+ const physx::PxVec3* translation
+);
+
/**
Performs pending fractures and generates fractured asset, render and collision geometry
@@ -104,10 +139,11 @@ Performs pending fractures and generates fractured asset, render and collision g
\param[in] collisionBuilder Collision builder created by NvBlastExtAuthoringCreateConvexMeshBuilder
\param[in] defaultSupportDepth All new chunks will be marked as support if its depth equal to defaultSupportDepth.
By default leaves (chunks without children) marked as support.
+\param[in] collisionParam Parameters of collision hulls generation.
\return Authoring result
*/
NVBLAST_API Nv::Blast::AuthoringResult* NvBlastExtAuthoringProcessFracture(Nv::Blast::FractureTool& fTool,
- Nv::Blast::BlastBondGenerator& bondGenerator, Nv::Blast::ConvexMeshBuilder& collisionBuilder, int32_t defaultSupportDepth = -1);
+ Nv::Blast::BlastBondGenerator& bondGenerator, Nv::Blast::ConvexMeshBuilder& collisionBuilder, const Nv::Blast::CollisionParams& collisionParam, int32_t defaultSupportDepth = -1);
/**
@@ -116,4 +152,40 @@ NVBLAST_API Nv::Blast::AuthoringResult* NvBlastExtAuthoringProcessFracture(Nv::B
*/
NVBLAST_API Nv::Blast::MeshCleaner* NvBlastExtAuthoringCreateMeshCleaner();
+
+
+/**
+Finds bonds connecting chunks in a list of assets
+
+New bond descriptors may be given to bond support chunks from different components.
+
+An NvBlastAsset may appear more than once in the components array.
+
+NOTE: This function allocates memory using the allocator in NvBlastGlobals, to create the new bond
+descriptor arrays returned. The user must free this memory after use with NVBLAST_FREE
+
+\param[in] components An array of assets to merge, of size componentCount.
+\param[in] scales If not NULL, an array of size componentCount of scales to apply to the geometric data in the chunks and bonds. If NULL, no scaling is applied.
+\param[in] rotations If not NULL, an array of size componentCount of rotations to apply to the geometric data in the chunks and bonds. The quaternions MUST be normalized.
+ If NULL, no rotations are applied.
+\param[in] translations If not NULL, an array of of size componentCount of translations to apply to the geometric data in the chunks and bonds. If NULL, no translations are applied.
+\param[in] convexHullOffsets For each component, an array of chunkSize+1 specifying the start of the convex hulls for that chunk inside the chunkHulls array for that component.
+\param[in] chunkHulls For each component, an array of CollisionHull* specifying the collision geometry for the chunks in that component.
+\param[in] componentCount The size of the components and relativeTransforms arrays.
+\param[out] newBondDescs Descriptors of type NvBlastExtAssetUtilsBondDesc for new bonds between components.
+
+\return the number of bonds in newBondDescs
+*/
+NVBLAST_API uint32_t NvBlastExtAuthoringFindAssetConnectingBonds
+(
+ const NvBlastAsset** components,
+ const physx::PxVec3* scales,
+ const physx::PxQuat* rotations,
+ const physx::PxVec3* translations,
+ const uint32_t** convexHullOffsets,
+ const Nv::Blast::CollisionHull*** chunkHulls,
+ uint32_t componentCount,
+ NvBlastExtAssetUtilsBondDesc*& newBondDescs
+);
+
#endif // ifndef NVBLASTAUTHORING_H
diff --git a/sdk/extensions/authoring/include/NvBlastExtAuthoringBondGenerator.h b/sdk/extensions/authoring/include/NvBlastExtAuthoringBondGenerator.h
index 4f5d0e6..0151ed9 100644
--- a/sdk/extensions/authoring/include/NvBlastExtAuthoringBondGenerator.h
+++ b/sdk/extensions/authoring/include/NvBlastExtAuthoringBondGenerator.h
@@ -146,9 +146,25 @@ public:
\return Number of created bonds
*/
virtual int32_t bondsFromPrefractured(uint32_t meshCount, const uint32_t* geometryOffset, const Triangle* geometry,
- const bool*& chunkIsSupport, NvBlastBondDesc*& resultBondDescs,
+ const bool* chunkIsSupport, NvBlastBondDesc*& resultBondDescs,
BondGenerationConfig conf = BondGenerationConfig()) = 0;
-
+
+ /**
+ Creates bond description for prefractured meshes, when there is no info about which chunks should be connected with bond.
+ This uses the same process as bondsFromPrefractured using the BondGenMode::AVERAGE mode however the existing collision data is used.
+ \note User should call NVBLAST_FREE for resultBondDescs when it not needed anymore.
+ \param[in] meshCount Number of meshes
+ \param[in] convexHullOffset Pointer to array of convex hull offsets for each mesh.
+ Containts meshCount + 1 element, last one is total number of hulls in the geometry
+ \param[in] chunkHulls Pointer to array of convex hulls.
+ Hulls from convexHullOffset[i] to convexHullOffset[i+1] correspond to i-th mesh.
+ \param[in] chunkIsSupport Pointer to array of flags, if true - chunk is support. Array size should be equal to chunk count in tool.
+ \param[in] meshGroups Pointer to array of group ids for each mesh, bonds will not be generated between meshs of the same group. If null each mesh is assumed to be in it's own group.
+ \param[out] resultBondDescs Pointer to array of result bonds.
+ \return Number of created bonds
+ */
+ virtual int32_t bondsFromPrefractured(uint32_t meshCount, const uint32_t* convexHullOffset, const CollisionHull** chunkHulls,
+ const bool* chunkIsSupport, const uint32_t* meshGroups, NvBlastBondDesc*& resultBondDescs) = 0;
};
} // namespace Blast
diff --git a/sdk/extensions/authoring/include/NvBlastExtAuthoringCollisionBuilder.h b/sdk/extensions/authoring/include/NvBlastExtAuthoringCollisionBuilder.h
index 1e851bb..5b202bd 100644
--- a/sdk/extensions/authoring/include/NvBlastExtAuthoringCollisionBuilder.h
+++ b/sdk/extensions/authoring/include/NvBlastExtAuthoringCollisionBuilder.h
@@ -46,6 +46,22 @@ namespace Blast
{
struct CollisionHull;
+struct Triangle;
+
+struct CollisionParams
+{
+ CollisionParams()
+ {
+ setDefault();
+ }
+ void setDefault()
+ {
+ maximumNumberOfHulls = 8;
+ voxelGridResolution = 1000000;
+ }
+ uint32_t maximumNumberOfHulls; // Maximum number of convex hull generated for one chunk. If equal to 1 convex decomposition is disabled.
+ uint32_t voxelGridResolution; // Voxel grid resolution used for chunk convex decomposition.
+};
/**
ConvexMeshBuilder provides routine to build collision hulls from array of vertices.
@@ -103,6 +119,12 @@ public:
*/
virtual void trimCollisionGeometry(uint32_t chunksCount, CollisionHull** in, const uint32_t* chunkDepth) = 0;
+
+ /**
+ Create mesh convex decomposition
+ */
+ virtual int32_t buildMeshConvexDecomposition(const Nv::Blast::Triangle* mesh, uint32_t triangleCount, const CollisionParams& params, CollisionHull** &convexes) = 0;
+
};
} // namespace Blast
diff --git a/sdk/extensions/authoring/include/NvBlastExtAuthoringFractureTool.h b/sdk/extensions/authoring/include/NvBlastExtAuthoringFractureTool.h
index 9cdb6c2..b23ca18 100644
--- a/sdk/extensions/authoring/include/NvBlastExtAuthoringFractureTool.h
+++ b/sdk/extensions/authoring/include/NvBlastExtAuthoringFractureTool.h
@@ -92,7 +92,7 @@ struct SlicingConfiguration
/**
Cutting surface resolution.
*/
- int32_t surfaceResolution = 1;
+ uint32_t surfaceResolution = 1;
};
@@ -355,6 +355,15 @@ public:
\return true if mesh contains open edges
*/
virtual bool isMeshContainOpenEdges(const Mesh* input) = 0;
+
+ /**
+ Delete all children for specified chunk (also recursively delete chidren of children).
+ \param[in] chunkId Chunk ID which children should be deleted
+ \return true if one or more chunks were removed
+ */
+ virtual bool deleteAllChildrenOfChunk(int32_t chunkId) = 0;
+
+ virtual void uniteChunks(uint32_t maxAtLevel, uint32_t maxGroupSize) = 0;
};
} // namespace Blast
diff --git a/sdk/extensions/authoring/include/NvBlastExtAuthoringTypes.h b/sdk/extensions/authoring/include/NvBlastExtAuthoringTypes.h
index 5f14b04..512beca 100644
--- a/sdk/extensions/authoring/include/NvBlastExtAuthoringTypes.h
+++ b/sdk/extensions/authoring/include/NvBlastExtAuthoringTypes.h
@@ -146,11 +146,11 @@ struct Facet
{
int32_t firstEdgeNumber;
uint32_t edgesCount;
- int32_t userData;
+ int64_t userData;
int32_t materialId;
int32_t smoothingGroup;
- Facet(int32_t fEdge = 0, uint32_t eCount = 0, int32_t materialId = 0, int32_t userData = 0, int32_t smoothingGroup = 0) : firstEdgeNumber(fEdge), edgesCount(eCount), userData(userData), materialId(materialId), smoothingGroup(smoothingGroup) {}
+ Facet(int32_t fEdge = 0, uint32_t eCount = 0, int32_t materialId = 0, int64_t userData = 0, int32_t smoothingGroup = 0) : firstEdgeNumber(fEdge), edgesCount(eCount), userData(userData), materialId(materialId), smoothingGroup(smoothingGroup) {}
};
/**