MVE - Multi-View Environment mve-devel
Loading...
Searching...
No Matches
Namespaces | Macros | Functions
octree_tools.h File Reference
#include <limits>
#include "math/defines.h"
#include "math/vector.h"
#include "math/matrix.h"
#include "math/matrix_tools.h"
#include "math/functions.h"
Include dependency graph for octree_tools.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  math
 Vector, Matrix, basic operations, etc.
 
namespace  math::geom
 Computation of geometric quantities and predicates.
 

Macros

#define AXISTEST_X01(a, b, fa, fb)
 
#define AXISTEST_X2(a, b, fa, fb)
 
#define AXISTEST_Y02(a, b, fa, fb)
 
#define AXISTEST_Y1(a, b, fa, fb)
 
#define AXISTEST_Z0(a, b, fa, fb)
 
#define AXISTEST_Z12(a, b, fa, fb)
 

Functions

template<typename T , int N>
bool math::geom::box_box_overlap (math::Vector< T, N > const &b1min, math::Vector< T, N > const &b1max, math::Vector< T, N > const &b2min, math::Vector< T, N > const &b2max)
 Returns true if the given boxes overlap, false otherwise.
 
template<typename T >
bool math::geom::plane_box_overlap (math::Vector< T, 3 > const &normal, math::Vector< T, 3 > const &pos, math::Vector< T, 3 > const &boxhalfsize)
 Returns true if the given plane (in Hesse normal form) and a box in the origin given by 'boxhalfsizes' overlap, false otherwise.
 
template<typename T , int N>
bool math::geom::point_box_overlap (math::Vector< T, N > const &point, math::Vector< T, N > const &aabb_min, math::Vector< T, N > const &aabb_max)
 Returns true if the given point overlaps with the axis-aligned box.
 
template<typename T >
bool math::geom::ray_box_overlap (math::Vector< T, 3 > const &origin, math::Vector< T, 3 > const &dir, math::Vector< T, 3 > const &box_min, math::Vector< T, 3 > const &box_max)
 Returns true if the given ray intersects with the given axis-aligned bounding box, false otherwise.
 
template<typename T >
math::Vector< T, 2 > math::geom::ray_ray_intersect (math::Vector< T, 3 > const &p1, math::Vector< T, 3 > const &d1, math::Vector< T, 3 > const &p2, math::Vector< T, 3 > const &d2)
 Intersects the given rays with each other.
 
template<typename T >
math::geom::ray_triangle_intersect (math::Vector< T, 3 > const &origin, math::Vector< T, 3 > const &dir, math::Vector< T, 3 > const &a, math::Vector< T, 3 > const &b, math::Vector< T, 3 > const &c, float *bary=0)
 Intersects the given ray with the given triangle and returns the 't' parameter of the intersection point wrt the ray.
 
template<typename T >
bool math::geom::triangle_box_overlap (math::Vector< T, 3 > const &boxcenter, math::Vector< T, 3 > const &boxhalfsize, math::Vector< T, 3 > const &a, math::Vector< T, 3 > const &b, math::Vector< T, 3 > const &c)
 Returns true if the given triangle and box overlap, false otherwise.
 

Macro Definition Documentation

◆ AXISTEST_X01

#define AXISTEST_X01 (   a,
  b,
  fa,
  fb 
)
Value:
{ \
T p0 = a * v[0][1] - b * v[0][2]; \
T p2 = a * v[2][1] - b * v[2][2]; \
T min = std::min(p0, p2); T max = std::max(p0, p2); \
T rad = fa * boxhalfsize[1] + fb * boxhalfsize[2]; \
if (min > rad || max < -rad) return false; }

Definition at line 97 of file octree_tools.h.

◆ AXISTEST_X2

#define AXISTEST_X2 (   a,
  b,
  fa,
  fb 
)
Value:
{ \
T p0 = a * v[0][1] - b * v[0][2]; \
T p1 = a * v[1][1] - b * v[1][2]; \
T min = std::min(p0, p1); T max = std::max(p0, p1); \
T rad = fa * boxhalfsize[1] + fb * boxhalfsize[2]; \
if (min > rad || max < -rad) return false; }

Definition at line 104 of file octree_tools.h.

◆ AXISTEST_Y02

#define AXISTEST_Y02 (   a,
  b,
  fa,
  fb 
)
Value:
{ \
T p0 = -a * v[0][0] + b * v[0][2]; \
T p2 = -a * v[2][0] + b * v[2][2]; \
T min = std::min(p0, p2); T max = std::max(p0, p2); \
T rad = fa * boxhalfsize[0] + fb * boxhalfsize[2]; \
if (min > rad || max < -rad) return false; }

Definition at line 111 of file octree_tools.h.

◆ AXISTEST_Y1

#define AXISTEST_Y1 (   a,
  b,
  fa,
  fb 
)
Value:
{ \
T p0 = -a * v[0][0] + b * v[0][2]; \
T p1 = -a * v[1][0] + b * v[1][2]; \
T min = std::min(p0, p1); T max = std::max(p0, p1); \
T rad = fa * boxhalfsize[0] + fb * boxhalfsize[2]; \
if (min > rad || max < -rad) return false; }

Definition at line 118 of file octree_tools.h.

◆ AXISTEST_Z0

#define AXISTEST_Z0 (   a,
  b,
  fa,
  fb 
)
Value:
{ \
T p0 = a * v[0][0] - b * v[0][1]; \
T p1 = a * v[1][0] - b * v[1][1]; \
T min = std::min(p0, p1); T max = std::max(p0, p1); \
T rad = fa * boxhalfsize[0] + fb * boxhalfsize[1]; \
if (min > rad || max < -rad) return false; }

Definition at line 132 of file octree_tools.h.

◆ AXISTEST_Z12

#define AXISTEST_Z12 (   a,
  b,
  fa,
  fb 
)
Value:
{ \
T p1 = a * v[1][0] - b * v[1][1]; \
T p2 = a * v[2][0] - b * v[2][1]; \
T min = std::min(p1, p2); T max = std::max(p1, p2); \
T rad = fa * boxhalfsize[0] + fb * boxhalfsize[1]; \
if (min > rad || max < -rad) return false; }

Definition at line 125 of file octree_tools.h.