From 7437406ccc5d0816d5ded50ee39171635ab50850 Mon Sep 17 00:00:00 2001 From: Bryan Galdrikian Date: Tue, 30 Jan 2018 10:29:55 -0800 Subject: Fixing a cutout bug Replacing some copyright notices for consistency --- ..._blast_ext_authoring_cutout_impl_8h-source.html | 261 ++++++++------- ...ext_authoring_fracture_tool_impl_8h-source.html | 365 +++++++++++---------- ...nv_blast_ext_authoring_mesh_impl_8h-source.html | 201 ++++++------ 3 files changed, 439 insertions(+), 388 deletions(-) (limited to 'docs/source_docs') diff --git a/docs/source_docs/files/_nv_blast_ext_authoring_cutout_impl_8h-source.html b/docs/source_docs/files/_nv_blast_ext_authoring_cutout_impl_8h-source.html index 2af49f4..d887c37 100644 --- a/docs/source_docs/files/_nv_blast_ext_authoring_cutout_impl_8h-source.html +++ b/docs/source_docs/files/_nv_blast_ext_authoring_cutout_impl_8h-source.html @@ -36,135 +36,152 @@
  • File Members
  • -

    sdk/extensions/authoring/source/NvBlastExtAuthoringCutoutImpl.h

    Go to the documentation of this file.
    00001 /*
    -00002 * Copyright (c) 2016-2017, NVIDIA CORPORATION.  All rights reserved.
    -00003 *
    -00004 * NVIDIA CORPORATION and its licensors retain all intellectual property
    -00005 * and proprietary rights in and to this software, related documentation
    -00006 * and any modifications thereto.  Any use, reproduction, disclosure or
    -00007 * distribution of this software and related documentation without an express
    -00008 * license agreement from NVIDIA CORPORATION is strictly prohibited.
    -00009 */
    -00010 
    -00011 
    -00012 #ifndef NVBLASTAUTHORINGFCUTOUTIMPL_H
    -00013 #define NVBLASTAUTHORINGFCUTOUTIMPL_H
    -00014 
    -00015 #include "NvBlastExtAuthoringCutout.h"
    -00016 #include <vector>
    -00017 #include "PxMat44.h" // TODO Should replace?
    -00018 
    -00019 namespace Nv
    -00020 {
    -00021 namespace Blast
    -00022 {
    -00023 
    -00024 struct PolyVert
    -00025 {
    -00026     uint16_t index;
    -00027     uint16_t flags;
    -00028 };
    -00029 
    -00030 struct ConvexLoop
    -00031 {
    -00032     std::vector<PolyVert> polyVerts;
    -00033 };
    -00034 
    -00035 struct Cutout
    -00036 {
    -00037     std::vector<physx::PxVec3> vertices;
    -00038     std::vector<ConvexLoop> convexLoops;
    -00039 };
    +

    sdk/extensions/authoring/source/NvBlastExtAuthoringCutoutImpl.h

    Go to the documentation of this file.
    00001 // This code contains NVIDIA Confidential Information and is disclosed to you
    +00002 // under a form of NVIDIA software license agreement provided separately to you.
    +00003 //
    +00004 // Notice
    +00005 // NVIDIA Corporation and its licensors retain all intellectual property and
    +00006 // proprietary rights in and to this software and related documentation and
    +00007 // any modifications thereto. Any use, reproduction, disclosure, or
    +00008 // distribution of this software and related documentation without an express
    +00009 // license agreement from NVIDIA Corporation is strictly prohibited.
    +00010 //
    +00011 // ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES
    +00012 // NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO
    +00013 // THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT,
    +00014 // MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE.
    +00015 //
    +00016 // Information and code furnished is believed to be accurate and reliable.
    +00017 // However, NVIDIA Corporation assumes no responsibility for the consequences of use of such
    +00018 // information or for any infringement of patents or other rights of third parties that may
    +00019 // result from its use. No license is granted by implication or otherwise under any patent
    +00020 // or patent rights of NVIDIA Corporation. Details are subject to change without notice.
    +00021 // This code supersedes and replaces all information previously supplied.
    +00022 // NVIDIA Corporation products are not authorized for use as critical
    +00023 // components in life support devices or systems without express written approval of
    +00024 // NVIDIA Corporation.
    +00025 //
    +00026 // Copyright (c) 2016-2018 NVIDIA Corporation. All rights reserved.
    +00027 
    +00028 
    +00029 #ifndef NVBLASTAUTHORINGFCUTOUTIMPL_H
    +00030 #define NVBLASTAUTHORINGFCUTOUTIMPL_H
    +00031 
    +00032 #include "NvBlastExtAuthoringCutout.h"
    +00033 #include <vector>
    +00034 #include "PxMat44.h" // TODO Should replace?
    +00035 
    +00036 namespace Nv
    +00037 {
    +00038 namespace Blast
    +00039 {
     00040 
    -00041 struct POINT2D
    +00041 struct PolyVert
     00042 {
    -00043     POINT2D() {}
    -00044     POINT2D(int32_t _x, int32_t _y) : x(_x), y(_y) {}
    -00045 
    -00046     int32_t x;
    -00047     int32_t y;
    -00048 
    -00049     bool operator==(const POINT2D& other) const
    -00050     {
    -00051         return x == other.x && y == other.y;
    -00052     }
    -00053     bool operator<(const POINT2D& other) const
    -00054     {
    -00055         if (x == other.x) return y < other.y;
    -00056         return x < other.x;
    -00057     }
    -00058 };
    -00059 
    -00060 void convertTracesToIncremental(std::vector< std::vector<POINT2D>* >& traces);
    -00061 
    -00062 struct CutoutSetImpl : public CutoutSet
    -00063 {
    -00064     CutoutSetImpl() : periodic(false), dimensions(0.0f)
    -00065     {
    -00066     }
    -00067 
    -00068     uint32_t            getCutoutCount() const
    -00069     {
    -00070         return (uint32_t)cutouts.size();
    -00071     }
    -00072 
    -00073     uint32_t            getCutoutVertexCount(uint32_t cutoutIndex) const
    -00074     {
    -00075         return (uint32_t)cutouts[cutoutIndex].vertices.size();
    -00076     }
    -00077     uint32_t            getCutoutLoopCount(uint32_t cutoutIndex) const
    -00078     {
    -00079         return (uint32_t)cutouts[cutoutIndex].convexLoops.size();
    -00080     }
    -00081 
    -00082     const physx::PxVec3&    getCutoutVertex(uint32_t cutoutIndex, uint32_t vertexIndex) const
    -00083     {
    -00084         return cutouts[cutoutIndex].vertices[vertexIndex];
    -00085     }
    -00086 
    -00087     uint32_t            getCutoutLoopSize(uint32_t cutoutIndex, uint32_t loopIndex) const
    -00088     {
    -00089         return (uint32_t)cutouts[cutoutIndex].convexLoops[loopIndex].polyVerts.size();
    -00090     }
    -00091 
    -00092     uint32_t            getCutoutLoopVertexIndex(uint32_t cutoutIndex, uint32_t loopIndex, uint32_t vertexNum) const
    -00093     {
    -00094         return cutouts[cutoutIndex].convexLoops[loopIndex].polyVerts[vertexNum].index;
    -00095     }
    -00096     uint32_t            getCutoutLoopVertexFlags(uint32_t cutoutIndex, uint32_t loopIndex, uint32_t vertexNum) const
    -00097     {
    -00098         return cutouts[cutoutIndex].convexLoops[loopIndex].polyVerts[vertexNum].flags;
    -00099     }
    -00100     bool                    isPeriodic() const
    -00101     {
    -00102         return periodic;
    -00103     }
    -00104     const physx::PxVec2&    getDimensions() const
    +00043     uint16_t index;
    +00044     uint16_t flags;
    +00045 };
    +00046 
    +00047 struct ConvexLoop
    +00048 {
    +00049     std::vector<PolyVert> polyVerts;
    +00050 };
    +00051 
    +00052 struct Cutout
    +00053 {
    +00054     std::vector<physx::PxVec3> vertices;
    +00055     std::vector<ConvexLoop> convexLoops;
    +00056 };
    +00057 
    +00058 struct POINT2D
    +00059 {
    +00060     POINT2D() {}
    +00061     POINT2D(int32_t _x, int32_t _y) : x(_x), y(_y) {}
    +00062 
    +00063     int32_t x;
    +00064     int32_t y;
    +00065 
    +00066     bool operator==(const POINT2D& other) const
    +00067     {
    +00068         return x == other.x && y == other.y;
    +00069     }
    +00070     bool operator<(const POINT2D& other) const
    +00071     {
    +00072         if (x == other.x) return y < other.y;
    +00073         return x < other.x;
    +00074     }
    +00075 };
    +00076 
    +00077 void convertTracesToIncremental(std::vector< std::vector<POINT2D>* >& traces);
    +00078 
    +00079 struct CutoutSetImpl : public CutoutSet
    +00080 {
    +00081     CutoutSetImpl() : periodic(false), dimensions(0.0f)
    +00082     {
    +00083     }
    +00084 
    +00085     uint32_t            getCutoutCount() const
    +00086     {
    +00087         return (uint32_t)cutouts.size();
    +00088     }
    +00089 
    +00090     uint32_t            getCutoutVertexCount(uint32_t cutoutIndex) const
    +00091     {
    +00092         return (uint32_t)cutouts[cutoutIndex].vertices.size();
    +00093     }
    +00094     uint32_t            getCutoutLoopCount(uint32_t cutoutIndex) const
    +00095     {
    +00096         return (uint32_t)cutouts[cutoutIndex].convexLoops.size();
    +00097     }
    +00098 
    +00099     const physx::PxVec3&    getCutoutVertex(uint32_t cutoutIndex, uint32_t vertexIndex) const
    +00100     {
    +00101         return cutouts[cutoutIndex].vertices[vertexIndex];
    +00102     }
    +00103 
    +00104     uint32_t            getCutoutLoopSize(uint32_t cutoutIndex, uint32_t loopIndex) const
     00105     {
    -00106         return dimensions;
    +00106         return (uint32_t)cutouts[cutoutIndex].convexLoops[loopIndex].polyVerts.size();
     00107     }
     00108 
    -00109     //void                  serialize(physx::PxFileBuf& stream) const;
    -00110     //void                  deserialize(physx::PxFileBuf& stream);
    -00111 
    -00112     void                    release()
    -00113     {
    -00114         delete this;
    -00115     }
    -00116 
    -00117     std::vector<Cutout>     cutouts;
    -00118     bool                    periodic;
    -00119     physx::PxVec2           dimensions;
    -00120 };
    -00121 
    -00122 void createCutoutSet(Nv::Blast::CutoutSetImpl& cutoutSet, const uint8_t* pixelBuffer, uint32_t bufferWidth, uint32_t bufferHeight,
    -00123     float segmentationErrorThreshold, float snapThreshold, bool periodic, bool expandGaps);
    -00124 
    +00109     uint32_t            getCutoutLoopVertexIndex(uint32_t cutoutIndex, uint32_t loopIndex, uint32_t vertexNum) const
    +00110     {
    +00111         return cutouts[cutoutIndex].convexLoops[loopIndex].polyVerts[vertexNum].index;
    +00112     }
    +00113     uint32_t            getCutoutLoopVertexFlags(uint32_t cutoutIndex, uint32_t loopIndex, uint32_t vertexNum) const
    +00114     {
    +00115         return cutouts[cutoutIndex].convexLoops[loopIndex].polyVerts[vertexNum].flags;
    +00116     }
    +00117     bool                    isPeriodic() const
    +00118     {
    +00119         return periodic;
    +00120     }
    +00121     const physx::PxVec2&    getDimensions() const
    +00122     {
    +00123         return dimensions;
    +00124     }
     00125 
    -00126 } // namespace Blast
    -00127 } // namespace Nv
    +00126     //void                  serialize(physx::PxFileBuf& stream) const;
    +00127     //void                  deserialize(physx::PxFileBuf& stream);
     00128 
    -00129 #endif // ifndef NVBLASTAUTHORINGFCUTOUTIMPL_H
    +00129     void                    release()
    +00130     {
    +00131         delete this;
    +00132     }
    +00133 
    +00134     std::vector<Cutout>     cutouts;
    +00135     bool                    periodic;
    +00136     physx::PxVec2           dimensions;
    +00137 };
    +00138 
    +00139 void createCutoutSet(Nv::Blast::CutoutSetImpl& cutoutSet, const uint8_t* pixelBuffer, uint32_t bufferWidth, uint32_t bufferHeight,
    +00140     float segmentationErrorThreshold, float snapThreshold, bool periodic, bool expandGaps);
    +00141 
    +00142 
    +00143 } // namespace Blast
    +00144 } // namespace Nv
    +00145 
    +00146 #endif // ifndef NVBLASTAUTHORINGFCUTOUTIMPL_H
     
    -

    sdk/extensions/authoring/source/NvBlastExtAuthoringFractureToolImpl.h

    Go to the documentation of this file.
    00001 /*
    -00002 * Copyright (c) 2016-2017, NVIDIA CORPORATION.  All rights reserved.
    -00003 *
    -00004 * NVIDIA CORPORATION and its licensors retain all intellectual property
    -00005 * and proprietary rights in and to this software, related documentation
    -00006 * and any modifications thereto.  Any use, reproduction, disclosure or
    -00007 * distribution of this software and related documentation without an express
    -00008 * license agreement from NVIDIA CORPORATION is strictly prohibited.
    -00009 */
    -00010 
    -00011 #ifndef NVBLASTAUTHORINGFRACTURETOOLIMPL_H
    -00012 #define NVBLASTAUTHORINGFRACTURETOOLIMPL_H
    -00013 
    -00014 #include "NvBlastExtAuthoringFractureTool.h"
    -00015 #include "NvBlastExtAuthoringMesh.h"
    -00016 #include <vector>
    -00017 #include <set>
    -00018 
    -00019 namespace Nv
    -00020 {
    -00021 namespace Blast
    -00022 {
    -00023 
    -00024 class SpatialAccelerator;
    -00025 class Triangulator;
    -00026 
    +

    sdk/extensions/authoring/source/NvBlastExtAuthoringFractureToolImpl.h

    Go to the documentation of this file.
    00001 // This code contains NVIDIA Confidential Information and is disclosed to you
    +00002 // under a form of NVIDIA software license agreement provided separately to you.
    +00003 //
    +00004 // Notice
    +00005 // NVIDIA Corporation and its licensors retain all intellectual property and
    +00006 // proprietary rights in and to this software and related documentation and
    +00007 // any modifications thereto. Any use, reproduction, disclosure, or
    +00008 // distribution of this software and related documentation without an express
    +00009 // license agreement from NVIDIA Corporation is strictly prohibited.
    +00010 //
    +00011 // ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES
    +00012 // NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO
    +00013 // THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT,
    +00014 // MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE.
    +00015 //
    +00016 // Information and code furnished is believed to be accurate and reliable.
    +00017 // However, NVIDIA Corporation assumes no responsibility for the consequences of use of such
    +00018 // information or for any infringement of patents or other rights of third parties that may
    +00019 // result from its use. No license is granted by implication or otherwise under any patent
    +00020 // or patent rights of NVIDIA Corporation. Details are subject to change without notice.
    +00021 // This code supersedes and replaces all information previously supplied.
    +00022 // NVIDIA Corporation products are not authorized for use as critical
    +00023 // components in life support devices or systems without express written approval of
    +00024 // NVIDIA Corporation.
    +00025 //
    +00026 // Copyright (c) 2016-2018 NVIDIA Corporation. All rights reserved.
     00027 
    -00031 class VoronoiSitesGeneratorImpl : public VoronoiSitesGenerator
    -00032 {
    -00033 public:
    -00034     
    -00042     VoronoiSitesGeneratorImpl(const Mesh* mesh, RandomGeneratorBase* rnd);
    -00043     ~VoronoiSitesGeneratorImpl();
    +00028 #ifndef NVBLASTAUTHORINGFRACTURETOOLIMPL_H
    +00029 #define NVBLASTAUTHORINGFRACTURETOOLIMPL_H
    +00030 
    +00031 #include "NvBlastExtAuthoringFractureTool.h"
    +00032 #include "NvBlastExtAuthoringMesh.h"
    +00033 #include <vector>
    +00034 #include <set>
    +00035 
    +00036 namespace Nv
    +00037 {
    +00038 namespace Blast
    +00039 {
    +00040 
    +00041 class SpatialAccelerator;
    +00042 class Triangulator;
    +00043 
     00044 
    -00045     void                        release() override;
    -00046 
    -00050     void                        setBaseMesh(const Mesh* m) override;
    -00051 
    -00058      uint32_t                   getVoronoiSites(const physx::PxVec3*& sites) override;
    -00059     
    -00064     void                        addSite(const physx::PxVec3& site) override;
    -00069     void                        uniformlyGenerateSitesInMesh(uint32_t numberOfSites) override;
    -00070 
    -00077     void                        clusteredSitesGeneration(uint32_t numberOfClusters, uint32_t sitesPerCluster, float clusterRadius) override;
    -00078 
    -00089     void                        radialPattern(const physx::PxVec3& center, const physx::PxVec3& normal, float radius, int32_t angularSteps, int32_t radialSteps, float angleOffset = 0.0f, float variability = 0.0f) override;
    -00090 
    -00097     void                        generateInSphere(const uint32_t count, const float radius, const physx::PxVec3& center) override;
    -00102     void                        setStencil(const Mesh* stencil) override;
    -00106     void                        clearStencil() override;
    +00048 class VoronoiSitesGeneratorImpl : public VoronoiSitesGenerator
    +00049 {
    +00050 public:
    +00051     
    +00059     VoronoiSitesGeneratorImpl(const Mesh* mesh, RandomGeneratorBase* rnd);
    +00060     ~VoronoiSitesGeneratorImpl();
    +00061 
    +00062     void                        release() override;
    +00063 
    +00067     void                        setBaseMesh(const Mesh* m) override;
    +00068 
    +00075      uint32_t                   getVoronoiSites(const physx::PxVec3*& sites) override;
    +00076     
    +00081     void                        addSite(const physx::PxVec3& site) override;
    +00086     void                        uniformlyGenerateSitesInMesh(uint32_t numberOfSites) override;
    +00087 
    +00094     void                        clusteredSitesGeneration(uint32_t numberOfClusters, uint32_t sitesPerCluster, float clusterRadius) override;
    +00095 
    +00106     void                        radialPattern(const physx::PxVec3& center, const physx::PxVec3& normal, float radius, int32_t angularSteps, int32_t radialSteps, float angleOffset = 0.0f, float variability = 0.0f) override;
     00107 
    -00114     void                        deleteInSphere(const float radius, const physx::PxVec3& center, const float eraserProbability = 1) override;
    -00115 
    -00116 private:
    -00117     std::vector <physx::PxVec3> mGeneratedSites;
    -00118     const Mesh*                 mMesh;
    -00119     const Mesh*                 mStencil;
    -00120     RandomGeneratorBase*        mRnd;
    -00121     SpatialAccelerator*         mAccelerator;
    -00122 };
    -00123 
    +00114     void                        generateInSphere(const uint32_t count, const float radius, const physx::PxVec3& center) override;
    +00119     void                        setStencil(const Mesh* stencil) override;
    +00123     void                        clearStencil() override;
     00124 
    -00125 
    -00129 class FractureToolImpl : public FractureTool
    -00130 {
    -00131 
    -00132 public:
    -00133 
    -00137     FractureToolImpl()
    -00138     {
    -00139         mPlaneIndexerOffset = 1;
    -00140         mChunkIdCounter = 0;
    -00141         mRemoveIslands = false;
    -00142         mInteriorMaterialId = MATERIAL_INTERIOR;
    -00143     }
    -00144 
    -00145     ~FractureToolImpl()
    -00146     {
    -00147         reset();
    -00148     }
    -00149 
    -00150     void                                    release() override;
    -00151 
    -00155     void                                    reset() override;
    -00156     
    -00160     void                                    setInteriorMaterialId(int32_t materialId) override;
    +00131     void                        deleteInSphere(const float radius, const physx::PxVec3& center, const float eraserProbability = 1) override;
    +00132 
    +00133 private:
    +00134     std::vector <physx::PxVec3> mGeneratedSites;
    +00135     const Mesh*                 mMesh;
    +00136     const Mesh*                 mStencil;
    +00137     RandomGeneratorBase*        mRnd;
    +00138     SpatialAccelerator*         mAccelerator;
    +00139 };
    +00140 
    +00141 
    +00142 
    +00146 class FractureToolImpl : public FractureTool
    +00147 {
    +00148 
    +00149 public:
    +00150 
    +00154     FractureToolImpl()
    +00155     {
    +00156         mPlaneIndexerOffset = 1;
    +00157         mChunkIdCounter = 0;
    +00158         mRemoveIslands = false;
    +00159         mInteriorMaterialId = MATERIAL_INTERIOR;
    +00160     }
     00161 
    -00165     int32_t                                 getInteriorMaterialId() const override;
    -00166     
    -00170     void                                    replaceMaterialId(int32_t oldMaterialId, int32_t newMaterialId) override;
    -00171 
    -00175     void                                    setSourceMesh(const Mesh* mesh) override;
    -00176 
    -00180     int32_t                                 setChunkMesh(const Mesh* mesh, int32_t parentId) override;
    -00181 
    -00185     Mesh*                                   createChunkMesh(int32_t chunkId) override;
    -00186 
    -00191     void                                    getTransformation(physx::PxVec3& offset, float& scale) override;
    -00192 
    +00162     ~FractureToolImpl()
    +00163     {
    +00164         reset();
    +00165     }
    +00166 
    +00167     void                                    release() override;
    +00168 
    +00172     void                                    reset() override;
    +00173     
    +00177     void                                    setInteriorMaterialId(int32_t materialId) override;
    +00178 
    +00182     int32_t                                 getInteriorMaterialId() const override;
    +00183     
    +00187     void                                    replaceMaterialId(int32_t oldMaterialId, int32_t newMaterialId) override;
    +00188 
    +00192     void                                    setSourceMesh(const Mesh* mesh) override;
     00193 
    -00202     int32_t                                 voronoiFracturing(uint32_t chunkId, uint32_t cellCount, const physx::PxVec3* cellPoints, bool replaceChunk) override;
    +00197     int32_t                                 setChunkMesh(const Mesh* mesh, int32_t parentId) override;
    +00198 
    +00202     Mesh*                                   createChunkMesh(int32_t chunkId) override;
     00203 
    -00215     int32_t                                 voronoiFracturing(uint32_t chunkId, uint32_t cellCount, const physx::PxVec3* cellPoints, const physx::PxVec3& scale, const physx::PxQuat& rotation, bool replaceChunk) override;
    -00216 
    -00217 
    -00228     int32_t                                 slicing(uint32_t chunkId, const SlicingConfiguration& conf, bool replaceChunk, RandomGeneratorBase* rnd) override;
    -00229 
    -00230 
    -00243     int32_t                                 cut(uint32_t chunkId, const physx::PxVec3& normal, const physx::PxVec3& position, const NoiseConfiguration& noise, bool replaceChunk, RandomGeneratorBase* rnd) override;
    -00244 
    -00255     int32_t                                 cutout(uint32_t chunkId, CutoutConfiguration conf, bool replaceChunk, RandomGeneratorBase* rnd) override;
    -00256 
    -00257 
    -00261     void                                    finalizeFracturing() override;
    -00262     
    -00263     uint32_t                                getChunkCount() const override;
    -00264 
    -00268     const ChunkInfo&                        getChunkInfo(int32_t chunkIndex) override;
    -00269 
    -00277     float                                   getMeshOverlap(const Mesh& meshA, const Mesh& meshB) override;
    -00278 
    -00286     uint32_t                                getBaseMesh(int32_t chunkIndex, Triangle*& output) override;
    -00287 
    -00295     uint32_t                                updateBaseMesh(int32_t chunkIndex, Triangle* output) override;
    -00296 
    -00302     int32_t                                 getChunkIndex(int32_t chunkId) override;
    -00303 
    -00309     int32_t                                 getChunkId(int32_t chunkIndex) override;
    -00310 
    -00316     int32_t                                 getChunkDepth(int32_t chunkId) override;
    -00317 
    -00325     uint32_t                                getChunksIdAtDepth(uint32_t depth, int32_t*& chunkIds) override;
    -00326 
    +00208     void                                    getTransformation(physx::PxVec3& offset, float& scale) override;
    +00209 
    +00210 
    +00219     int32_t                                 voronoiFracturing(uint32_t chunkId, uint32_t cellCount, const physx::PxVec3* cellPoints, bool replaceChunk) override;
    +00220 
    +00232     int32_t                                 voronoiFracturing(uint32_t chunkId, uint32_t cellCount, const physx::PxVec3* cellPoints, const physx::PxVec3& scale, const physx::PxQuat& rotation, bool replaceChunk) override;
    +00233 
    +00234 
    +00245     int32_t                                 slicing(uint32_t chunkId, const SlicingConfiguration& conf, bool replaceChunk, RandomGeneratorBase* rnd) override;
    +00246 
    +00247 
    +00260     int32_t                                 cut(uint32_t chunkId, const physx::PxVec3& normal, const physx::PxVec3& position, const NoiseConfiguration& noise, bool replaceChunk, RandomGeneratorBase* rnd) override;
    +00261 
    +00272     int32_t                                 cutout(uint32_t chunkId, CutoutConfiguration conf, bool replaceChunk, RandomGeneratorBase* rnd) override;
    +00273 
    +00274 
    +00278     void                                    finalizeFracturing() override;
    +00279     
    +00280     uint32_t                                getChunkCount() const override;
    +00281 
    +00285     const ChunkInfo&                        getChunkInfo(int32_t chunkIndex) override;
    +00286 
    +00294     float                                   getMeshOverlap(const Mesh& meshA, const Mesh& meshB) override;
    +00295 
    +00303     uint32_t                                getBaseMesh(int32_t chunkIndex, Triangle*& output) override;
    +00304 
    +00312     uint32_t                                updateBaseMesh(int32_t chunkIndex, Triangle* output) override;
    +00313 
    +00319     int32_t                                 getChunkIndex(int32_t chunkId) override;
    +00320 
    +00326     int32_t                                 getChunkId(int32_t chunkIndex) override;
     00327 
    -00338     uint32_t                                getBufferedBaseMeshes(Vertex*& vertexBuffer, uint32_t*& indexBuffer, uint32_t*& indexBufferOffsets) override;
    -00339 
    -00344     void                                    setRemoveIslands(bool isRemoveIslands) override;
    -00345 
    -00351     int32_t                                 islandDetectionAndRemoving(int32_t chunkId) override;
    -00352 
    -00357     bool                                    isMeshContainOpenEdges(const Mesh* input) override;
    -00358 
    -00359     bool                                    deleteAllChildrenOfChunk(int32_t chunkId) override;
    -00360 
    -00361     void                                    uniteChunks(uint32_t maxAtLevel, uint32_t maxGroupSize) override;
    -00362     
    -00363 
    -00369     void                                    fitUvToRect(float side, uint32_t chunkId) override;
    -00370 
    -00375     void                                    fitAllUvToRect(float side) override;
    -00376 
    +00333     int32_t                                 getChunkDepth(int32_t chunkId) override;
    +00334 
    +00342     uint32_t                                getChunksIdAtDepth(uint32_t depth, int32_t*& chunkIds) override;
    +00343 
    +00344 
    +00355     uint32_t                                getBufferedBaseMeshes(Vertex*& vertexBuffer, uint32_t*& indexBuffer, uint32_t*& indexBufferOffsets) override;
    +00356 
    +00361     void                                    setRemoveIslands(bool isRemoveIslands) override;
    +00362 
    +00368     int32_t                                 islandDetectionAndRemoving(int32_t chunkId) override;
    +00369 
    +00374     bool                                    isMeshContainOpenEdges(const Mesh* input) override;
    +00375 
    +00376     bool                                    deleteAllChildrenOfChunk(int32_t chunkId) override;
     00377 
    -00378 
    -00379 private:    
    -00380     void                                    eraseChunk(int32_t chunkId);    
    -00381     bool                                    isAncestorForChunk(int32_t ancestorId, int32_t chunkId);
    -00382     int32_t                                 slicingNoisy(uint32_t chunkId, const SlicingConfiguration& conf, bool replaceChunk, RandomGeneratorBase* rnd);
    -00383     uint32_t                                stretchGroup(const std::vector<uint32_t>& group, std::vector<std::vector<uint32_t>>& graph);
    -00384     void                                    rebuildAdjGraph(const std::vector<uint32_t>& chunksToRebuild, std::vector<std::vector<uint32_t> >& chunkGraph);
    -00385     void                                    fitAllUvToRect(float side, std::set<uint32_t>& mask);
    -00386 
    -00390     uint32_t                                createNewChunk(uint32_t parentId);
    -00391 
    -00392 
    -00393 protected:
    -00397     float                               mScaleFactor;
    -00398     physx::PxVec3                       mOffset;
    -00399 
    -00400     /* Chunk mesh wrappers */
    -00401     std::vector<Triangulator*>          mChunkPostprocessors;
    -00402 
    +00378     void                                    uniteChunks(uint32_t maxAtLevel, uint32_t maxGroupSize) override;
    +00379     
    +00380 
    +00386     void                                    fitUvToRect(float side, uint32_t chunkId) override;
    +00387 
    +00392     void                                    fitAllUvToRect(float side) override;
    +00393 
    +00394 
    +00395 
    +00396 private:    
    +00397     void                                    eraseChunk(int32_t chunkId);    
    +00398     bool                                    isAncestorForChunk(int32_t ancestorId, int32_t chunkId);
    +00399     int32_t                                 slicingNoisy(uint32_t chunkId, const SlicingConfiguration& conf, bool replaceChunk, RandomGeneratorBase* rnd);
    +00400     uint32_t                                stretchGroup(const std::vector<uint32_t>& group, std::vector<std::vector<uint32_t>>& graph);
    +00401     void                                    rebuildAdjGraph(const std::vector<uint32_t>& chunksToRebuild, std::vector<std::vector<uint32_t> >& chunkGraph);
    +00402     void                                    fitAllUvToRect(float side, std::set<uint32_t>& mask);
     00403 
    -00404     
    -00405     int64_t                             mPlaneIndexerOffset;
    -00406     int32_t                             mChunkIdCounter;
    -00407     std::vector<ChunkInfo>              mChunkData;
    +00407     uint32_t                                createNewChunk(uint32_t parentId);
     00408 
    -00409     bool                                mRemoveIslands;
    -00410     int32_t                             mInteriorMaterialId;
    -00411 };
    -00412 
    -00413 } // namespace Blast
    -00414 } // namespace Nv
    -00415 
    +00409 
    +00410 protected:
    +00414     float                               mScaleFactor;
    +00415     physx::PxVec3                       mOffset;
     00416 
    -00417 #endif // ifndef NVBLASTAUTHORINGFRACTURETOOLIMPL_H
    +00417     /* Chunk mesh wrappers */
    +00418     std::vector<Triangulator*>          mChunkPostprocessors;
    +00419 
    +00420 
    +00421     
    +00422     int64_t                             mPlaneIndexerOffset;
    +00423     int32_t                             mChunkIdCounter;
    +00424     std::vector<ChunkInfo>              mChunkData;
    +00425 
    +00426     bool                                mRemoveIslands;
    +00427     int32_t                             mInteriorMaterialId;
    +00428 };
    +00429 
    +00430 } // namespace Blast
    +00431 } // namespace Nv
    +00432 
    +00433 
    +00434 #endif // ifndef NVBLASTAUTHORINGFRACTURETOOLIMPL_H
     
    -

    sdk/extensions/authoring/source/NvBlastExtAuthoringMeshImpl.h

    Go to the documentation of this file.
    00001 /*
    -00002 * Copyright (c) 2016-2017, NVIDIA CORPORATION.  All rights reserved.
    -00003 *
    -00004 * NVIDIA CORPORATION and its licensors retain all intellectual property
    -00005 * and proprietary rights in and to this software, related documentation
    -00006 * and any modifications thereto.  Any use, reproduction, disclosure or
    -00007 * distribution of this software and related documentation without an express
    -00008 * license agreement from NVIDIA CORPORATION is strictly prohibited.
    -00009 */
    -00010 
    -00011 #ifndef NVBLASTAUTHORINGMESHIMPL_H
    -00012 #define NVBLASTAUTHORINGMESHIMPL_H
    -00013 
    -00014 #include "NvBlastExtAuthoringMesh.h"
    -00015 #include <vector>
    -00016 
    -00017 namespace Nv
    -00018 {
    -00019 namespace Blast
    -00020 {
    -00021 
    -00025 class MeshImpl : public Mesh
    -00026 {
    -00027 public:
    -00028 
    -00038     MeshImpl(const physx::PxVec3* position, const physx::PxVec3* normals, const physx::PxVec2* uv, uint32_t verticesCount, const uint32_t* indices, uint32_t indicesCount);
    -00039 
    -00049     MeshImpl(const Vertex* vertices, const Edge* edges, const Facet* facets, uint32_t posCount, uint32_t edgesCount, uint32_t facetsCount);
    -00050 
    -00051     ~MeshImpl();
    -00052 
    -00053     virtual void        release() override;
    -00054 
    -00058     bool                isValid() const override;
    -00059 
    -00063     Vertex*             getVerticesWritable() override;
    -00064 
    -00068     Edge*               getEdgesWritable() override;
    +

    sdk/extensions/authoring/source/NvBlastExtAuthoringMeshImpl.h

    Go to the documentation of this file.
    00001 // This code contains NVIDIA Confidential Information and is disclosed to you
    +00002 // under a form of NVIDIA software license agreement provided separately to you.
    +00003 //
    +00004 // Notice
    +00005 // NVIDIA Corporation and its licensors retain all intellectual property and
    +00006 // proprietary rights in and to this software and related documentation and
    +00007 // any modifications thereto. Any use, reproduction, disclosure, or
    +00008 // distribution of this software and related documentation without an express
    +00009 // license agreement from NVIDIA Corporation is strictly prohibited.
    +00010 //
    +00011 // ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES
    +00012 // NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO
    +00013 // THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT,
    +00014 // MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE.
    +00015 //
    +00016 // Information and code furnished is believed to be accurate and reliable.
    +00017 // However, NVIDIA Corporation assumes no responsibility for the consequences of use of such
    +00018 // information or for any infringement of patents or other rights of third parties that may
    +00019 // result from its use. No license is granted by implication or otherwise under any patent
    +00020 // or patent rights of NVIDIA Corporation. Details are subject to change without notice.
    +00021 // This code supersedes and replaces all information previously supplied.
    +00022 // NVIDIA Corporation products are not authorized for use as critical
    +00023 // components in life support devices or systems without express written approval of
    +00024 // NVIDIA Corporation.
    +00025 //
    +00026 // Copyright (c) 2016-2018 NVIDIA Corporation. All rights reserved.
    +00027 
    +00028 #ifndef NVBLASTAUTHORINGMESHIMPL_H
    +00029 #define NVBLASTAUTHORINGMESHIMPL_H
    +00030 
    +00031 #include "NvBlastExtAuthoringMesh.h"
    +00032 #include <vector>
    +00033 
    +00034 namespace Nv
    +00035 {
    +00036 namespace Blast
    +00037 {
    +00038 
    +00042 class MeshImpl : public Mesh
    +00043 {
    +00044 public:
    +00045 
    +00055     MeshImpl(const physx::PxVec3* position, const physx::PxVec3* normals, const physx::PxVec2* uv, uint32_t verticesCount, const uint32_t* indices, uint32_t indicesCount);
    +00056 
    +00066     MeshImpl(const Vertex* vertices, const Edge* edges, const Facet* facets, uint32_t posCount, uint32_t edgesCount, uint32_t facetsCount);
    +00067 
    +00068     ~MeshImpl();
     00069 
    -00073     Facet*              getFacetsBufferWritable() override;
    -00074 
    -00078     const Vertex*           getVertices() const override;
    -00079 
    -00083     const Edge*             getEdges() const override;
    -00084 
    -00088     const Facet*            getFacetsBuffer() const override;
    -00089 
    -00093     Facet*              getFacetWritable(int32_t facet) override;
    -00094 
    -00098     const Facet*        getFacet(int32_t facet) const override;
    -00099 
    -00103     uint32_t            getEdgesCount() const override;
    -00104 
    -00108     uint32_t            getVerticesCount() const override;
    -00109 
    -00113     uint32_t            getFacetCount() const override;
    -00114 
    -00115 
    -00119     const physx::PxBounds3& getBoundingBox() const override;
    -00120 
    -00124     physx::PxBounds3&   getBoundingBoxWritable() override;
    -00125 
    -00129     void                recalculateBoundingBox() override;
    -00130 
    -00135     float               getMeshVolume() override;
    -00136 
    +00070     virtual void        release() override;
    +00071 
    +00075     bool                isValid() const override;
    +00076 
    +00080     Vertex*             getVerticesWritable() override;
    +00081 
    +00085     Edge*               getEdgesWritable() override;
    +00086 
    +00090     Facet*              getFacetsBufferWritable() override;
    +00091 
    +00095     const Vertex*           getVertices() const override;
    +00096 
    +00100     const Edge*             getEdges() const override;
    +00101 
    +00105     const Facet*            getFacetsBuffer() const override;
    +00106 
    +00110     Facet*              getFacetWritable(int32_t facet) override;
    +00111 
    +00115     const Facet*        getFacet(int32_t facet) const override;
    +00116 
    +00120     uint32_t            getEdgesCount() const override;
    +00121 
    +00125     uint32_t            getVerticesCount() const override;
    +00126 
    +00130     uint32_t            getFacetCount() const override;
    +00131 
    +00132 
    +00136     const physx::PxBounds3& getBoundingBox() const override;
     00137 
    -00141     void    setMaterialId(const int32_t* materialIds) override;
    +00141     physx::PxBounds3&   getBoundingBoxWritable() override;
     00142 
    -00146     void    replaceMaterialId(int32_t oldMaterialId, int32_t newMaterialId) override;
    +00146     void                recalculateBoundingBox() override;
     00147 
    -00151     void    setSmoothingGroup(const int32_t* smoothingGroups) override;
    -00152 
    -00153 private:
    -00154     std::vector<Vertex> mVertices;
    -00155     std::vector<Edge>   mEdges;
    -00156     std::vector<Facet>  mFacets;
    -00157     physx::PxBounds3    mBounds;
    -00158 };
    +00152     float               getMeshVolume() override;
    +00153 
    +00154 
    +00158     void    setMaterialId(const int32_t* materialIds) override;
     00159 
    -00160 
    -00173 void    setCuttingBox(const physx::PxVec3& point, const physx::PxVec3& normal, Mesh* mesh, float size, int64_t id);
    -00181 Mesh*   getCuttingBox(const physx::PxVec3& point, const physx::PxVec3& normal, float size, int64_t id, int32_t interiorMaterialId);
    -00182 
    -00188 Mesh*   getBigBox(const physx::PxVec3& point, float size, int32_t interiorMaterialId);
    -00189 
    -00203 Mesh* getNoisyCuttingBoxPair(const physx::PxVec3& point, const physx::PxVec3& normal, float size, float jaggedPlaneSize, uint32_t resolution, int32_t id, float amplitude, float frequency, int32_t octaves, int32_t seed, int32_t interiorMaterialId);
    -00204 
    -00205 
    -00211 void inverseNormalAndSetIndices(Mesh* mesh, int64_t id);
    -00212 
    -00221 Mesh*   getCuttingCylinder(uint32_t pointCount, const physx::PxVec3* points, const physx::PxTransform& transform, float height, int64_t id, int32_t interiorMaterialId);
    +00163     void    replaceMaterialId(int32_t oldMaterialId, int32_t newMaterialId) override;
    +00164 
    +00168     void    setSmoothingGroup(const int32_t* smoothingGroups) override;
    +00169 
    +00170 private:
    +00171     std::vector<Vertex> mVertices;
    +00172     std::vector<Edge>   mEdges;
    +00173     std::vector<Facet>  mFacets;
    +00174     physx::PxBounds3    mBounds;
    +00175 };
    +00176 
    +00177 
    +00190 void    setCuttingBox(const physx::PxVec3& point, const physx::PxVec3& normal, Mesh* mesh, float size, int64_t id);
    +00198 Mesh*   getCuttingBox(const physx::PxVec3& point, const physx::PxVec3& normal, float size, int64_t id, int32_t interiorMaterialId);
    +00199 
    +00205 Mesh*   getBigBox(const physx::PxVec3& point, float size, int32_t interiorMaterialId);
    +00206 
    +00220 Mesh* getNoisyCuttingBoxPair(const physx::PxVec3& point, const physx::PxVec3& normal, float size, float jaggedPlaneSize, uint32_t resolution, int32_t id, float amplitude, float frequency, int32_t octaves, int32_t seed, int32_t interiorMaterialId);
    +00221 
     00222 
    -00223 } // namespace Blast
    -00224 } // namespace Nv
    -00225 
    -00226 
    -00227 #endif // ifndef NVBLASTAUTHORINGMESHIMPL_H
    +00228 void inverseNormalAndSetIndices(Mesh* mesh, int64_t id);
    +00229 
    +00238 Mesh*   getCuttingCylinder(uint32_t pointCount, const physx::PxVec3* points, const physx::PxTransform& transform, float height, int64_t id, int32_t interiorMaterialId);
    +00239 
    +00240 } // namespace Blast
    +00241 } // namespace Nv
    +00242 
    +00243 
    +00244 #endif // ifndef NVBLASTAUTHORINGMESHIMPL_H