NvBlastExtAuthoringMeshImpl.h
Go to the documentation of this file.
1 // This code contains NVIDIA Confidential Information and is disclosed to you
2 // under a form of NVIDIA software license agreement provided separately to you.
3 //
4 // Notice
5 // NVIDIA Corporation and its licensors retain all intellectual property and
6 // proprietary rights in and to this software and related documentation and
7 // any modifications thereto. Any use, reproduction, disclosure, or
8 // distribution of this software and related documentation without an express
9 // license agreement from NVIDIA Corporation is strictly prohibited.
10 //
11 // ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES
12 // NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO
13 // THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT,
14 // MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE.
15 //
16 // Information and code furnished is believed to be accurate and reliable.
17 // However, NVIDIA Corporation assumes no responsibility for the consequences of use of such
18 // information or for any infringement of patents or other rights of third parties that may
19 // result from its use. No license is granted by implication or otherwise under any patent
20 // or patent rights of NVIDIA Corporation. Details are subject to change without notice.
21 // This code supersedes and replaces all information previously supplied.
22 // NVIDIA Corporation products are not authorized for use as critical
23 // components in life support devices or systems without express written approval of
24 // NVIDIA Corporation.
25 //
26 // Copyright (c) 2016-2020 NVIDIA Corporation. All rights reserved.
27 
28 #ifndef NVBLASTAUTHORINGMESHIMPL_H
29 #define NVBLASTAUTHORINGMESHIMPL_H
30 
32 #include <PxBounds3.h>
33 #include <vector>
34 #include <map>
35 #include <set>
36 
37 namespace Nv
38 {
39 namespace Blast
40 {
41 
45 class MeshImpl : public Mesh
46 {
47 public:
48 
58  MeshImpl(const NvcVec3* position, const NvcVec3* normals, const NvcVec2* uv, uint32_t verticesCount, const uint32_t* indices, uint32_t indicesCount);
59 
69  MeshImpl(const Vertex* vertices, const Edge* edges, const Facet* facets, uint32_t posCount, uint32_t edgesCount, uint32_t facetsCount);
70 
71  MeshImpl(const Vertex* vertices, uint32_t count);
72 
73  MeshImpl(const Vertex* vertices, uint32_t count, uint32_t* indices, uint32_t indexCount, void* materials, uint32_t materialStride);
74 
75  ~MeshImpl();
76 
77  virtual void release() override;
78 
82  bool isValid() const override;
83 
87  Vertex* getVerticesWritable() override;
88 
92  Edge* getEdgesWritable() override;
93 
97  Facet* getFacetsBufferWritable() override;
98 
102  const Vertex* getVertices() const override;
103 
107  const Edge* getEdges() const override;
108 
112  const Facet* getFacetsBuffer() const override;
113 
117  Facet* getFacetWritable(int32_t facet) override;
118 
122  const Facet* getFacet(int32_t facet) const override;
123 
127  uint32_t getEdgesCount() const override;
128 
132  uint32_t getVerticesCount() const override;
133 
137  uint32_t getFacetCount() const override;
138 
139 
143  const NvcBounds3& getBoundingBox() const override;
144 
149 
153  void recalculateBoundingBox() override;
154 
159  float getMeshVolume() override;
160 
161 
165  void setMaterialId(const int32_t* materialIds) override;
166 
170  void replaceMaterialId(int32_t oldMaterialId, int32_t newMaterialId) override;
171 
175  void setSmoothingGroup(const int32_t* smoothingGroups) override;
176 
180  virtual void calcPerFacetBounds() override;
181 
185  virtual const NvcBounds3* getFacetBound(uint32_t index) const override;
186 
187 private:
188  std::vector<Vertex> mVertices;
189  std::vector<Edge> mEdges;
190  std::vector<Facet> mFacets;
191  physx::PxBounds3 mBounds;
192  std::vector<physx::PxBounds3> mPerFacetBounds;
193 };
194 
195 } // namespace Blast
196 } // namespace Nv
197 
198 
199 #endif // ifndef NVBLASTAUTHORINGMESHIMPL_H
virtual void release() override
Facet * getFacetWritable(int32_t facet) override
uint32_t getFacetCount() const override
const Facet * getFacetsBuffer() const override
uint32_t getEdgesCount() const override
Definition: NvBlastExtAuthoringMesh.h:42
Definition: NvBlastExtAuthoringTypes.h:106
void setSmoothingGroup(const int32_t *smoothingGroups) override
Definition: NvCTypes.h:43
uint32_t getVerticesCount() const override
const Facet * getFacet(int32_t facet) const override
Definition: NvBlastExtAuthoringMeshImpl.h:45
bool isValid() const override
NvcBounds3 & getBoundingBoxWritable() override
const Edge * getEdges() const override
Definition: NvCTypes.h:92
MeshImpl(const NvcVec3 *position, const NvcVec3 *normals, const NvcVec2 *uv, uint32_t verticesCount, const uint32_t *indices, uint32_t indicesCount)
Vertex * getVerticesWritable() override
void replaceMaterialId(int32_t oldMaterialId, int32_t newMaterialId) override
void setMaterialId(const int32_t *materialIds) override
virtual const NvcBounds3 * getFacetBound(uint32_t index) const override
virtual void calcPerFacetBounds() override
Facet * getFacetsBufferWritable() override
const Vertex * getVertices() const override
Definition: NvBlastExtAuthoringTypes.h:57
float getMeshVolume() override
Definition: NvBlastExtAuthoringTypes.h:67
Edge * getEdgesWritable() override
Definition: NvBlastArray.h:37
Definition: NvCTypes.h:49
const NvcBounds3 & getBoundingBox() const override
void recalculateBoundingBox() override