AGX Dynamics 2.41.3.0
Loading...
Searching...
No Matches
MeshData.h
Go to the documentation of this file.
1/*
2Copyright 2007-2025. Algoryx Simulation AB.
3
4All AGX source code, intellectual property, documentation, sample code,
5tutorials, scene files and technical white papers, are copyrighted, proprietary
6and confidential material of Algoryx Simulation AB. You may not download, read,
7store, distribute, publish, copy or otherwise disseminate, use or expose this
8material unless having a written signed agreement with Algoryx Simulation AB, or having been
9advised so by Algoryx Simulation AB for a time limited evaluation, or having purchased a
10valid commercial license from Algoryx Simulation AB.
11
12Algoryx Simulation AB disclaims all responsibilities for loss or damage caused
13from using this software, unless otherwise stated in written agreements with
14Algoryx Simulation AB.
15*/
16
17#ifndef AGXCOLLIDE_MESHDATA_H
18#define AGXCOLLIDE_MESHDATA_H
19
21#include <agx/ref_ptr.h>
23#include <agx/SPDMatrix3x3.h>
25
26namespace agxCollide
27{
39 {
40 public:
41 friend class Mesh;
42 friend class Trimesh;
43 friend class HeightField;
44 friend class Convex;
45
47
48 agx::Vec3Vector& getVertices();
49 const agx::Vec3Vector& getVertices() const ;
50
51 agx::UInt32Vector& getIndices();
52 const agx::UInt32Vector& getIndices() const;
53
54 size_t getNumTriangles() const;
55
56 const BoundingAABB& getBound() const;
57
59
60 protected:
62 virtual ~MeshData();
63 protected:
66 BoundingAABB m_bound; // Double storing (also in shape entity), here it is only used for graphics.
68 };
69
72
73
76 {
77 public:
78 friend class Mesh;
79 friend class Trimesh;
80 friend class HeightField;
81 friend class Convex;
82
84
87
90
92
94
96
97 bool isValid() const;
98
99 bool hasHalfEdge() const;
100
102
104
106
108
109 bool isTerrain() const;
110
112
114
115 protected:
118
119 protected:
120 // Everything here should be added to the deepCopy()-method.
134 };
135
138
139
142 {
143 public:
144 friend class HeightField;
145
147
149 agx::Vec2 getSize() const { return m_size; }
150
153
156
157 protected:
160 protected:
161 // Everything here should be added to the deepCopy()-method.
165 agx::Vec2 m_invScale; // Cached inverses of m_scale.
169 bool m_dynamic; // Are we interested of mass properties?
170 };
171
174
175
176
177 // Implementations
178
180 {
181 return m_vertices;
182 }
183
184
186 {
187 return m_vertices;
188 }
189
190
192 {
193 return m_indices;
194 }
195
196
198 {
199 return m_indices;
200 }
201
202
204 {
205 return m_numTriangles;
206 }
207
208
210 {
211 return m_bound;
212 }
213
214
215}
216
217#endif
218
#define AGXSTREAM_DECLARE_SERIALIZABLE(T)
Use this in a Serializable class to add the required methods Important: Use full namespace in the dec...
Definition: Serializable.h:208
#define AGXPHYSICS_EXPORT
#define m_size
Definition: agx/Vector.h:429
Axis aligned bounding box implementation.
Definition: BoundingAABB.h:38
Class for data sharing only to be used by Mesh, its internal classes and children.
Definition: MeshData.h:76
const agx::UInt32Vector & getHalfEdges() const
agx::SPDMatrix3x3 m_inertia
Definition: MeshData.h:124
const agx::Real32Vector & getTriangleMaximumEdgeLengths() const
const agx::Vec3Vector & getNormals() const
agx::Real getVolume() const
agx::UInt32Vector m_halfEdges
Definition: MeshData.h:123
CollisionMeshData * deepCopy() const
Creates a deep copy of all data. Caller takes ownership of pointer.
agx::Real getTotalMaximumEdgeLength() const
virtual ~CollisionMeshData()
Hiding destructor.
agx::Vec3Vector m_normals
Definition: MeshData.h:121
agx::Vec3 getCenter() const
agx::Real m_totalMaximumEdgeLength
Definition: MeshData.h:126
agx::Real32Vector m_triangleMaximumEdgeLengths
Definition: MeshData.h:122
const agx::SPDMatrix3x3 & getInertia() const
agx::Real getBottomMargin() const
A convex class for geometric intersection tests.
Definition: Convex.h:37
Class for data sharing only to be used by HeightField.
Definition: MeshData.h:142
virtual ~HeightFieldMeshData()
Hiding destructor.
HeightFieldMeshData * deepCopy() const
Creates a deep copy of all data. Caller takes ownership of pointer.
agx::Vec2u32 getResolution() const
agx::Vec2 getSize() const
Definition: MeshData.h:149
agx::UInt32Vector m_boundIndices
Definition: MeshData.h:162
A HeightField is a collision shape that can be created from a grid structure, like an image.
Stores triangle mesh data as triangle lists, i.e.
Definition: MeshData.h:39
virtual ~MeshData()
Hiding destructor.
size_t getNumTriangles() const
Definition: MeshData.h:203
agx::Vec3Vector & getVertices()
Definition: MeshData.h:179
size_t m_numTriangles
Definition: MeshData.h:67
agx::UInt32Vector & getIndices()
Definition: MeshData.h:191
const BoundingAABB & getBound() const
Definition: MeshData.h:209
BoundingAABB m_bound
Definition: MeshData.h:66
agx::UInt32Vector m_indices
Definition: MeshData.h:65
agx::Vec3Vector m_vertices
Definition: MeshData.h:64
Mesh is a common base class for triangle meshes, such as Mesh or HeightField.
Definition: Mesh.h:70
Triangle mesh for geometric intersection tests.
Definition: Trimesh.h:43
This class is an abstract base class for all classes that can be stored and retrieved from an Archive...
Definition: Serializable.h:45
Base class providing referencing counted objects.
Definition: Referenced.h:120
Specialized type of matrices for holding symmetric positive definite matrices.
Definition: SPDMatrix3x3.h:49
Smart pointer for handling referenced counted objects.
Definition: ref_ptr.h:30
#define AGX_FORCE_INLINE
Definition: macros.h:58
This namespace consists of a set of classes for handling geometric intersection tests including boole...
agx::ref_ptr< const CollisionMeshData > ConstCollisionMeshDataRef
Definition: MeshData.h:137
agx::ref_ptr< MeshData > MeshDataRef
Definition: MeshData.h:70
agx::ref_ptr< const MeshData > ConstMeshDataRef
Definition: MeshData.h:71
agx::ref_ptr< CollisionMeshData > CollisionMeshDataRef
Definition: MeshData.h:136
agx::ref_ptr< const HeightFieldMeshData > ConstHeightFieldMeshDataRef
Definition: MeshData.h:173
agx::ref_ptr< HeightFieldMeshData > HeightFieldMeshDataRef
Definition: MeshData.h:172
double Real
Definition: Real.h:42