-
首页
-
C4D R23.110 C++ SDK
DistanceQueryInterface Class Reference
#include <distancequery.h>
详细描述
DistanceQueryInterface
provides functions for calculating the distance to a mesh, a spline or a line.
公共成员函数
|
MAXON_METHOD
Result
< void >
|
Init
(
PolygonObject
*mesh,
Bool
initVoxelization=false)
|
MAXON_METHOD
Result
< void >
|
Init
(
SplineObject
*spline)
|
MAXON_METHOD
Result
< void >
|
Init
(
LineObject
*line)
|
MAXON_METHOD
Result
< void >
|
Init
(const
Block
< const
向量
> points, const
Block
< const
SimplePolygon
> polygons, const
矩阵
&objectPosition)
|
MAXON_METHOD
void
|
重置
()
|
MAXON_METHOD
Float
|
GetClosestMeshPrimitive
(const
向量
&pos,
PrimitiveInformation
&primInfo, const
BaseBitSet
<> *polyFilter=nullptr) const
|
MAXON_METHOD
void
|
GetDistanceToMesh
(const
向量
&pos,
MeshDistanceData
&distInfo, const
BaseBitSet
<> *polyFilter=nullptr,
Bool
onlyPolyPrimitives=false) const
|
MAXON_METHOD
void
|
GetDistanceToMeshMaxAngleToDirection
(const
向量
&pos, const
向量
&direction, const
Float
angle,
MeshDistanceData
&distInfo, const
BaseBitSet
<> *polyFilter=nullptr,
Bool
onlyPolyPrimitives=false) const
|
MAXON_METHOD
void
|
GetDistanceToSpline
(const
向量
&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.
-
参数
-
[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.
|
-
返回
-
OK on success.
◆
Init()
[2/4]
Initializes the distance query with a spline object.
-
参数
-
[in]
|
spline
|
Reference to the spline object that the distance query is initialized to.
|
-
返回
-
OK on success.
◆
Init()
[3/4]
Initializes the distance query with a line object.
-
参数
-
[in]
|
line
|
Reference to the line object that the distance query is initialized to.
|
-
返回
-
OK on success.
◆
Init()
[4/4]
Initializes the distance query with a list of points and polygons.
-
参数
-
[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.
|
-
返回
-
OK on success.
◆
Reset()
Resets the Initialized data.
◆
GetClosestMeshPrimitive()
Retrieves the closest primitive of the initialized mesh.
-
参数
-
[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.
|
-
返回
-
The minimum distance to the closest primitive.
◆
GetDistanceToMesh()
Retrieves the closest primitive of the initialized mesh.
-
参数
-
[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.
-
参数
-
[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.
-
参数
-
[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.
-
返回
-
True if the class was initialized, false otherwise.
◆
SetThreading()
Set the thread count for the calculations.
-
参数
-
[in]
|
threads
|
The amount of threads to be used.
|