AGX Dynamics 2.38.0.2
Loading...
Searching...
No Matches
PrimitiveMeshGenerator.h
Go to the documentation of this file.
1/*
2Copyright 2007-2024. 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#pragma once
18
19#include <agxCollide/Convex.h>
20
21namespace agxCollide
22{
23 class Box;
24 class Capsule;
25 class Cylinder;
26 class Sphere;
27 class RenderData;
28}
29
30namespace 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
104
112 static agxCollide::ConvexRef createCylinder( agx::Real radius, agx::Real height, agx::Real resolution = agx::Real( 1 ) );
113
121
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
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
214 agx::Real resolution = agx::Real( 1 ) );
215
222
230 agx::UInt32 numSegments = 32);
231
240 agx::UInt32 numCircleSegments = 32);
241
258 unsigned int seed,
259 agx::Real pointDistance = 0.75,
260 agx::Real boundSize = 5 );
261
275 agx::Real pointDistance = 0.75,
276 agx::Real boundSize = 5.0 );
277
278 };
279}
#define AGXPHYSICS_EXPORT
Base class for a shape.
Definition Shape.h:54
static agx::Vec3Vector createSphereVertices(agx::Real radius, agx::Real resolution=agx::Real(1))
Creates sphere vertices.
static agxCollide::TrimeshRef createMesh(const agxCollide::Shape *shape, agx::Real resolution=agx::Real(1))
Creates a mesh given a primitive shape.
static agxCollide::TrimeshRef createHollowCylinder(agx::Real innerRadius, agx::Real height, agx::Real thickness, agx::Real resolution=agx::Real(1))
Creates a trimesh of a hollow cylinder.
static void createCircleVertices(agx::UInt numSegments, agx::Real radius, agx::Real yOffset, agx::Bool top, agx::Vec3Vector &vertices, agx::Bool useCenter=true)
Creates circle of given radius.
static agx::Vec3Vector createConeVertices(agx::Real topRadius, agx::Real bottomRadius, agx::Real height, agx::Real resolution=agx::Real(1))
Creates a convex cone vertices.
static agxCollide::RenderDataRef createBoxRenderData(const agx::Vec3 &halfExtents)
Creates a RenderData with per vertex normals and texture coordinates of a box.
static agxCollide::ConvexRef createCylinder(agx::Real radius, agx::Real height, agx::Real resolution=agx::Real(1))
Creates a convex cylinder.
static agx::Vec3Vector generateVoronoiPolyhedraVertices(unsigned int seed, agx::Real pointDistance=0.75, agx::Real boundSize=5.0)
Create polyhedra points from a randomly generated Voronoi Diagram by using the method described in: h...
static agxCollide::RenderDataRef createCylinderRenderData(agx::Real radius, agx::Real height, agx::UInt32 numCircleSegments=32)
Creates a RenderData with per vertex normals and texture coordinates of a cylinder.
static agxCollide::ConvexRef createBox(const agx::Vec3 &halfExtents)
Creates a convex box with 24 vertices.
static agxCollide::RenderDataRef createSphereRenderData(agx::Real radius, agx::UInt32 numSegments=32)
Creates a RenderData with per vertex normals and texture coordinates of a sphere.
static agxCollide::ConvexRef createSphere(agx::Real radius, agx::Real resolution=agx::Real(1))
Creates a convex sphere.
static agxCollide::TrimeshRef createHollowCone(agx::Real topOuterRadius, agx::Real bottomInnerRadius, agx::Real outerHeight, agx::Real thickness, agx::Real resolution=agx::Real(1))
Creates a trimesh of a hollow cone.
static agx::Vec3Vector createCylinderVertices(agx::Real radius, agx::Real height, agx::Real resolution=agx::Real(1))
Creates cylinder vertices.
static agxCollide::ConvexRef generateVoronoiPolyhedraMesh(agx::Vec3 size, unsigned int seed, agx::Real pointDistance=0.75, agx::Real boundSize=5)
Create a polyhedra mesh from a randomly generated Voronoi Diagram by using the method described in: h...
static void createConeCapVertices(agx::UInt numSegments, agx::Real topRadius, agx::Real bottomRadius, agx::Real height, agx::Real basey, agx::Vec3Vector &vertices)
Creates a cone cap given radii and height.
static void createHalfSphereVertices(agx::UInt numSegments, agx::UInt numRows, agx::Real radius, agx::Bool top, agx::Real yOffset, agx::Vec3Vector &vertices)
Creates vertices of a half-sphere of given radius.
static agxCollide::ConvexRef createCapsule(agx::Real radius, agx::Real height, agx::Real resolution=agx::Real(1))
Creates a convex capsule.
static agx::Vec3Vector createBoxVertices(const agx::Vec3 &halfExtents)
Creates box of given half extents.
static agxCollide::ConvexRef createConvex(const agxCollide::Shape *shape, agx::Real resolution=agx::Real(1))
Creates convex given shape of primitive type BOX, CAPSULE, CYLINDER or SPHERE.
static agx::Vec3Vector createConvexVertices(const agxCollide::Shape *shape, agx::Real resolution=agx::Real(1))
Creates convex vertices given shape of primitive type BOX, CAPSULE, CYLINDER or SPHERE.
static agx::Vec3Vector createCapsuleVertices(agx::Real radius, agx::Real height, agx::Real resolution=agx::Real(1))
Creates capsule vertices.
static agxCollide::ConvexRef createCone(agx::Real topRadius, agx::Real bottomRadius, agx::Real height, agx::Real resolution=agx::Real(1))
Creates a convex cone.
static void createCylinderCapVertices(agx::UInt numSegments, agx::Real radius, agx::Real height, agx::Vec3Vector &vertices)
Creates cylinder cap of given radius and height.
This namespace consists of a set of classes for handling geometric intersection tests including boole...
The agxUtil namespace contain classes and methods for utility functionality.
uint32_t UInt32
Definition Integer.h:32
bool Bool
Definition Integer.h:40
uint64_t UInt
Definition Integer.h:27
double Real
Definition Real.h:42