xyz doesnt this return AABB in global coordinates?
var p_aabb = picked_up_obj.item_mesh.global_transform * picked_up_obj.item_mesh.get_aabb()
And this:
for n in hand_node.get_children():
if n is Item:
var child:Item = n
var mesh=child.item_mesh
var m_aabb = mesh.global_transform*mesh.get_aabb().abs()
total_size.y = max(total_size.y,m_aabb.end.y) - hand_node.global_position.y
WHere
var m_aabb = mesh.global_transform*mesh.get_aabb().abs()
Is in global coords?
then i just add picked up AABB size to the hand's AABB max Y value
total_size.y = total_size.y + p_aabb.size.y
And then calculate the picked_up_obj
nodes offset:
var result_y = total_size.y - picked_up_obj.item_mesh.global_transform.origin.y
It seems to me that all these are in global coords?
I dont see where im missing something?