Main Page   Class List   Class Members  

  • Main Page
  • User's Guide
  • Modules
  • Namespaces
  • Classes
  • Files
  • File List
  • File Members

sdk/extensions/authoringCommon/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-2020 NVIDIA Corporation. All rights reserved.
00027 
00028 #ifndef NVBLASTAUTHORINGMESHIMPL_H
00029 #define NVBLASTAUTHORINGMESHIMPL_H
00030 
00031 #include "NvBlastExtAuthoringMesh.h"
00032 #include <PxBounds3.h>
00033 #include <vector>
00034 #include <map>
00035 #include <set>
00036 
00037 namespace Nv
00038 {
00039 namespace Blast
00040 {
00041 
00045 class MeshImpl : public Mesh
00046 {
00047 public:
00048         
00058     MeshImpl(const NvcVec3* position, const NvcVec3* normals, const NvcVec2* uv, uint32_t verticesCount, const uint32_t* indices, uint32_t indicesCount);
00059 
00069     MeshImpl(const Vertex* vertices, const Edge* edges, const Facet* facets, uint32_t posCount, uint32_t edgesCount, uint32_t facetsCount);
00070 
00071     MeshImpl(const Vertex* vertices, uint32_t count);
00072 
00073     MeshImpl(const Vertex* vertices, uint32_t count, uint32_t* indices, uint32_t indexCount, void* materials, uint32_t materialStride);
00074 
00075     ~MeshImpl();
00076 
00077     virtual void        release() override;
00078 
00082     bool                isValid() const override;
00083 
00087     Vertex*             getVerticesWritable() override;
00088 
00092     Edge*               getEdgesWritable() override;
00093 
00097     Facet*              getFacetsBufferWritable() override;
00098 
00102     const Vertex*           getVertices() const override;
00103 
00107     const Edge*             getEdges() const override;
00108 
00112     const Facet*            getFacetsBuffer() const override;
00113 
00117     Facet*              getFacetWritable(int32_t facet) override;
00118 
00122     const Facet*        getFacet(int32_t facet) const override;
00123 
00127     uint32_t            getEdgesCount() const override;
00128 
00132     uint32_t            getVerticesCount() const override;
00133 
00137     uint32_t            getFacetCount() const override;
00138 
00139 
00143     const NvcBounds3&   getBoundingBox() const override;
00144 
00148     NvcBounds3& getBoundingBoxWritable() override;
00149 
00153     void                recalculateBoundingBox() override;
00154 
00159     float               getMeshVolume() override;
00160 
00161 
00165     void    setMaterialId(const int32_t* materialIds) override;
00166 
00170     void    replaceMaterialId(int32_t oldMaterialId, int32_t newMaterialId) override;
00171 
00175     void    setSmoothingGroup(const int32_t* smoothingGroups) override;
00176 
00180     virtual void                        calcPerFacetBounds() override;
00181 
00185     virtual const  NvcBounds3*  getFacetBound(uint32_t index) const override;
00186 
00187 private:
00188     std::vector<Vertex> mVertices;
00189     std::vector<Edge>   mEdges;
00190     std::vector<Facet>  mFacets;
00191     physx::PxBounds3 mBounds;
00192     std::vector<physx::PxBounds3> mPerFacetBounds;
00193 };
00194 
00195 } // namespace Blast
00196 } // namespace Nv
00197 
00198 
00199 #endif // ifndef NVBLASTAUTHORINGMESHIMPL_H
Copyright © 2015-2017 NVIDIA Corporation, 2701 San Tomas Expressway, Santa Clara, CA 95050 U.S.A. All rights reserved. www.nvidia.com