Skip to content


AABB from_points does not work as expected #23

mbj2011 opened this Issue · 4 comments

2 participants


The initial min/max vectors might not be part of the minimal AABB containing the provided points.


I am not sure if I understand what you mean, can you provide me an example?



AABB aabb = AABB.from_points([vec3(1, 1, 1), vec3(2, 2, 2)]);

results in having the value [1, 1, 1], where it should have been [1.5, 1.5, 1.5].

I temporarily fixed it using the following code instead:

static AABBT from_points(vec3[] points) {
    AABBT res;

    res.min = res.max = points[0];

    foreach(v; points[1 .. $]) {

    return res;
@Dav1dde Dav1dde added a commit that referenced this issue
@Dav1dde Fix issue #23 b6391e3

Thank you very much, I hopefully fixed it. Since I don't have access to a compiler right now, it would be great if you could report back!


It compiles and works like it's supposed to :-)

@mbj2011 mbj2011 closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.