AGX Dynamics  2.37.2.0
PrimitiveMeshGenerator.h
Go to the documentation of this file.
1 /*
2 Copyright 2007-2024. Algoryx Simulation AB.
3 
4 All AGX source code, intellectual property, documentation, sample code,
5 tutorials, scene files and technical white papers, are copyrighted, proprietary
6 and confidential material of Algoryx Simulation AB. You may not download, read,
7 store, distribute, publish, copy or otherwise disseminate, use or expose this
8 material unless having a written signed agreement with Algoryx Simulation AB, or having been
9 advised so by Algoryx Simulation AB for a time limited evaluation, or having purchased a
10 valid commercial license from Algoryx Simulation AB.
11 
12 Algoryx Simulation AB disclaims all responsibilities for loss or damage caused
13 from using this software, unless otherwise stated in written agreements with
14 Algoryx Simulation AB.
15 */
16 
17 #pragma once
18 
19 #include <agxCollide/Convex.h>
20 
21 namespace agxCollide
22 {
23  class Box;
24  class Capsule;
25  class Cylinder;
26  class Sphere;
27  class RenderData;
28 }
29 
30 namespace agxUtil
31 {
33  {
34  public:
44  static void createHalfSphereVertices( agx::UInt numSegments, agx::UInt numRows, agx::Real radius, agx::Bool top, agx::Real yOffset, agx::Vec3Vector& vertices );
45 
55  static void createConeCapVertices( agx::UInt numSegments, agx::Real topRadius, agx::Real bottomRadius,
56  agx::Real height, agx::Real basey, agx::Vec3Vector& vertices );
57 
65  static void createCylinderCapVertices( agx::UInt numSegments, agx::Real radius, agx::Real height, agx::Vec3Vector& vertices );
66 
76  static void createCircleVertices( agx::UInt numSegments, agx::Real radius, agx::Real yOffset, agx::Bool top, agx::Vec3Vector& vertices, agx::Bool useCenter = true );
77 
85  static agx::Vec3Vector createCapsuleVertices( agx::Real radius, agx::Real height, agx::Real resolution = agx::Real( 1 ) );
86 
94  static agxCollide::ConvexRef createCapsule( agx::Real radius, agx::Real height, agx::Real resolution = agx::Real( 1 ) );
95 
103  static agx::Vec3Vector createCylinderVertices( agx::Real radius, agx::Real height, agx::Real resolution = agx::Real( 1 ) );
104 
112  static agxCollide::ConvexRef createCylinder( agx::Real radius, agx::Real height, agx::Real resolution = agx::Real( 1 ) );
113 
120  static agx::Vec3Vector createSphereVertices( agx::Real radius, agx::Real resolution = agx::Real( 1 ) );
121 
128  static agxCollide::ConvexRef createSphere( agx::Real radius, agx::Real resolution = agx::Real( 1 ) );
129 
135  static agx::Vec3Vector createBoxVertices( const agx::Vec3& halfExtents );
136 
142  static agxCollide::ConvexRef createBox( const agx::Vec3& halfExtents );
143 
151  static agxCollide::ConvexRef createConvex( const agxCollide::Shape* shape, agx::Real resolution = agx::Real( 1 ) );
152 
159  static agxCollide::TrimeshRef createMesh( const agxCollide::Shape* shape, agx::Real resolution = agx::Real( 1 ) );
160 
161 
169  static agx::Vec3Vector createConvexVertices( const agxCollide::Shape* shape, agx::Real resolution = agx::Real( 1 ) );
170 
179  static agx::Vec3Vector createConeVertices( agx::Real topRadius, agx::Real bottomRadius, agx::Real height,
180  agx::Real resolution = agx::Real( 1 ) );
181 
190  static agxCollide::ConvexRef createCone( agx::Real topRadius, agx::Real bottomRadius, agx::Real height,
191  agx::Real resolution = agx::Real( 1 ) );
192 
202  static agxCollide::TrimeshRef createHollowCone( agx::Real topOuterRadius, agx::Real bottomInnerRadius,
203  agx::Real outerHeight, agx::Real thickness,
204  agx::Real resolution = agx::Real( 1 ) );
205 
213  static agxCollide::TrimeshRef createHollowCylinder( agx::Real innerRadius, agx::Real height, agx::Real thickness,
214  agx::Real resolution = agx::Real( 1 ) );
215 
221  static agxCollide::RenderDataRef createBoxRenderData(const agx::Vec3& halfExtents);
222 
229  static agxCollide::RenderDataRef createSphereRenderData(agx::Real radius,
230  agx::UInt32 numSegments = 32);
231 
239  static agxCollide::RenderDataRef createCylinderRenderData(agx::Real radius, agx::Real height,
240  agx::UInt32 numCircleSegments = 32);
241 
257  static agxCollide::ConvexRef generateVoronoiPolyhedraMesh( agx::Vec3 size,
258  unsigned int seed,
259  agx::Real pointDistance = 0.75,
260  agx::Real boundSize = 5 );
261 
274  static agx::Vec3Vector generateVoronoiPolyhedraVertices( unsigned int seed,
275  agx::Real pointDistance = 0.75,
276  agx::Real boundSize = 5.0 );
277 
278  };
279 }
bool Bool
Definition: Integer.h:48
Base class for a shape.
Definition: Shape.h:53
This namespace consists of a set of classes for handling geometric intersection tests including boole...
#define AGXPHYSICS_EXPORT
uint32_t UInt
Definition: Integer.h:34
double Real
Definition: Real.h:42
AGXPHYSICS_EXPORT agxCollide::Convex * createConvex(const agx::Vec3Vector &vertices, const agx::Matrix3x3 &transformation=agx::Matrix3x3(), const agx::Vec3 &translation=agx::Vec3())
Creates a convex shape from vertices only, building their convex hull.
uint32_t UInt32
Definition: Integer.h:40
The agxUtil namespace contain classes and methods for utility functionality.