AGX Dynamics  2.37.3.2
ShapeDistance.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 <cstdint>
20 
21 #include <agx/agxPhysics_export.h>
22 #include <agx/Vec3.h>
23 #include <agx/AffineMatrix4x4.h>
24 
25 
26 namespace agxCollide {
27 
28  class Shape;
29  class Geometry;
30 
35  enum class ShapeDistanceResult : std::uint8_t {
36  SUCCESS,
39  FAILURE
40  };
41 
42 
67  const agxCollide::Shape* shape1, const agx::AffineMatrix4x4& transform1,
68  const agxCollide::Shape* shape2, const agx::AffineMatrix4x4& transform2,
69  agx::Vec3& point1, agx::Vec3& point2 );
70 
71 
72 
93  const agxCollide::Geometry* geometry1, const agx::AffineMatrix4x4& transform1,
94  const agxCollide::Geometry* geometry2, const agx::AffineMatrix4x4& transform2,
95  agx::Vec3& point1, agx::Vec3& point2 );
96 
97 
98 }
99 
AGXPHYSICS_EXPORT agxCollide::ShapeDistanceResult computeShapeDistance(const agxCollide::Shape *shape1, const agx::AffineMatrix4x4 &transform1, const agxCollide::Shape *shape2, const agx::AffineMatrix4x4 &transform2, agx::Vec3 &point1, agx::Vec3 &point2)
Utility function to compute the minimum distance between two shapes.
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
The geometry representation used by the collision detection engine.
Definition: Geometry.h:92
Generic error, e.g supported shapes but invalid values such as some negative shape size...
ShapeDistanceResult
Status values that can be returned when performing shape-shape distance computation.
Definition: ShapeDistance.h:35
AGXPHYSICS_EXPORT agxCollide::ShapeDistanceResult computeGeometryDistance(const agxCollide::Geometry *geometry1, const agx::AffineMatrix4x4 &transform1, const agxCollide::Geometry *geometry2, const agx::AffineMatrix4x4 &transform2, agx::Vec3 &point1, agx::Vec3 &point2)
Utility method to perform shape-shape minimum distance test between all compatible shape pairs...
One or more input shapes is of a non-supported type (Shape::hasSupportFunction() returns false) ...
Distance measurement successful.