APEX Destructible Module: FractureToolsAPI.h Source File

NVIDIA APEX

FractureToolsAPI.h
Go to the documentation of this file.
00001 /*
00002  * Copyright (c) 2008-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 FRACTURE_TOOLS_API_H
00013 #define FRACTURE_TOOLS_API_H
00014 
00015 #include "foundation/Px.h"
00016 #include "ExplicitHierarchicalMesh.h"
00017 #include "FractureToolsStructs.h"
00018 
00019 PX_PUSH_PACK_DEFAULT
00020 
00021 namespace nvidia
00022 {
00023 namespace apex
00024 {
00025 
00026 struct IntersectMesh;
00027 class DestructibleAsset;
00028 
00030 class FractureToolsAPI
00031 {
00032 public:
00033 
00035     virtual FractureTools::CutoutSet* createCutoutSet() = 0;
00036 
00049     virtual void buildCutoutSet(FractureTools::CutoutSet& cutoutSet, const uint8_t* pixelBuffer, uint32_t bufferWidth, uint32_t bufferHeight, float snapThreshold, bool periodic) = 0;
00050 
00059     virtual bool calculateCutoutUVMapping(const nvidia::ExplicitRenderTriangle& triangle, PxMat33& theMapping) = 0;
00060 
00073     virtual bool calculateCutoutUVMapping(nvidia::ExplicitHierarchicalMesh& hMesh, const PxVec3& targetDirection, PxMat33& theMapping) = 0;
00074 
00095     virtual bool    createVoronoiSplitMesh
00096     (
00097         nvidia::ExplicitHierarchicalMesh& hMesh,
00098         nvidia::ExplicitHierarchicalMesh& iHMeshCore,
00099         bool exportCoreMesh,
00100         int32_t coreMeshImprintSubmeshIndex,
00101         const FractureTools::MeshProcessingParameters& meshProcessingParams,
00102         const FractureTools::FractureVoronoiDesc& desc,
00103         const CollisionDesc& collisionDesc,
00104         uint32_t randomSeed,
00105         nvidia::IProgressListener& progressListener,
00106         volatile bool* cancel = NULL
00107     ) = 0;
00108 
00125     virtual uint32_t    createVoronoiSitesInsideMesh
00126     (
00127         nvidia::ExplicitHierarchicalMesh& hMesh,
00128         PxVec3* siteBuffer,
00129         uint32_t* siteChunkIndices,
00130         uint32_t siteCount,
00131         uint32_t* randomSeed,
00132         uint32_t* microgridSize,
00133         BSPOpenMode::Enum meshMode,
00134         nvidia::IProgressListener& progressListener,
00135         uint32_t chunkIndex = 0xFFFFFFFF
00136     ) = 0;
00137 
00162     virtual uint32_t    createScatterMeshSites
00163     (
00164         uint8_t*                        meshIndices,
00165         PxMat44*                        relativeTransforms,
00166         uint32_t*                       chunkMeshStarts,
00167         uint32_t                        scatterMeshInstancesBufferSize,
00168         nvidia::ExplicitHierarchicalMesh&   hMesh,
00169         uint32_t                        targetChunkCount,
00170         const uint16_t*                 targetChunkIndices,
00171         uint32_t*                       randomSeed,
00172         uint32_t                        scatterMeshAssetCount,
00173         nvidia::RenderMeshAsset**           scatterMeshAssets,
00174         const uint32_t*                 minCount,
00175         const uint32_t*                 maxCount,
00176         const float*                    minScales,
00177         const float*                    maxScales,
00178         const float*                    maxAngles
00179     ) = 0;
00180 
00194     virtual void    visualizeVoronoiCells
00195     (
00196         nvidia::RenderDebugInterface& debugRender,
00197         const PxVec3* sites,
00198         uint32_t siteCount,
00199         const uint32_t* cellColors,
00200         uint32_t cellColorCount,
00201         const PxBounds3& bounds,
00202         uint32_t cellIndex = 0xFFFFFFFF
00203     ) = 0;
00204 
00228     virtual bool buildExplicitHierarchicalMesh
00229     (
00230         nvidia::ExplicitHierarchicalMesh& iHMesh,
00231         const nvidia::ExplicitRenderTriangle* meshTriangles,
00232         uint32_t meshTriangleCount,
00233         const nvidia::ExplicitSubmeshData* submeshData,
00234         uint32_t submeshCount,
00235         uint32_t* meshPartition = NULL,
00236         uint32_t meshPartitionCount = 0,
00237         int32_t* parentIndices = NULL,
00238         uint32_t parentIndexCount = 0
00239     ) = 0;
00240 
00250     virtual void setBSPTolerances
00251     (
00252         float linearTolerance,
00253         float angularTolerance,
00254         float baseTolerance,
00255         float clipTolerance,
00256         float cleaningTolerance
00257     ) = 0;
00258 
00277     virtual void setBSPBuildParameters
00278     (
00279         float logAreaSigmaThreshold,
00280         uint32_t testSetSize,
00281         float splitWeight,
00282         float imbalanceWeight
00283     ) = 0;
00284 
00285 
00294     virtual bool buildExplicitHierarchicalMeshFromRenderMeshAsset(nvidia::ExplicitHierarchicalMesh& iHMesh, const nvidia::RenderMeshAsset& renderMeshAsset, uint32_t maxRootDepth = UINT32_MAX) = 0;
00295 
00305     virtual bool buildExplicitHierarchicalMeshFromDestructibleAsset(nvidia::ExplicitHierarchicalMesh& iHMesh, const nvidia::DestructibleAsset& destructibleAsset, uint32_t maxRootDepth = UINT32_MAX) = 0;
00306 
00326     virtual bool createHierarchicallySplitMesh
00327     (
00328         nvidia::ExplicitHierarchicalMesh& hMesh,
00329         nvidia::ExplicitHierarchicalMesh& iHMeshCore,
00330         bool exportCoreMesh,
00331         int32_t coreMeshImprintSubmeshIndex,
00332         const FractureTools::MeshProcessingParameters& meshProcessingParams,
00333         const FractureTools::FractureSliceDesc& desc,
00334         const CollisionDesc& collisionDesc,
00335         uint32_t randomSeed,
00336         nvidia::IProgressListener& progressListener,
00337         volatile bool* cancel = NULL
00338     ) = 0;
00339 
00357     virtual bool createChippedMesh
00358     (
00359         nvidia::ExplicitHierarchicalMesh& hMesh,
00360         const FractureTools::MeshProcessingParameters& meshProcessingParams,
00361         const FractureTools::FractureCutoutDesc& desc,
00362         const FractureTools::CutoutSet& iCutoutSet,
00363         const FractureTools::FractureSliceDesc& sliceDesc,
00364         const FractureTools::FractureVoronoiDesc& voronoiDesc,
00365         const CollisionDesc& collisionDesc,
00366         uint32_t randomSeed,
00367         nvidia::IProgressListener& progressListener,
00368         volatile bool* cancel = NULL
00369     ) = 0;
00370 
00387     virtual bool hierarchicallySplitChunk
00388     (
00389         nvidia::ExplicitHierarchicalMesh& hMesh,
00390         uint32_t chunkIndex,
00391         const FractureTools::MeshProcessingParameters& meshProcessingParams,
00392         const FractureTools::FractureSliceDesc& desc,
00393         const CollisionDesc& collisionDesc,
00394         uint32_t* randomSeed,
00395         nvidia::IProgressListener& progressListener,
00396         volatile bool* cancel = NULL
00397     ) = 0;
00398 
00415     virtual bool voronoiSplitChunk
00416     (
00417         nvidia::ExplicitHierarchicalMesh& hMesh,
00418         uint32_t chunkIndex,
00419         const FractureTools::MeshProcessingParameters& meshProcessingParams,
00420         const FractureTools::FractureVoronoiDesc& desc,
00421         const CollisionDesc& collisionDesc,
00422         uint32_t* randomSeed,
00423         nvidia::IProgressListener& progressListener,
00424         volatile bool* cancel = NULL
00425     ) = 0;
00426 
00431     virtual bool buildSliceMesh
00432     (
00433         nvidia::IntersectMesh& intersectMesh,
00434         nvidia::ExplicitHierarchicalMesh& referenceMesh,
00435         const PxPlane& slicePlane,
00436         const FractureTools::NoiseParameters& noiseParameters,
00437         uint32_t randomSeed
00438     ) = 0;
00439 
00441     virtual nvidia::ExplicitHierarchicalMesh*   createExplicitHierarchicalMesh() = 0;
00442 
00444     virtual nvidia::ExplicitHierarchicalMesh::ConvexHull*   createExplicitHierarchicalMeshConvexHull() = 0;
00445 
00446 };
00447 
00448 }} // namespaces
00449 
00450 
00451 PX_POP_PACK
00452 
00453 #endif // FRACTURE_TOOLS_API_H

Generated on Fri Dec 15 2017 13:58:22
Copyright © 2012-2017 NVIDIA Corporation, 2701 San Tomas Expressway, Santa Clara, CA 95050 U.S.A. All rights reserved.