Closed mbj2011 closed 10 years ago
I am not sure if I understand what you mean, can you provide me an example?
Absolutely.
AABB aabb = AABB.from_points([vec3(1, 1, 1), vec3(2, 2, 2)]);
results in aabb.center() 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 .. $]) {
res.expand(v);
}
return res;
}
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 :-)
The initial min/max vectors might not be part of the minimal AABB containing the provided points.