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...
LookAtModifier3D
Hérite de : SkeletonModifier3D < Node3D < Node < Object
Le LookAtModifier3D tourne un os pour regarder une cible.
Description
Ce SkeletonModifier3D tourne un os pour qu'il regarde une cible. Ceci est utile pour déplacer la tête d'un personnage pour qu'il regarde le joueur, tourner une tourelle pour qu'elle regarde une cible, ou tout autre cas où vous voulez faire tourner un os vers quelque chose rapidement et facilement.
Lors de l'application de plusieurs LookAtModifier3Ds, le LookAtModifier3D assigné à l'os parent doit être placé au-dessus du LookAtModifier3D assigné à l'os enfant dans la liste afin que les résultats de l'os enfant soient corrects.
Propriétés
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
Méthodes
get_interpolation_remaining() const |
|
is_interpolating() const |
|
is_target_within_limitation() const |
Énumérations
enum OriginFrom: 🔗
OriginFrom ORIGIN_FROM_SELF = 0
La position de repos de l'os spécifié dans bone est utilisée comme origine.
OriginFrom ORIGIN_FROM_SPECIFIC_BONE = 1
La position de pose globale d'os de l'os spécifié dans origin_bone est utilisée comme origine.
Note : Il est recommandé de sélectionner uniquement l'os parent à moins que vous ne connaissiez le processus de traitement des os. La pose d'os spécifiée au moment où LookAtModifier3D est traité est utilisée comme référence. En d'autres termes, si vous spécifiez un os enfant et que le LookAtModifier3D déplace l'os enfant, le résultat rendu et la direction ne correspondront pas.
OriginFrom ORIGIN_FROM_EXTERNAL_NODE = 2
La position globale du Node3D spécifié dans origin_external_node est utilisée comme origine.
Note : Comme avec ORIGIN_FROM_SPECIFIC_BONE, lorsqu'un BoneAttachment3D avec un os enfant assigné est spécifié, le résultat rendu et la direction ne correspondront pas.
Descriptions des propriétés
Index de bone_name dans le Skeleton3D parent.
Le nom de l'os du Skeleton3D sur lequel la modification va opérer.
The duration of the time-based interpolation. Interpolation is triggered at the following cases:
When the target node is changed
When an axis is flipped due to angle limitation
Note: The flipping occurs when the target is outside the angle limitation and the internally computed secondary rotation axis of the forward vector is flipped. Visually, it occurs when the target is outside the angle limitation and crosses the plane of the forward_axis and primary_rotation_axis.
Le type d'accélération de l'interpolation temporelle. Voir aussi EaseType.
L'axe avant de l'os. Ce SkeletonModifier3D modifie l'os de sorte à ce que cet axe pointe vers target_node.
Index de origin_bone_name dans le Skeleton3D parent.
Si origin_from vaut ORIGIN_FROM_SPECIFIC_BONE, la position de pose globale de l'os spécifié pour cela est utilisée comme origine.
NodePath origin_external_node 🔗
Si origin_from vaut ORIGIN_FROM_EXTERNAL_NODE, la position globale du Node3D spécifié pour cela est utilisée comme origine.
OriginFrom origin_from = 0 🔗
void set_origin_from(value: OriginFrom)
OriginFrom get_origin_from()
Cette valeur détermine de quoi l'origine est récupérée pour le calcul du vecteur avant.
Vector3 origin_offset = Vector3(0, 0, 0) 🔗
Le décalage de l'origine de la pose de l'os. Faire correspondre les origines par décalage est utile pour les cas où plusieurs os doivent toujours faire face à la même direction, comme les yeux.
Note : Cette valeur indique la position locale de l'objet défini dans origin_from.
float origin_safe_margin = 0.1 🔗
Si la cible passe plus près de l'origine que cette valeur, l'interpolation temporelle est utilisée même si la cible est dans les limites d'angle, pour empêcher la vitesse angulaire de devenir trop élevée.
float primary_damp_threshold 🔗
The threshold to start damping for primary_limit_angle. It provides non-linear (b-spline) interpolation, let it feel more resistance the more it rotate to the edge limit. This is useful for simulating the limits of human motion.
If 1.0, no damping is performed. If 0.0, damping is always performed.
The limit angle of the primary rotation when symmetry_limitation is true, in radians.
float primary_negative_damp_threshold 🔗
Le seuil pour commencer l'amortissement pour primary_negative_limit_angle.
float primary_negative_limit_angle 🔗
The limit angle of negative side of the primary rotation when symmetry_limitation is false, in radians.
float primary_positive_damp_threshold 🔗
Le seuil pour commencer l'amortissement pour primary_positive_limit_angle.
float primary_positive_limit_angle 🔗
The limit angle of positive side of the primary rotation when symmetry_limitation is false, in radians.
Axis primary_rotation_axis = 1 🔗
L'axe de la première rotation. Ce SkeletonModifier3D fonctionne en composant la rotation avec des angles d'Euler pour éviter de tourner forward_axis.
The relative option. If true, the rotation is applied relative to the pose. If false, the rotation is applied relative to the rest. It means to replace the current pose with the LookAtModifier3D's result.
Note: This option affects the base angle for use_angle_limitation. Since the LookAtModifier3D relies strongly on Euler rotation, the axis that determines the limitation and the actual rotation are strongly tied together.
float secondary_damp_threshold 🔗
Le seuil pour commencer l'amortissement pour secondary_limit_angle.
The limit angle of the secondary rotation when symmetry_limitation is true, in radians.
float secondary_negative_damp_threshold 🔗
void set_secondary_negative_damp_threshold(value: float)
float get_secondary_negative_damp_threshold()
Le seuil pour commencer l'amortissement pour secondary_negative_limit_angle.
float secondary_negative_limit_angle 🔗
The limit angle of negative side of the secondary rotation when symmetry_limitation is false, in radians.
float secondary_positive_damp_threshold 🔗
void set_secondary_positive_damp_threshold(value: float)
float get_secondary_positive_damp_threshold()
Le seuil pour commencer l'amortissement pour secondary_positive_limit_angle.
float secondary_positive_limit_angle 🔗
The limit angle of positive side of the secondary rotation when symmetry_limitation is false, in radians.
If true, the limitations are spread from the bone symmetrically.
If false, the limitation can be specified separately for each side of the bone rest.
NodePath target_node = NodePath("") 🔗
Le NodePath vers le nœud qui est la cible du modificateur "LookAt". Ce nœud est celui vers lequel la modification va faire tourner l'os.
TransitionType transition_type = 0 🔗
void set_transition_type(value: TransitionType)
TransitionType get_transition_type()
Le type de transition de l'interpolation temporelle. Voir aussi TransitionType.
bool use_angle_limitation = false 🔗
If true, limits the amount of rotation. For example, this helps to prevent a character's neck from rotating 360 degrees.
Note: As with AnimationTree blending, interpolation is provided that favors Skeleton3D.get_bone_rest() or Skeleton3D.get_bone_pose() depends on the relative option. This means that interpolation does not select the shortest path in some cases.
Note: Some values for transition_type (such as Tween.TRANS_BACK, Tween.TRANS_ELASTIC, and Tween.TRANS_SPRING) may exceed the limitations. If interpolation occurs while overshooting the limitations, the result might not respect the bone rest.
bool use_secondary_rotation = true 🔗
Si true, fournit une rotation à deux axes.
Descriptions des méthodes
float get_interpolation_remaining() const 🔗
Renvoie les secondes restantes de l'interpolation temporelle.
bool is_interpolating() const 🔗
Renvoie true si l'interpolation temporelle est en cours d'exécution. Si true, ceci est équivalent à get_interpolation_remaining() renvoyant 0.0.
Ceci est utile pour déterminer si un LookAtModifier3D peut être retiré en toute sécurité.
bool is_target_within_limitation() const 🔗
Renvoie si la cible est dans les limites d'angle. Ceci est utile de retirer le target_node lorsque la cible est hors des limites d'angle.
Note : La valeur est mise à jour après SkeletonModifier3D._process_modification(). Pour récupérer cette valeur correctement, nous vous recommandons d'utiliser le signal SkeletonModifier3D.modification_processed.