I'm building a VR inventory, where each inventory slot is an Area with a BoxShape CollisionShape. When the player drops an item in the inventory slot, I want it to shrink down until it is fully contained in the Area. I see where I can get an AABB for the mesh instance and compare that to other AABBs, but I can't find a way to get a AABB for the Area. Is there a way to do that, or is there another approach that would work better?
Is it possible to get an AABB for an Area or it's collision shape?
I don't think there is a way to get the AABB for an Area in Godot, at least not by default. You can make your own AABB manually through code though, as long as you know the rough size of the shape and its position.
Another way you might be able to achieve the same effect, though it's more complicated and computationally costly, is having small Area nodes on each corner of the Area. Then you can use these nodes to detect if the object is fully enclosed in the inventory by checking to see if each of the Area nodes on the corner are inside the same collision shape. I'm fairly positive this would work, but it seems rather costly.
- Edited
If your area is of a perfect square shape then @TwistedTwigleg's idea only requires two boundary areas at opposite edges I would think.
edit: in that square case it could potentially get away with just one actually.