From f3888782da4608c4a4523216c4159113fccf9bc9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20=E2=80=98Touky=E2=80=99=20Huet?= Date: Sat, 24 May 2014 04:38:15 +0000 Subject: [PATCH] geom tweak --- src/lol/algorithm/aabb_tree.h | 5 +++-- src/lol/math/geometry.h | 20 ++++++++++++++++++++ 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/src/lol/algorithm/aabb_tree.h b/src/lol/algorithm/aabb_tree.h index 5ffecdc1..a288dc5e 100644 --- a/src/lol/algorithm/aabb_tree.h +++ b/src/lol/algorithm/aabb_tree.h @@ -333,8 +333,9 @@ public: } //-- - void SetSize(TV size) { m_size = size; } - void SetMaxDepth(int max_depth) { m_max_depth = max_depth; } + void SetSize(TV size) { m_size = size; } + void SetMaxDepth(int max_depth) { m_max_depth = max_depth; } + void SetMaxElement(int max_element) { m_max_element = max_element; } Array const & GetTree() const { diff --git a/src/lol/math/geometry.h b/src/lol/math/geometry.h index cd8f1b4c..985b21d5 100644 --- a/src/lol/math/geometry.h +++ b/src/lol/math/geometry.h @@ -79,6 +79,16 @@ template struct Box2 return *this = *this - v; } + Box2 operator *(Vec2 const &v) const + { + return Box2(A * v, B * v); + } + + Box2 &operator *=(Vec2 const &v) + { + return *this = *this * v; + } + bool operator ==(Box2 const &box) { return A == box.A && B == box.B; @@ -134,6 +144,16 @@ template struct Box3 return *this = *this - v; } + Box3 operator *(Vec3 const &v) const + { + return Box3(A * v, B * v); + } + + Box3 &operator *=(Vec3 const &v) + { + return *this = *this * v; + } + bool operator ==(Box3 const &box) { return A == box.A && B == box.B;