diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2021-01-26 00:35:23 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-26 00:35:23 +0100 |
commit | 887d3ee733e40d22b7afda496731a2eb2805519d (patch) | |
tree | 7f5f9a1523b3680929b1cb9672bbd4ff34fb5fee /editor | |
parent | 3d1dd195d40de30631f0cb7b6f485da290dee5c6 (diff) | |
parent | 177e62a7e4867a01ec17b42a527d8275c3bdfdef (diff) |
Merge pull request #43875 from addmix/create-physical-skeleton-collider-fix
Create physical skeleton collider orientation fix
Diffstat (limited to 'editor')
-rw-r--r-- | editor/plugins/skeleton_3d_editor_plugin.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/editor/plugins/skeleton_3d_editor_plugin.cpp b/editor/plugins/skeleton_3d_editor_plugin.cpp index ea58a4535b..e160e6ca0d 100644 --- a/editor/plugins/skeleton_3d_editor_plugin.cpp +++ b/editor/plugins/skeleton_3d_editor_plugin.cpp @@ -383,6 +383,10 @@ PhysicalBone3D *Skeleton3DEditor::create_physical_bone(int bone_id, int bone_chi CollisionShape3D *bone_shape = memnew(CollisionShape3D); bone_shape->set_shape(bone_shape_capsule); + Transform capsule_transform; + capsule_transform.basis = Basis(Vector3(1, 0, 0), Vector3(0, 0, 1), Vector3(0, -1, 0)); + bone_shape->set_transform(capsule_transform); + Transform body_transform; body_transform.set_look_at(Vector3(0, 0, 0), child_rest.origin, Vector3(0, 1, 0)); body_transform.origin = body_transform.basis.xform(Vector3(0, 0, -half_height)); |