mirror of
https://github.com/godotengine/godot.git
synced 2025-01-22 10:32:54 -05:00
Fix LookAtModifier rest space rotation
This commit is contained in:
parent
21a6bd8dca
commit
08a2f0ae39
1 changed files with 4 additions and 2 deletions
|
@ -501,9 +501,11 @@ void LookAtModifier3D::_process_modification() {
|
||||||
Transform3D bone_rest_space;
|
Transform3D bone_rest_space;
|
||||||
int parent_bone = skeleton->get_bone_parent(bone);
|
int parent_bone = skeleton->get_bone_parent(bone);
|
||||||
if (parent_bone < 0) {
|
if (parent_bone < 0) {
|
||||||
bone_rest_space = skeleton->get_global_transform() * skeleton->get_bone_rest(bone);
|
bone_rest_space = skeleton->get_global_transform();
|
||||||
|
bone_rest_space.origin += skeleton->get_bone_rest(bone).origin;
|
||||||
} else {
|
} else {
|
||||||
bone_rest_space = skeleton->get_global_transform() * skeleton->get_bone_global_pose(parent_bone) * skeleton->get_bone_rest(bone);
|
bone_rest_space = skeleton->get_global_transform() * skeleton->get_bone_global_pose(parent_bone);
|
||||||
|
bone_rest_space.origin += skeleton->get_bone_rest(bone).origin;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Calculate forward_vector and destination.
|
// Calculate forward_vector and destination.
|
||||||
|
|
Loading…
Reference in a new issue