AGX Dynamics  2.38.0.2
TrimeshHelperFunctions.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 <agx/agx.h>
20 #include <agxUtil/agxUtil.h>
21 
22 namespace agxCollide
23 {
24  class Box;
25  class Cylinder;
26  class Capsule;
27 }
28 
29 namespace agxUtil {
43  const agx::Vec3Vector& originalVertices,
44  const agx::UInt32Vector& originalIndices,
45  agx::Vec3Vector& remainingVertices,
46  agx::UInt32Vector& remainingIndices,
47  agx::Real precision);
48 
55 
56 
68  const agx::Vec3Vector& vertices, const agx::UInt32Vector& indices,
69  agx::Vec3Vector& outVertices, agx::UInt32Vector& outIndices,
70  double reductionRatio=0.5,
71  double aggressiveness = 7.0);
72 
73 
84  const agx::Vec3Vector& vertices,
85  agx::Vec3& halfExtents,
87 
88 
91  {
92  enum Orientation {
97  };
98  };
99 
111  const agx::Vec3Vector& vertices,
112  agx::Vec2& radiusHeight,
113  agx::AffineMatrix4x4& localRotation,
115  );
116 
128  const agx::Vec3Vector& vertices,
129  agx::Vec2& radiusHeight,
130  agx::AffineMatrix4x4& localRotation,
132  );
133 }
agx::Real
double Real
Definition: Real.h:42
agxData::transform
void AGXCORE_EXPORT transform(void *target, const Format *targetFormat, const void *source, const Format *sourceFormat, size_t numElements)
Transform data between two buffers.
agx::AffineMatrix4x4T< Real >
agxUtil::ShapeOrientation::MINIMIZE_VOLUME
@ MINIMIZE_VOLUME
Automatically choose the direction which leads to the smallest volume.
Definition: TrimeshHelperFunctions.h:96
agx::VectorPOD< Vec3 >
AGXPHYSICS_EXPORT
#define AGXPHYSICS_EXPORT
agxUtil::computeOrientedBox
AGXPHYSICS_EXPORT bool computeOrientedBox(const agx::Vec3Vector &vertices, agx::Vec3 &halfExtents, agx::AffineMatrix4x4 &transform)
Computes an oriented bounding box around the specified vertices.
agxUtil::ShapeOrientation::Y_AXIS
@ Y_AXIS
Choose the principal axis along the Y-axis of the bounding box.
Definition: TrimeshHelperFunctions.h:94
agxUtil::reduceMesh
AGXPHYSICS_EXPORT bool reduceMesh(const agx::Vec3Vector &vertices, const agx::UInt32Vector &indices, agx::Vec3Vector &outVertices, agx::UInt32Vector &outIndices, double reductionRatio=0.5, double aggressiveness=7.0)
Perform mesh reduction using Fast-Quadric-Mesh.
agxUtil::computeOrientedCapsule
AGXPHYSICS_EXPORT bool computeOrientedCapsule(const agx::Vec3Vector &vertices, agx::Vec2 &radiusHeight, agx::AffineMatrix4x4 &localRotation, agxUtil::ShapeOrientation::Orientation orientation=agxUtil::ShapeOrientation::MINIMIZE_VOLUME)
Compute the radius, height and rotation of a capsule that encapsulates a specified box specified by h...
agxUtil::mergeDuplicateVertices
void AGXPHYSICS_EXPORT mergeDuplicateVertices(const agx::Vec3Vector &originalVertices, const agx::UInt32Vector &originalIndices, agx::Vec3Vector &remainingVertices, agx::UInt32Vector &remainingIndices, agx::Real precision)
Merged duplicate vertices (distance is <= precision).
agx::Vec2T< Real >
agxUtil::ShapeOrientation::Z_AXIS
@ Z_AXIS
Choose the principal axis along the Z-axis of the bounding box.
Definition: TrimeshHelperFunctions.h:95
agxUtil::ShapeOrientation
Specify the orientation of cylinder, capsule for computeOrientedCylinder and computeOrientedCapsule.
Definition: TrimeshHelperFunctions.h:90
agx.h
agxUtil::ShapeOrientation::Orientation
Orientation
Definition: TrimeshHelperFunctions.h:92
agxCollide
This namespace consists of a set of classes for handling geometric intersection tests including boole...
Definition: ContactForceFilterParticipant.h:22
agxUtil::computeOrientedCylinder
AGXPHYSICS_EXPORT bool computeOrientedCylinder(const agx::Vec3Vector &vertices, agx::Vec2 &radiusHeight, agx::AffineMatrix4x4 &localRotation, agxUtil::ShapeOrientation::Orientation orientation=agxUtil::ShapeOrientation::MINIMIZE_VOLUME)
Compute the radius, height and rotation of a cylinder that encapsulates a specified box specified by ...
agxUtil::changeWindingToCounterclockwise
void AGXPHYSICS_EXPORT changeWindingToCounterclockwise(agx::UInt32Vector &indices)
Changes Winding from clockwise to counterclockwise.
agx::Vec3T< Real >
agxUtil
The agxUtil namespace contain classes and methods for utility functionality.
Definition: CylindricalJoint.h:20
agxUtil::ShapeOrientation::X_AXIS
@ X_AXIS
Choose the principal axis along the X-axis of the bounding box.
Definition: TrimeshHelperFunctions.h:93
agxUtil.h