Merge pull request #43875 from addmix/create-physical-skeleton-collider-fix
Create physical skeleton collider orientation fix
This commit is contained in:
commit
887d3ee733
@ -383,6 +383,10 @@ PhysicalBone3D *Skeleton3DEditor::create_physical_bone(int bone_id, int bone_chi
|
|||||||
CollisionShape3D *bone_shape = memnew(CollisionShape3D);
|
CollisionShape3D *bone_shape = memnew(CollisionShape3D);
|
||||||
bone_shape->set_shape(bone_shape_capsule);
|
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;
|
Transform body_transform;
|
||||||
body_transform.set_look_at(Vector3(0, 0, 0), child_rest.origin, Vector3(0, 1, 0));
|
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));
|
body_transform.origin = body_transform.basis.xform(Vector3(0, 0, -half_height));
|
||||||
|
Loading…
Reference in New Issue
Block a user