-
Notifications
You must be signed in to change notification settings - Fork 0
/
vxRange.h
39 lines (32 loc) · 1.35 KB
/
vxRange.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/**
*
* @file vxRange.h
\brief Defines an Range as Axis Aligned Bounding Box in the scene.
Used for texture reload once the current cursor position runs out of the loaded texture. Fairly general, though, supports ContainsPoint, ContainsRange queries.
*
* This header file is a part of VoxelBrain software.
*
* (c) Nanyang Technological University
*
* Author: Konstantin Levinski
*
*/
#ifndef __vxRange_h__
#define __vxRange_h__
#include "vxVector.h"
#include "vxValidatable.h"
/*! \brief A structure for storing Axis - Aligned ranges.
Defined by two corners. */
struct Range{
V3f min; //!< \brief Lower-Further corner.
V3f max; //!< \brief Upper-Closer corner.
Range(const V3f &, const V3f &); //!< \brief Constructor. Takes two corners.
Range(); //!< \brief Constructs zero range, so that it can be expanded.
Range(const Range &); //!< \brief Copy-constructor.
};
bool ContainsPoint(const Range &, const V3f &); //!< \brief Returns true if the point is inside.
bool ContainsRange(const Range &, const Range &); //!< \brief Returns true if two points are inside.
bool IntersectsRange(const Range &, const Range &); //!< \brief Returns true if one of the two poits is inside.
Range & ExpandRange(Range &, const V3f &); //!< \brief Expands the range to fit the point. Returns *this for further chaining.
#endif // __vxRange_h__
//End of vxRange.h