You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Merging multiple MeshInstance3D's AABBs does not return the dimensions of the combined AABB.
Also, AABB does NOT seem to be affected by any transformations.
Steps to reproduce
Place a standard MeshInstance3D Cube in the hierarchy. Leave cube size as default (1 x 1 x 1).
Place another standard MeshInstance3D Cube in the hierarchy. Leave cube size as default (1 x 1 x 1).
Move the second cube along the Global X-axis by 5 units. It can be any axis and any amount, but this is for testing.
Realize that the AABB which encloses both cubes SHOULD have an X-axis length of AT LEAST 5 units. Exact value should be 6 units.
See that the output is always 1. You can output AABB origin and dimensions as well with GD.Print( mergedAABB ). Observe that the values don't make sense.
Transform any cube by scaling/rotating it, then return its AABB. Observe that the AABB does not take into account any transformations.
The AABB returned by MeshInstance3D::get_aabb returns the AABB of the mesh resource which doesn't have information about the transform of the Mesh. In other words, the AABB is in the local space of the mesh and needs to be transformed by the MeshIntance3D's transform.
This fact should be documented in VisualInstance:get_aabb (after checking that the same is true for all other classes that inherit that method)
Tested versions
Godot 4.2 .Net, Godot 4.3 RC1 .Net
System information
Win10 x64 22H2
Issue description
Merging multiple MeshInstance3D's AABBs does not return the dimensions of the combined AABB.
Also, AABB does NOT seem to be affected by any transformations.
Steps to reproduce
Place a standard MeshInstance3D Cube in the hierarchy. Leave cube size as default (1 x 1 x 1).
Place another standard MeshInstance3D Cube in the hierarchy. Leave cube size as default (1 x 1 x 1).
Move the second cube along the Global X-axis by 5 units. It can be any axis and any amount, but this is for testing.
Realize that the AABB which encloses both cubes SHOULD have an X-axis length of AT LEAST 5 units. Exact value should be 6 units.
Perform
AABB mergedAABB = Cube1.GetAABB().Merge( Cube2.GetAABB() )
Perform
GD.Print( mergedAABB .GetLongestAxisSize() )
See that the output is always 1. You can output AABB origin and dimensions as well with
GD.Print( mergedAABB )
. Observe that the values don't make sense.Transform any cube by scaling/rotating it, then return its AABB. Observe that the AABB does not take into account any transformations.
Minimal reproduction project (MRP)
aabb-issue.zip
The text was updated successfully, but these errors were encountered: