AABB is pretty poorly coded/usable I coded myself classes to extend it. In example: getSize: return a v3 with the size minX/Y/Z: v3 min maxX/Y/Z: v3 max Setting min/max positions will actually set min and max positions.. currently maxY can be 10 and minY can be 40.. without any checks if it is true that minY is actually smaller getCenter/getMiddle: v3 center Maybe you also got ideas how to improve this (sorry for the poorly written article)
don't forget that AxisAlignedBB is heavily used in hot paths, so any change you make to already-used functionality could have widespread effects on performance.
Adding stuff for improving the class and mire functions will not create any impact on performance. A person once said: "Do not care about microoptimisations in already heavy projects" Also, these things would bring more API to developers so not every plugin has to define these functions themself (which would be less performant than api functions.)
I said changes to already-used functionality. And the opposite is also true: mess with the wrong thing and it could have consequences far more costly than you know. Adding new API methods seems reasonable, but be careful changing things that already exist.
The recent change (throwing errors when constructing with bigger min than max) honestly sucks. Instead the class should fix the order itself but throw a warning. Plenty of plugins, for example a commonly used one named "MyPlot" break because errors are thrown For reference a MCBE compatible c++ header https://github.com/ryanterry131/PocketPower/blob/master/jni/mcpe/world/phys/AABB.h The advantages of using vec3 is that those already implement funtions to move them (just add to both vec3 and tada, the aabb moved) and more
Max: Sure? This error will be shown when i clear/reset a plot in MyPlot: 09:05:18[Server thread/CRITICAL]: InvalidArgumentException: "minX -213 is larger than maxX -277" (EXCEPTION) in "vendor/pocketmine/math/src/AxisAlignedBB" at line 47 09:05:18[Server thread/DEBUG]: #0 vendor/pocketmine/math/src/AxisAlignedBB(42): pocketmine\math\AxisAlignedBB->setBounds(double -213, double 0, double 0, double -277, double 256, double 64