Introduce box
/boxs
types instead of passing an array of two vec3(s) around
#359
Labels
box
/boxs
types instead of passing an array of two vec3(s) around
#359
While a
typedef vec3[2] box
would already be nice to have in array API since it's more explicit about meaning of a value, struct API would benefit from this change the most. Currently, due to lack of a dedicated structure, functions that return a box utilize anout
parameter instead of actually returning the struct, e.g.cglm/include/cglm/struct/box.h
Lines 49 to 51 in 1fdc1c8
This largely runs contrary to the whole idea of struct API, which tries to avoid out parameters and instead
return
results.By introducing a
boxs
struct this could be changed to far more naturalHowever, unlike
typedef
in array API, this would be a breaking change; thus I'm unsure what's the best course of action here.P.S.: I suppose types could be called
aabb
/aabbs
instead to avoid clashing with more genericbox
term and match type function prefixes as well.The text was updated successfully, but these errors were encountered: