Skip to content

cf_make_aabb_center_half_extents

Category: math
GitHub: cute_math.h


Returns an AABB (axis-aligned bounding box).

CF_Aabb cf_make_aabb_center_half_extents(CF_V2 center, CF_V2 half_extents) { CF_Aabb bb; bb.min = cf_sub(center, half_extents); bb.max = cf_add(center, half_extents); return bb; }

Remarks

Half-extents refer to half-width and height-height: half_extents = { half_width, half_height }.

CF_Aabb
cf_make_aabb
cf_make_aabb_pos_w_h
cf_make_aabb_from_top_left