#include <distancequery.h>
DistanceQueryInterface provides functions for calculating the distance to a mesh, a spline or a line. 
 | 
| MAXON_METHOD Result< void >  | Init (cinema::PolygonObject *mesh, Bool initVoxelization=false) | 
|   | 
| MAXON_METHOD Result< void >  | Init (cinema::SplineObject *spline) | 
|   | 
| MAXON_METHOD Result< void >  | Init (cinema::LineObject *line) | 
|   | 
| MAXON_METHOD Result< void >  | Init (const Block< const Vector > points, const Block< const SimplePolygon > polygons, const Matrix &objectPosition) | 
|   | 
| MAXON_METHOD void  | Reset () | 
|   | 
| MAXON_METHOD Float  | GetClosestMeshPrimitive (const Vector &pos, PrimitiveInformation &primInfo, const BaseBitSet<> *polyFilter=nullptr) const | 
|   | 
| MAXON_METHOD void  | GetDistanceToMesh (const Vector &pos, MeshDistanceData &distInfo, const BaseBitSet<> *polyFilter=nullptr, Bool onlyPolyPrimitives=false) const | 
|   | 
| MAXON_METHOD void  | GetDistanceToMeshMaxAngleToDirection (const Vector &pos, const Vector &direction, const Float angle, MeshDistanceData &distInfo, const BaseBitSet<> *polyFilter=nullptr, Bool onlyPolyPrimitives=false) const | 
|   | 
| MAXON_METHOD void  | GetDistanceToSpline (const Vector &pos, SplineDistanceData &distInfo) const | 
|   | 
| MAXON_METHOD Bool  | IsInitialized () const | 
|   | 
| MAXON_METHOD void  | SetThreading (Int32 threads) | 
|   | 
◆ MAXON_INTERFACE()
◆ Init() [1/4]
Initializes the distance query with a polygon object. 
- Parameters
 - 
  
    | [in] | mesh | Reference to the polygon object that the distance query is initialized to.  | 
    | [in] | initVoxelization | Initializes a voxelization for the distance query. This Is useful for massive tests on high poly polygon objects.  | 
  
   
- Returns
 - OK on success. 
 
 
 
◆ Init() [2/4]
Initializes the distance query with a spline object. 
- Parameters
 - 
  
    | [in] | spline | Reference to the spline object that the distance query is initialized to.  | 
  
   
- Returns
 - OK on success. 
 
 
 
◆ Init() [3/4]
Initializes the distance query with a line object. 
- Parameters
 - 
  
    | [in] | line | Reference to the line object that the distance query is initialized to.  | 
  
   
- Returns
 - OK on success. 
 
 
 
◆ Init() [4/4]
Initializes the distance query with a list of points and polygons. 
- Parameters
 - 
  
    | [in] | points | Block of Vectors that represent the points of the mesh.  | 
    | [in] | polygons | Block to Simple polygons that represent the topology.  | 
    | [in] | objectPosition | The matrix of the geometry.  | 
  
   
- Returns
 - OK on success. 
 
 
 
◆ Reset()
Resets the Initialized data. 
 
 
◆ GetClosestMeshPrimitive()
Retrieves the closest primitive of the initialized mesh. 
- Parameters
 - 
  
    | [in] | pos | The point in space the closest primitive should be found for.  | 
    | [out] | primInfo | The information for the primitive closest to the passed point.  | 
    | [in] | polyFilter | An optional bitset with the polygon indices that should be tested set, if nullptr all polygons will be tested.  | 
  
   
- Returns
 - The minimum distance to the closest primitive. 
 
 
 
◆ GetDistanceToMesh()
Retrieves the closest primitive of the initialized mesh. 
- Parameters
 - 
  
    | [in] | pos | The point in space the distance information should be calculated for.  | 
    | [out] | distInfo | The calculated distance information for passed point.  | 
    | [in] | polyFilter | An optional bitset with the polygon indices that should be tested set, if nullptr all polygons will be tested.  | 
    | [in] | onlyPolyPrimitives | If true the primitive information in the calculated distInfo will always be relative to polygons, false will return primitive information for points and edges as well.  | 
  
   
 
 
◆ GetDistanceToMeshMaxAngleToDirection()
Retrieves the closest primitive of the initialized mesh. Same as GetDistanceToMesh This will filter out all polygons that have primitive normals with a higher angle from the passed direction. 
- Parameters
 - 
  
    | [in] | pos | The point in space the distance information should be calculated for.  | 
    | [in] | direction | The direction for which the found polygons are not allowed to deviate more than the passed angle.  | 
    | [in] | angle | The angle for which the found polygons normals are not allowed to deviate relative to the passed direction.  | 
    | [out] | distInfo | The calculated distance information for the passed point.  | 
    | [in] | polyFilter | An optional bitset with the polygon indices that should be tested set, if nullptr all polygons will be tested.  | 
    | [in] | onlyPolyPrimitives | If true the primitive information in the calculated distInfo will always be relative to polygons, false will return primitive information for points and edges as well.  | 
  
   
 
 
◆ GetDistanceToSpline()
Retrieves the closest primitive of the initialized Spline or Line. 
- Parameters
 - 
  
    | [in] | pos | The point in space the distance information should be calculated for.  | 
    | [out] | distInfo | The calculated distance information for passed point.  | 
  
   
 
 
◆ IsInitialized()
Retrieves if the class was initialized with a polygon object, a spline or a line. 
- Returns
 - True if the class was initialized, false otherwise. 
 
 
 
◆ SetThreading()
Set the thread count for the calculations. 
- Parameters
 - 
  
    | [in] | threads | The amount of threads to be used.  
  |