for
(
int
i = 0; i < poly->GetPolygonCount(); ++i)
{
if
(c.
AddTriangle
(points[tris[i].a], points[tris[i].b], points[tris[i].c], i) !=
COL_OK
)
return
false
;
}
if
(c.
EndInput
() !=
COL_OK
)
return
false
;
return
true
;
}
构造函数 & 析构函数文档编制
◆
GeColliderCache()
◆
~GeColliderCache()
成员函数文档编制
◆
Alloc()
Allocates a collider cache. Destroy the allocated collider cache with
Free()
。使用
AutoAlloc
to automate the allocation and destruction based on scope.
-
返回
-
The allocated collider cache, or
nullptr
if the allocation failed.
◆
Free()
Destructs collider caches allocated with
Alloc()
。使用
AutoAlloc
to automate the allocation and destruction based on scope.
-
参数
-
[in,out]
|
data
|
The collider cache to destruct. If the pointer is
nullptr
nothing happens. The pointer is assigned
nullptr
afterwards.
|
◆
CopyTo()
Copies all triangles to another cache.
-
参数
-
[in,out]
|
dest
|
The destination cache. The caller owns the pointed collider cache.
|
-
返回
-
true
if successful, otherwise
false
.
◆
BeginInput()
Call this function before storing triangles into the cache. Removes any previous data and allocates space for
cnt_tris
number of triangles.
-
参数
-
[in]
|
cnt_tris
|
The number of triangles to store.
|
-
返回
-
The result:
COL
◆
AddTriangle()
Adds a triangle to the cache with the specified corners and
id
.
-
参数
-
[in]
|
p1
|
The first point.
|
[in]
|
p2
|
The second point.
|
[in]
|
p3
|
The third point.
|
[in]
|
id
|
The triangle ID.
|
-
返回
-
The result:
COL
◆
EndInput()
Call this function after storing triangles into the cache.
-
返回
-
The result:
COL
AtomArray * result
定义:
operatingsystem.h:828
Bool SendModelingCommand(Int32 command, ModelingCommandData &data)
Represents a polygon that can be either a triangle or a quadrangle.
定义:
c4d_baseobject.h:43
Int32 BeginInput(Int32 cnt_tris)
Int32 & GetPoint(Int32 index) const
定义:
c4d_baseobject.h:131
Int32 AddTriangle(const Vector &p1, const Vector &p2, const Vector &p3, Int32 id)
A helper object for SendModelingCommand().
定义:
operatingsystem.h:805
BaseDocument * GetDocument()
定义:
c4d_baselist.h:1915
BaseObject * op
The input object. Use arr for multiple objects.
定义:
operatingsystem.h:819
定义:
c4d_baseobject.h:1597
#define COL_OK
OK.
定义:
lib_collider.h:25
#define MCOMMAND_TRIANGULATE
Triangulate.
定义:
ge_prepass.h:1399
#define MCOMMAND_CURRENTSTATETOOBJECT
Current state to object (returns object): MDATA_CURRENTSTATETOOBJECT.
定义:
ge_prepass.h:1410
maxon::Bool Bool
定义:
ge_sys_math.h:53
BaseDocument * doc
定义:
operatingsystem.h:817
C4DAtom * GetIndex(Int32 idx) const
定义:
c4d_baselist.h:1634