glm::vec3 Center() const noexcept {
return min + (max - min) * 0.5f;
}
+
+ /// return distance between origin and farthest vertex
+ float OriginRadius() const noexcept {
+ glm::vec3 high(glm::max(abs(min), abs(max)));
+ return length(high);
+ }
};
struct Ray {
float *dist = nullptr,
glm::vec3 *normal = nullptr) noexcept;
+/// matrices may translate and rotate, but must not scale/shear/etc
+/// (basically the first three columns must have unit length)
bool Intersection(
const AABB &a_box,
const glm::mat4 &a_m,