Main Page Class List Class Members

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
31 #include "NvBlastExtAuthoringMesh.h"
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
148 NvcBounds3& getBoundingBoxWritable() override;
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
Nv::Blast::MeshImpl::release
virtual void release() override
Nv::Blast::MeshImpl::getFacetWritable
Facet * getFacetWritable(int32_t facet) override
Nv::Blast::MeshImpl::getFacetCount
uint32_t getFacetCount() const override
Nv::Blast::MeshImpl::getFacetsBuffer
const Facet * getFacetsBuffer() const override
Nv::Blast::MeshImpl::getEdgesCount
uint32_t getEdgesCount() const override
Nv::Blast::Mesh
Definition: NvBlastExtAuthoringMesh.h:42
Nv::Blast::Facet
Definition: NvBlastExtAuthoringTypes.h:106
Nv::Blast::MeshImpl::~MeshImpl
~MeshImpl()
Nv::Blast::MeshImpl::setSmoothingGroup
void setSmoothingGroup(const int32_t *smoothingGroups) override
NvBlastExtAuthoringMesh.h
NvcVec2
Definition: NvCTypes.h:43
Nv::Blast::MeshImpl::getVerticesCount
uint32_t getVerticesCount() const override
Nv::Blast::MeshImpl::getFacet
const Facet * getFacet(int32_t facet) const override
Nv::Blast::MeshImpl
Definition: NvBlastExtAuthoringMeshImpl.h:45
Nv::Blast::MeshImpl::isValid
bool isValid() const override
Nv::Blast::MeshImpl::getBoundingBoxWritable
NvcBounds3 & getBoundingBoxWritable() override
Nv::Blast::MeshImpl::getEdges
const Edge * getEdges() const override
NvcBounds3
Definition: NvCTypes.h:92
Nv::Blast::MeshImpl::MeshImpl
MeshImpl(const NvcVec3 *position, const NvcVec3 *normals, const NvcVec2 *uv, uint32_t verticesCount, const uint32_t *indices, uint32_t indicesCount)
Nv::Blast::MeshImpl::getVerticesWritable
Vertex * getVerticesWritable() override
Nv::Blast::MeshImpl::replaceMaterialId
void replaceMaterialId(int32_t oldMaterialId, int32_t newMaterialId) override
Nv::Blast::MeshImpl::setMaterialId
void setMaterialId(const int32_t *materialIds) override
Nv::Blast::MeshImpl::getFacetBound
virtual const NvcBounds3 * getFacetBound(uint32_t index) const override
Nv::Blast::MeshImpl::calcPerFacetBounds
virtual void calcPerFacetBounds() override
Nv::Blast::MeshImpl::getFacetsBufferWritable
Facet * getFacetsBufferWritable() override
Nv::Blast::MeshImpl::getVertices
const Vertex * getVertices() const override
Nv::Blast::Edge
Definition: NvBlastExtAuthoringTypes.h:57
Nv::Blast::MeshImpl::getMeshVolume
float getMeshVolume() override
Nv::Blast::Vertex
Definition: NvBlastExtAuthoringTypes.h:67
Nv::Blast::MeshImpl::getEdgesWritable
Edge * getEdgesWritable() override
Nv
Definition: NvBlastArray.h:37
NvcVec3
Definition: NvCTypes.h:49
Nv::Blast::MeshImpl::getBoundingBox
const NvcBounds3 & getBoundingBox() const override
Nv::Blast::MeshImpl::recalculateBoundingBox
void recalculateBoundingBox() override