Merge pull request #115353 from ryevdokimov/fix-child-col-repos
Fix collision repositioning for child nodes
This commit is contained in:
commit
9878cb9e72
1 changed files with 1 additions and 1 deletions
|
|
@ -4988,7 +4988,7 @@ Vector3 Node3DEditorViewport::_get_instance_position(const Point2 &p_pos, Node3D
|
|||
const Basis bb_basis = Basis(bb_basis_x, bb_basis_y, bb_basis_z);
|
||||
|
||||
// This normal-aligned Basis allows us to create an AABB that can fit on the surface plane as snugly as possible.
|
||||
const Transform3D bb_transform = Transform3D(bb_basis, p_node->get_transform().origin);
|
||||
const Transform3D bb_transform = Transform3D(bb_basis, p_node->get_global_transform().origin);
|
||||
const AABB p_node_bb = _calculate_spatial_bounds(p_node, true, &bb_transform);
|
||||
// The x-axis's alignment with the surface normal also makes it trivial to get the distance from `p_node`'s origin at (0, 0, 0) to the correct AABB face.
|
||||
const float offset_distance = -p_node_bb.position.x;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue