-
首页
-
C4D R23.110 C++ SDK
HairGuides Class Reference
Library
»
头发
#include <lib_hair.h>
详细描述
Helper class for guides/hair.
-
注意
-
Has to be created with
Alloc()
and destroyed with
Free()
。使用
AutoAlloc
to automate the allocation and destruction based on scope.
公共成员函数
|
Int32
|
GetCount
()
|
Int32
|
GetSegmentCount
()
|
Int32
|
GetPointCount
()
|
Int32
|
GetGuidePointCount
()
|
向量
*
|
GetPoints
()
|
HairGuideDynamics
*
|
GetDynamics
()
|
矩阵
|
GetMg
()
|
void
|
SetMg
(const
矩阵
&mg)
|
HairRootData
|
GetRoot
(
Int32
index)
|
void
|
SetRoot
(
Int32
index, const
HairRootData
&root,
Bool
update)
|
HairObject
*
|
GetObject
()
|
Bool
|
GetSelected
(
Int32
模式,
BaseSelect
*select)
|
Bool
|
SetSelected
(
Int32
模式,
BaseSelect
*select)
|
Bool
|
ConvertSelection
(
Int32
from_mode,
Int32
to_mode,
BaseSelect
*from_select,
BaseSelect
*to_select)
|
Bool
|
CopyFrom
(const
HairGuides
*src)
|
向量
|
GetTangent
(
Int32
guide,
Int32
segment,
Float
t)
|
SplineObject
*
|
CreateSpline
()
|
void
|
ToLocal
()
|
void
|
ToWorld
()
|
void
|
ToInitial
(
Bool
align)
|
void
|
DisplaceRoots
()
|
void
|
UndisplaceRoots
()
|
Bool
|
GetRootAxis
(
Int32
index,
矩阵
&m,
Bool
bAlign=false,
Bool
bLocal=true,
Bool
bInitial=false,
Bool
bZAxis=false)
|
向量
|
GetRootUV
(
Int32
index)
|
Bool
|
GetRootData
(
Int32
index,
向量
*p=nullptr,
向量
*n=nullptr,
Int32
*ply_id=nullptr,
Bool
bLocal=true,
Bool
bDisplaced=true,
Bool
bInitial=false)
|
矩阵
*
|
GetTransformMatrix
()
|
void
|
SetTransformMatrix
(
矩阵
*tm)
|
Bool
|
删除
(
BaseSelect
*bs)
|
Bool
|
AddRoot
(
Int32
ply_id,
Float
s,
Float
t,
Float
len)
|
Bool
|
GetRootObject
(
RootObjectData
*pData)
|
Bool
|
LinkToObject
(
HairObject
*pHair)
|
Int32
|
GetFlags
()
|
Int32
|
SetFlags
(
Int32
flags)
|
构造函数 & 析构函数文档编制
◆
HairGuides()
◆
~HairGuides()
成员函数文档编制
◆
Alloc()
Allocates a hair guides helper. Destroy the allocated hair guides helper with
Free()
。使用
AutoAlloc
to automate the allocation and destruction based on scope.
-
参数
-
[in]
|
count
|
The number of guides.
|
[in]
|
segments
|
The number of segments per guide.
|
-
返回
-
The allocated hair guides helper, or
nullptr
if the allocation failed.
◆
Free()
Destructs hair guides helpers allocated with
Alloc()
。使用
AutoAlloc
to automate the allocation and destruction based on scope.
-
参数
-
[in,out]
|
guides
|
The hair guides helper to destruct. If the pointer is
nullptr
nothing happens. The pointer is assigned
nullptr
afterwards.
|
◆
GetCount()
Gets the number of guides.
-
返回
-
The guide count.
◆
GetSegmentCount()
Int32
GetSegmentCount
|
(
|
|
)
|
|
Gets the number of segments per guide.
-
注意
-
The number of points is
GetSegmentCount()
+
1
.
-
返回
-
The segment count.
◆
GetPointCount()
Gets the total number of points for all guides.
-
返回
-
The point count.
◆
GetGuidePointCount()
Int32
GetGuidePointCount
|
(
|
|
)
|
|
Gets the number of points per segment i.e.
GetSegmentCount()
+
1
.
-
返回
-
The number of points per segment.
◆
GetPoints()
Retrieves a pointer to the point vectors for the guides.
-
返回
-
The points array.
◆
GetDynamics()
Gets the dynamics.
-
返回
-
The dynamics. Can be
nullptr
.
◆
GetMg()
Gets the global matrix.
-
返回
-
The global matrix.
◆
SetMg()
void SetMg
|
(
|
const
矩阵
&
|
mg
|
)
|
|
Sets the global matrix.
-
参数
-
[in]
|
mg
|
The new global matrix.
|
◆
GetRoot()
Gets the root data for the specified guide
index
.
-
参数
-
[in]
|
index
|
The guide index:
0
<=
index
<
GetCount()
|
-
返回
-
The root data.
◆
SetRoot()
Sets the root data for the specified guide
index
.
-
参数
-
[in]
|
index
|
The guide index:
0
<=
index
<
GetCount()
|
[in]
|
root
|
The new root data.
|
[in]
|
update
|
若
true
then an update is made.
|
◆
GetObject()
Gets the corresponding hair object.
-
返回
-
The hair object.
◆
GetSelected()
Gets the selection state.
-
参数
-
[in]
|
mode
|
The selection mode:
HAIR_MODE
|
[out]
|
select
|
Assigned the selection.
|
-
返回
-
true
if successful, otherwise
false
.
◆
SetSelected()
Sets the selection state.
-
参数
-
[in]
|
mode
|
The selection mode:
HAIR_MODE
|
[out]
|
select
|
The new selection.
|
-
返回
-
true
if successful, otherwise
false
.
◆
ConvertSelection()
Converts selection state.
-
参数
-
[in]
|
from_mode
|
The source selection mode:
HAIR_MODE
|
[in]
|
to_mode
|
The destination selection mode:
HAIR_MODE
|
[in]
|
from_select
|
The source selection.
|
[out]
|
to_select
|
The destination selection.
|
-
返回
-
true
if successful, otherwise
false
.
◆
CopyFrom()
Copies the guide data from
src
.
-
参数
-
[in]
|
src
|
The source hair guides helper.
|
-
返回
-
true
if successful, otherwise
false
.
◆
GetTangent()
Gets the tangent of
guide
at
segment
and
t
.
-
参数
-
[in]
|
guide
|
The guide index:
0
<=
guide
<
GetCount()
|
[in]
|
segment
|
The segment index:
0
<=
segment
<
GetSegmentCount()
|
[in]
|
t
|
The T coordinate.
|
-
返回
-
The tangent.
◆
CreateSpline()
Creates splines from the guides.
-
返回
-
The created spline object.
◆
ToLocal()
Changes all the points for the guides into a local coordinate system.
◆
ToWorld()
Changes all the points for the guides into the world coordinate system.
◆
ToInitial()
void ToInitial
|
(
|
Bool
|
align
|
)
|
|
Changes the coordinate space and transforms the points back to their initial state.
This is useful when applying coordinate Dependant changes to the points, by moving them back to an initial state the changes are not affecting when the guide roots move due to animation.
-
参数
-
[in]
|
align
|
若
true
the guides are rotated from their root back to their initial orientation.
|
◆
DisplaceRoots()
Used when HNs have affected the guide roots. Call
DisplaceRoots()
and it will ensure they are in the correct displaced state for HNs,
UndisplaceRoots()
will make sure they are not.
Generally not needed if using
ToInitial()
, as the initial state is undisplaced.
◆
UndisplaceRoots()
-
另请参阅
-
DisplaceRoots()
◆
GetRootAxis()
Gets the root axis of guide
index
.
-
参数
-
[in]
|
index
|
The guide index:
0
<=
index
<
GetCount()
|
[out]
|
m
|
Filled with the root axis.
|
[in]
|
bAlign
|
Aligned.
|
[in]
|
bLocal
|
Local.
|
[in]
|
bInitial
|
Initial.
|
[in]
|
bZAxis
|
若
true
then the alignment is done along the Z axis, otherwise it is Y.
|
-
返回
-
true
if successful, otherwise
false
.
◆
GetRootUV()
Gets the root UV for guide
index
.
-
参数
-
[in]
|
index
|
The guide index:
0
<=
index
<
GetCount()
|
-
返回
-
The root UV.
◆
GetRootData()
Bool
GetRootData
|
(
|
Int32
|
index
,
|
|
|
向量
*
|
p
=
nullptr
,
|
|
|
向量
*
|
n
=
nullptr
,
|
|
|
Int32
*
|
ply_id
=
nullptr
,
|
|
|
Bool
|
bLocal
=
true
,
|
|
|
Bool
|
bDisplaced
=
true
,
|
|
|
Bool
|
bInitial
=
false
|
|
)
|
|
|
Gets the root data.
-
参数
-
[in]
|
index
|
The guide index:
0
<=
index
<
GetCount()
|
[out]
|
p
|
Assigned the point.
|
[out]
|
n
|
Assigned the normal.
|
[out]
|
ply_id
|
Assigned the polygon ID..
|
[in]
|
bLocal
|
Local.
|
[in]
|
bDisplaced
|
Displaced.
|
[in]
|
bInitial
|
Initial.
|
-
返回
-
true
if successful, otherwise
false
.
◆
GetTransformMatrix()
矩阵
* GetTransformMatrix
|
(
|
|
)
|
|
Gets the transformation matrix array.
-
返回
-
The transformation matrix array. Each matrix element is an axis at the root of each guide.
Needs to be freed with
DeleteMem()
afterwards.
◆
SetTransformMatrix()
void SetTransformMatrix
|
(
|
矩阵
*
|
tm
|
)
|
|
Sets a new array of transformation matrices.
-
参数
-
[in]
|
tm
|
The new transformation matrix array. Each matrix element is an axis at the root of each guide.
|
◆
Delete()
Deletes the guide selection.
-
参数
-
[out]
|
bs
|
The selection to delete.
|
-
返回
-
true
if successful, otherwise
false
.
◆
AddRoot()
Adds a root.
-
注意
-
Invalidates any pointers or arrays returned before as the guides will have changed.
-
参数
-
[in]
|
ply_id
|
The polygon ID.
|
[in]
|
s
|
The S coordinate.
|
[in]
|
t
|
The T coordinate.
|
[in]
|
len
|
The length.
|
-
返回
-
true
if successful, otherwise
false
.
◆
GetRootObject()
Gets the root object data.
-
参数
-
[out]
|
pData
|
Filled with the root object data.
|
-
返回
-
true
if successful, otherwise
false
.
◆
LinkToObject()
Links this to a specific
HairObject
.
-
参数
-
[in]
|
pHair
|
A hair object.
|
-
返回
-
true
if successful, otherwise
false
.
◆
GetFlags()
Gets the flags.
-
返回
-
The flags:
HAIR_GUIDE_FLAGS
◆
SetFlags()
Sets the flags.
-
参数
-
-
返回
-
The old flags.