diff options
| author | Bryan Galdrikian <[email protected]> | 2018-01-22 14:04:16 -0800 |
|---|---|---|
| committer | Bryan Galdrikian <[email protected]> | 2018-01-22 14:04:16 -0800 |
| commit | 1dc1a87fba520bb45c1ce8165e8ea2c83c0a308d (patch) | |
| tree | 5f8ca75a6b92c60fb5cf3b14282fc4cc1c127eb2 /sdk/extensions/authoring/source/NvBlastExtAuthoringFractureToolImpl.h | |
| parent | Updating readme.md to show updated UE4 Blast integration branches (diff) | |
| download | blast-1dc1a87fba520bb45c1ce8165e8ea2c83c0a308d.tar.xz blast-1dc1a87fba520bb45c1ce8165e8ea2c83c0a308d.zip | |
Changes for 1.1.2 release candidate
See README.md, docs/release_notes.txt
Diffstat (limited to 'sdk/extensions/authoring/source/NvBlastExtAuthoringFractureToolImpl.h')
| -rw-r--r-- | sdk/extensions/authoring/source/NvBlastExtAuthoringFractureToolImpl.h | 63 |
1 files changed, 58 insertions, 5 deletions
diff --git a/sdk/extensions/authoring/source/NvBlastExtAuthoringFractureToolImpl.h b/sdk/extensions/authoring/source/NvBlastExtAuthoringFractureToolImpl.h index 0f6cdf0..72b655f 100644 --- a/sdk/extensions/authoring/source/NvBlastExtAuthoringFractureToolImpl.h +++ b/sdk/extensions/authoring/source/NvBlastExtAuthoringFractureToolImpl.h @@ -14,6 +14,7 @@ #include "NvBlastExtAuthoringFractureTool.h" #include "NvBlastExtAuthoringMesh.h" #include <vector> +#include <set> namespace Nv { @@ -114,8 +115,8 @@ public: private: std::vector <physx::PxVec3> mGeneratedSites; - const Mesh* mMesh; - const Mesh* mStencil; + const Mesh* mMesh; + const Mesh* mStencil; RandomGeneratorBase* mRnd; SpatialAccelerator* mAccelerator; }; @@ -224,7 +225,34 @@ public: \return If 0, fracturing is successful. */ - int32_t slicing(uint32_t chunkId, SlicingConfiguration conf, bool replaceChunk, RandomGeneratorBase* rnd) override; + int32_t slicing(uint32_t chunkId, const SlicingConfiguration& conf, bool replaceChunk, RandomGeneratorBase* rnd) override; + + + /** + Cut chunk with plane. + \param[in] chunkId Chunk to fracture + \param[in] normal Plane normal + \param[in] position Point on plane + \param[in] noise Noise configuration for plane-chunk intersection, see NoiseConfiguration. + \param[in] replaceChunk if 'true', newly generated chunks will replace source chunk, if 'false', newly generated chunks will be at next depth level, source chunk will be parent for them. + Case replaceChunk == true && chunkId == 0 considered as wrong input parameters + \param[in] rnd User supplied random number generator + + \return If 0, fracturing is successful. + */ + int32_t cut(uint32_t chunkId, const physx::PxVec3& normal, const physx::PxVec3& position, const NoiseConfiguration& noise, bool replaceChunk, RandomGeneratorBase* rnd) override; + + /** + Cutout fracture for specified chunk. + \param[in] chunkId Chunk to fracture + \param[in] conf Cutout parameters, see CutoutConfiguration. + \param[in] replaceChunk if 'true', newly generated chunks will replace source chunk, if 'false', newly generated chunks will be at next depth level, source chunk will be parent for them. + Case replaceChunk == true && chunkId == 0 considered as wrong input parameters + \param[in] rnd User supplied random number generator + + \return If 0, fracturing is successful. + */ + int32_t cutout(uint32_t chunkId, CutoutConfiguration conf, bool replaceChunk, RandomGeneratorBase* rnd) override; /** @@ -258,6 +286,15 @@ public: uint32_t getBaseMesh(int32_t chunkIndex, Triangle*& output) override; /** + Update chunk base mesh + \note Doesn't allocates output array, Triangle* output should be preallocated by user + \param[in] chunkIndex Chunk index + \param[out] output Array of triangles to be filled + \return number of triangles in base mesh + */ + uint32_t updateBaseMesh(int32_t chunkIndex, Triangle* output) override; + + /** Return index of chunk with specified chunkId \param[in] chunkId Chunk ID \return Chunk index in internal buffer, if not exist -1 is returned. @@ -324,13 +361,29 @@ public: void uniteChunks(uint32_t maxAtLevel, uint32_t maxGroupSize) override; + /** + Rescale interior uv coordinates of given chunk to fit square of given size. + \param[in] side Size of square side + \param[in] chunkId Chunk ID for which UVs should be scaled. + */ + void fitUvToRect(float side, uint32_t chunkId) override; + + /** + Rescale interior uv coordinates of all existing chunks to fit square of given size, relative sizes will be preserved. + \param[in] side Size of square side + */ + void fitAllUvToRect(float side) override; + + + private: void eraseChunk(int32_t chunkId); bool isAncestorForChunk(int32_t ancestorId, int32_t chunkId); - int32_t slicingNoisy(uint32_t chunkId, SlicingConfiguration conf, bool replaceChunk, RandomGeneratorBase* rnd); + int32_t slicingNoisy(uint32_t chunkId, const SlicingConfiguration& conf, bool replaceChunk, RandomGeneratorBase* rnd); uint32_t stretchGroup(const std::vector<uint32_t>& group, std::vector<std::vector<uint32_t>>& graph); void rebuildAdjGraph(const std::vector<uint32_t>& chunksToRebuild, std::vector<std::vector<uint32_t> >& chunkGraph); - + void fitAllUvToRect(float side, std::set<uint32_t>& mask); + /** Returns newly created chunk index in mChunkData. */ |