SkeletonModificationStack2D
实验性: This class may be changed or removed in future versions.
继承: Resource
< RefCounted
< Object
A resource that holds a stack of SkeletonModification2D
s.
描述
This resource is used by the Skeleton and holds a stack of SkeletonModification2D
s.
This controls the order of the modifications and how they are applied. Modification order is especially important for full-body IK setups, as you need to execute the modifications in the correct order to get the desired results. For example, you want to execute a modification on the spine before the arms on a humanoid skeleton.
This resource also controls how strongly all of the modifications are applied to the Skeleton2D
.
属性
方法
void | add_modification ( modification: SkeletonModification2D ) |
void | delete_modification ( mod_idx: int ) |
void | enable_all_modifications ( enabled: bool ) |
void | execute ( delta: float , execution_mode: int ) |
bool | get_is_setup ( ) const1 |
SkeletonModification2D | get_modification ( mod_idx: int ) const1 |
Skeleton2D | get_skeleton ( ) const1 |
void | set_modification ( mod_idx: int , modification: SkeletonModification2D ) |
void | setup ( ) |
属性说明
bool
enabled = false
If true
, the modification's in the stack will be called. This is handled automatically through the Skeleton2D
node.
int
modification_count = 0
The number of modifications in the stack.
float
strength = 1.0
The interpolation strength of the modifications in stack. A value of 0
will make it where the modifications are not applied, a strength of 0.5
will be half applied, and a strength of 1
will allow the modifications to be fully applied and override the Skeleton2D
Bone2D
poses.
方法说明
void
add_modification ( modification: SkeletonModification2D
)
Adds the passed-in SkeletonModification2D
to the stack.
void
delete_modification ( mod_idx: int
)
Deletes the SkeletonModification2D
at the index position mod_idx
, if it exists.
void
enable_all_modifications ( enabled: bool
)
Enables all SkeletonModification2D
s in the stack.
void
execute ( delta: float
, execution_mode: int
)
Executes all of the SkeletonModification2D
s in the stack that use the same execution mode as the passed-in execution_mode
, starting from index 0
to modification_count
.
Note: The order of the modifications can matter depending on the modifications. For example, modifications on a spine should operate before modifications on the arms in order to get proper results.
Returns a boolean that indicates whether the modification stack is setup and can execute.
SkeletonModification2D
get_modification ( mod_idx: int
) const1
Returns the SkeletonModification2D
at the passed-in index, mod_idx
.
Skeleton2D
get_skeleton ( ) const1
Returns the Skeleton2D
node that the SkeletonModificationStack2D is bound to.
void
set_modification ( mod_idx: int
, modification: SkeletonModification2D
)
Sets the modification at mod_idx
to the passed-in modification, modification
.
void
setup ( )
Sets up the modification stack so it can execute. This function should be called by Skeleton2D
and shouldn't be manually called unless you know what you are doing.
本方法通常需要用户覆盖才能生效。
本方法无副作用,不会修改该实例的任何成员变量。
本方法除了能接受在此处描述的参数外,还能够继续接受任意数量的参数。
本方法用于构造某个类型。
调用本方法无需实例,可直接使用类名进行调用。
本方法描述的是使用本类型作为左操作数的有效运算符。
这个值是由下列位标志构成位掩码的整数。
无返回值。