AGX Dynamics 2.41.2.0
Loading...
Searching...
No Matches
TrimeshHelperFunctions.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#pragma once
18
19#include <agx/agx.h>
20#include <agxUtil/agxUtil.h>
21
22namespace agxCollide
23{
24 class Box;
25 class Cylinder;
26 class Capsule;
27}
28
29namespace 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,
86 agx::AffineMatrix4x4& transform);
87
88
91 {
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}
#define AGXPHYSICS_EXPORT
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.
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 ...
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.
AGXPHYSICS_EXPORT bool computeOrientedBox(const agx::Vec3Vector &vertices, agx::Vec3 &halfExtents, agx::AffineMatrix4x4 &transform)
Computes an oriented bounding box around the specified vertices.
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...
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).
void AGXPHYSICS_EXPORT changeWindingToCounterclockwise(agx::UInt32Vector &indices)
Changes Winding from clockwise to counterclockwise.
double Real
Definition: Real.h:42
Specify the orientation of cylinder, capsule for computeOrientedCylinder and computeOrientedCapsule.
@ X_AXIS
Choose the principal axis along the X-axis of the bounding box.
@ MINIMIZE_VOLUME
Automatically choose the direction which leads to the smallest volume.
@ Y_AXIS
Choose the principal axis along the Y-axis of the bounding box.
@ Z_AXIS
Choose the principal axis along the Z-axis of the bounding box.