Attention: Here be dragons
This is the latest
(unstable) version of this documentation, which may document features
not available in or compatible with released stable versions of Godot.
Checking the stable version of the documentation...
CopyTransformModifier3D
繼承: BoneConstraint3D < SkeletonModifier3D < Node3D < Node < Object
對骨骼應用變換的 SkeletonModifier3D,變換複製自參考骨骼。
說明
Apply the copied transform of the bone set by BoneConstraint3D.set_reference_bone() to the bone set by BoneConstraint3D.set_apply_bone() with processing it with some masks and options.
There are 4 ways to apply the transform, depending on the combination of set_relative() and set_additive().
Relative + Additive:
Extract reference pose relative to the rest and add it to the apply bone's pose.
Relative + Not Additive:
Extract reference pose relative to the rest and add it to the apply bone's rest.
Not Relative + Additive:
Extract reference pose absolutely and add it to the apply bone's pose.
Not Relative + Not Additive:
Extract reference pose absolutely and the apply bone's pose is replaced with it.
Note: The relative and global options are only available when BoneConstraint3D.get_reference_type() is BoneConstraint3D.REFERENCE_TYPE_BONE. See also ReferenceType.
屬性
|
方法
BitField[AxisFlag] |
get_axis_flags(index: int) const |
BitField[TransformFlag] |
get_copy_flags(index: int) const |
BitField[AxisFlag] |
get_invert_flags(index: int) const |
is_additive(index: int) const |
|
is_axis_x_enabled(index: int) const |
|
is_axis_x_inverted(index: int) const |
|
is_axis_y_enabled(index: int) const |
|
is_axis_y_inverted(index: int) const |
|
is_axis_z_enabled(index: int) const |
|
is_axis_z_inverted(index: int) const |
|
is_position_copying(index: int) const |
|
is_relative(index: int) const |
|
is_rotation_copying(index: int) const |
|
is_scale_copying(index: int) const |
|
void |
set_additive(index: int, enabled: bool) |
void |
set_axis_flags(index: int, axis_flags: BitField[AxisFlag]) |
void |
set_axis_x_enabled(index: int, enabled: bool) |
void |
set_axis_x_inverted(index: int, enabled: bool) |
void |
set_axis_y_enabled(index: int, enabled: bool) |
void |
set_axis_y_inverted(index: int, enabled: bool) |
void |
set_axis_z_enabled(index: int, enabled: bool) |
void |
set_axis_z_inverted(index: int, enabled: bool) |
void |
set_copy_flags(index: int, copy_flags: BitField[TransformFlag]) |
void |
set_copy_position(index: int, enabled: bool) |
void |
set_copy_rotation(index: int, enabled: bool) |
void |
set_copy_scale(index: int, enabled: bool) |
void |
set_global(index: int, enabled: bool) |
void |
set_invert_flags(index: int, axis_flags: BitField[AxisFlag]) |
void |
set_relative(index: int, enabled: bool) |
列舉
flags TransformFlag: 🔗
TransformFlag TRANSFORM_FLAG_POSITION = 1
如果設定,則會允許複製位置。
TransformFlag TRANSFORM_FLAG_ROTATION = 2
如果設定,則會允許複製旋轉。
TransformFlag TRANSFORM_FLAG_SCALE = 4
如果設定,則會允許複製縮放。
TransformFlag TRANSFORM_FLAG_ALL = 7
如果設定,則會允許複製位置、旋轉、縮放。
flags AxisFlag: 🔗
AxisFlag AXIS_FLAG_X = 1
如果設定,則會允許處理 X 軸。
AxisFlag AXIS_FLAG_Y = 2
如果設定,則會允許處理 Y 軸。
AxisFlag AXIS_FLAG_Z = 4
如果設定,則會允許處理 Z 軸。
AxisFlag AXIS_FLAG_ALL = 7
如果設定,則會允許處理所有軸。
屬性說明
此修改器中的設定項數量。
方法說明
BitField[AxisFlag] get_axis_flags(index: int) const 🔗
回傳索引為 index 的設定的軸標誌。
BitField[TransformFlag] get_copy_flags(index: int) const 🔗
回傳索引為 index 的設定的複製標誌。
BitField[AxisFlag] get_invert_flags(index: int) const 🔗
回傳索引為 index 的設定的翻轉標誌。
bool is_additive(index: int) const 🔗
如果索引為 index 的設定啟用了加法選項,則回傳 true。
bool is_axis_x_enabled(index: int) const 🔗
如果索引為 index 的設定的啟用標誌中存在 X 軸對應的標誌,則回傳 true。另見 set_axis_flags()。
bool is_axis_x_inverted(index: int) const 🔗
如果索引為 index 的設定的翻轉標誌中存在 X 軸對應的標誌,則回傳 true。另見 set_invert_flags()。
bool is_axis_y_enabled(index: int) const 🔗
如果索引為 index 的設定的啟用標誌中存在 Y 軸對應的標誌,則回傳 true。另見 set_axis_flags()。
bool is_axis_y_inverted(index: int) const 🔗
如果索引為 index 的設定的翻轉標誌中存在 Y 軸對應的標誌,則回傳 true。另見 set_invert_flags()。
bool is_axis_z_enabled(index: int) const 🔗
如果索引為 index 的設定的啟用標誌中存在 Z 軸對應的標誌,則回傳 true。另見 set_axis_flags()。
bool is_axis_z_inverted(index: int) const 🔗
如果索引為 index 的設定的翻轉標誌中存在 Z 軸對應的標誌,則回傳 true。另見 set_invert_flags()。
bool is_global(index: int) const 🔗
Returns true if the global option is enabled in the setting at index.
bool is_position_copying(index: int) const 🔗
如果索引為 index 的設定的複製標誌中存在位置對應的標誌,則回傳 true。另見 set_copy_flags()。
bool is_relative(index: int) const 🔗
如果索引為 index 的設定啟用了相對選項,則回傳 true。
bool is_rotation_copying(index: int) const 🔗
如果索引為 index 的設定的複製標誌中存在旋轉對應的標誌,則回傳 true。另見 set_copy_flags()。
bool is_scale_copying(index: int) const 🔗
如果索引為 index 的設定的複製標誌中存在縮放對應的標誌,則回傳 true。另見 set_copy_flags()。
void set_additive(index: int, enabled: bool) 🔗
Sets additive option in the setting at index to enabled. This mainly affects the process of applying transform to the BoneConstraint3D.set_apply_bone().
If enabled is true, the processed transform is added to the pose of the current apply bone.
If enabled is false, the pose of the current apply bone is replaced with the processed transform. However, if set set_relative() to true, the transform is relative to rest.
void set_axis_flags(index: int, axis_flags: BitField[AxisFlag]) 🔗
設定複製軸標誌。如果標誌有效,則會複製對應的軸。
void set_axis_x_enabled(index: int, enabled: bool) 🔗
If enabled is true, the X-axis will be copied.
void set_axis_x_inverted(index: int, enabled: bool) 🔗
If enabled is true, the X-axis will be inverted.
void set_axis_y_enabled(index: int, enabled: bool) 🔗
If enabled is true, the Y-axis will be copied.
void set_axis_y_inverted(index: int, enabled: bool) 🔗
If enabled is true, the Y-axis will be inverted.
void set_axis_z_enabled(index: int, enabled: bool) 🔗
If enabled is true, the Z-axis will be copied.
void set_axis_z_inverted(index: int, enabled: bool) 🔗
If enabled is true, the Z-axis will be inverted.
void set_copy_flags(index: int, copy_flags: BitField[TransformFlag]) 🔗
設定處理變換操作的標誌。如果標誌有效,則會處理變換操作。
注意:如果旋轉僅對一個軸有效,就會考慮有效軸的滾轉值。如果旋轉對兩個軸有效,就會丟棄無效軸的滾轉值。
void set_copy_position(index: int, enabled: bool) 🔗
If enabled is true, the position will be copied.
void set_copy_rotation(index: int, enabled: bool) 🔗
If enabled is true, the rotation will be copied.
void set_copy_scale(index: int, enabled: bool) 🔗
If enabled is true, the scale will be copied.
void set_global(index: int, enabled: bool) 🔗
Sets the global option in the setting at index to enabled.
If enabled is true, the global pose of the reference bone is extracted and applied so that the global pose of the apply bone coincides with it.
If enabled is false, the local pose of the reference bone is extracted and applied to the local pose of the apply bone.
Note: If the parent of the reference bone has a non-uniform scale, the reference bone is sheared as seen from global space. Since the local pose cannot bring in the shear, the scale may not be applied as intended.
void set_invert_flags(index: int, axis_flags: BitField[AxisFlag]) 🔗
設定翻轉軸的標誌。如果標誌有效,則會複製該軸。
注意:縮放翻轉意味著對數值取倒數,並不是負數縮放。例如將 2.0 翻轉就是 0.5。
注意:旋轉翻轉會翻轉四元數的元素。例如,雙軸反轉會翻轉每個軸的滾轉,而三軸反轉會翻轉最終朝向。不過請注意,僅翻轉一個軸可能會導致未翻轉軸的意外旋轉,這是由於四元數的特性所導致的。
void set_relative(index: int, enabled: bool) 🔗
Sets relative option in the setting at index to enabled.
If enabled is true, the extracted and applying transform is relative to the rest.
If enabled is false, the extracted transform is absolute.