公共成员函数
|
Int32
|
DoCollide
(const
矩阵
&M1,
GeColliderCache
*o1, const
矩阵
&M2,
GeColliderCache
*o2,
Int32
flag)
|
Int32
|
DoPolyPairs
(const
矩阵
&M1,
GeColliderCache
*o1, const
矩阵
&M2,
GeColliderCache
*o2,
Float
tolerance)
|
Int32
|
DoTolerance
(const
矩阵
&M1,
GeColliderCache
*o1, const
矩阵
&M2,
GeColliderCache
*o2,
Float
tolerance)
|
Int32
|
DoDistance
(const
矩阵
&M1,
GeColliderCache
*o1, const
矩阵
&M2,
GeColliderCache
*o2,
Float
rel_err,
Float
abs_err)
|
void
|
FreePairsList
()
|
Int32
|
GetNumPairs
()
|
Int32
|
GetId1
(
Int32
k)
|
Int32
|
GetId2
(
Int32
k)
|
Bool
|
IsCloser
()
|
Float
|
GetDistance
()
|
const
向量
&
|
GetP1
()
|
const
向量
&
|
GetP2
()
|
Int32
|
DoRayCollide
(
GeColliderCache
*o1, const
向量
&ray_p, const
向量
&ray_dir,
Float
ray_length)
|
构造函数 & 析构函数文档编制
◆
GeColliderEngine()
◆
~GeColliderEngine()
成员函数文档编制
◆
Alloc()
Allocates a collider engine. Destroy the allocated collider engine with
Free()
。使用
AutoAlloc
to automate the allocation and destruction based on scope.
-
返回
-
The allocated collider engine, or
nullptr
if the allocation failed.
◆
Free()
Destructs collider engines allocated with
Alloc()
。使用
AutoAlloc
to automate the allocation and destruction based on scope.
-
参数
-
[in,out]
|
data
|
The collider engine to destruct. If the pointer is
nullptr
nothing happens. The pointer is assigned
nullptr
afterwards.
|
◆
DoCollide()
Checks for intersecting triangles in
o1
and
o2
.
If the function succeeds retrieve a list of colliding triangle pairs with
GetNumPairs()
,
GetId1()
and
GetId2()
.
-
注意
-
The matrices must be orthonormal!
-
参数
-
[in]
|
M1
|
The world matrix of first object.
|
[in]
|
o1
|
The cache for first object.
|
[in]
|
M2
|
The world matrix of second object.
|
[in]
|
o2
|
The cache for second object.
|
[in]
|
flag
|
The method:
COL_CONTACT
|
-
返回
-
The result:
COL
◆
DoPolyPairs()
Checks for triangles in
o1
and
o2
that are closer than
tolerance
to each other.
If the function succeeds retrieve a list of colliding triangle pairs with
GetNumPairs()
,
GetId1()
and
GetId2()
.
-
注意
-
The matrices must be orthonormal!
-
参数
-
[in]
|
M1
|
The world matrix of first object.
|
[in]
|
o1
|
The cache for first object.
|
[in]
|
M2
|
The world matrix of second object.
|
[in]
|
o2
|
The cache for second object.
|
[in]
|
tolerance
|
The tolerance.
|
-
返回
-
The result:
COL
◆
DoTolerance()
Checks if
o1
and
o2
are closer to each other than
tolerance
.
If the function succeeds check the result with
IsCloser()
: if it returns
true
, the proof is in
GetDistance()
,
GetP1()
and
GetP2()
.
-
注意
-
The matrices must be orthonormal!
-
参数
-
[in]
|
M1
|
The world matrix of first object.
|
[in]
|
o1
|
The cache for first object.
|
[in]
|
M2
|
The world matrix of second object.
|
[in]
|
o2
|
The cache for second object.
|
[in]
|
tolerance
|
The tolerance.
|
-
返回
-
The result:
COL
◆
DoDistance()
Calculates the minimum distance between
o1
and
o2
with the accuracy specified by
rel_err
and
abs_err
.
If the function succeeds check the result with
GetDistance()
. The two closest points can be retrieved with
GetP1()
and
GetP2()
.
-
注意
-
The matrices must be orthonormal!
-
参数
-
[in]
|
M1
|
The world matrix of first object.
|
[in]
|
o1
|
The cache for first object.
|
[in]
|
M2
|
The world matrix of second object.
|
[in]
|
o2
|
The cache for second object.
|
[in]
|
rel_err
|
The maximum relative error.
|
[in]
|
abs_err
|
The maximum absolute error.
|
-
返回
-
The result:
COL
◆
FreePairsList()
Frees the pairs list.
◆
GetNumPairs()
Retrieves the number of pairs found by
DoCollide()
or
DoPolyPairs()
.
-
返回
-
The number of pairs.
◆
GetId1()
Retrieves the ID of the first triangle in the pair at
k
found by
DoCollide()
or
DoPolyPairs()
.
-
参数
-
-
返回
-
The first triangle ID in pair.
◆
GetId2()
Retrieves the ID of the second triangle in the pair at
k
found by
DoCollide()
or
DoPolyPairs()
.
-
参数
-
-
返回
-
The second triangle ID in pair.
◆
IsCloser()
Checks the result of the tolerance check done with
DoTolerance()
.
-
返回
-
true
if the objects are closer than the tolerance, otherwise
false
.
◆
GetDistance()
Retrieves the result of the distance calculation done with
DoDistance()
or
DoTolerance()
.
-
返回
-
The calculated distance.
◆
GetP1()
Retrieves the closest point found on the first object during the distance calculation done with
DoDistance()
or
DoTolerance()
.
-
返回
-
The closest point on the first object, in object coordinates.
◆
GetP2()
Retrieves the closest point found on the second object during the distance calculation done with
DoDistance()
or
DoTolerance()
.
-
返回
-
The closest point on the second object, in object coordinates.
◆
DoRayCollide()
Checks if the line segment specified by
ray_p
to
ray_p
+
ray_dir
*
ray_length
intersects the object.
If the function succeeds retrieve the list of intersections with
GetNumPairs()
,
GetId1()
and
GetId2()
.
-
参数
-
[in]
|
o1
|
The cache for the object.
|
[in]
|
ray_p
|
The start point of the ray in object coordinates
|
[in]
|
ray_dir
|
The ray direction in object coordinates.
|
[in]
|
ray_length
|
The ray length.
|
-
返回
-
The result:
COL
BaseDocument * GetActiveDocument(void)
Int32 DoCollide(const Matrix &M1, GeColliderCache *o1, const Matrix &M2, GeColliderCache *o2, Int32 flag)
Matrix GetMg() const
定义:
c4d_baseobject.h:482
void GePrint(const maxon::String &str)
BaseObject * GetNext(void)
定义:
c4d_baseobject.h:256
static String IntToString(Int32 v)
定义:
c4d_string.h:495
BaseObject * GetFirstObject(void)
#define COL_ALL_CONTACTS
All contacts.
定义:
lib_collider.h:35
定义:
c4d_basedocument.h:490