aabb: add expand to include point
This commit is contained in:
parent
5d9c2b1696
commit
800937086b
10
aabb.cpp
10
aabb.cpp
@ -45,6 +45,16 @@ AABB<S,T>::magnitude (void) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
template <size_t S, typename T>
|
||||||
|
void
|
||||||
|
AABB<S,T>::expand (point<S,T> p)
|
||||||
|
{
|
||||||
|
p0 = min (p, p0);
|
||||||
|
p1 = max (p, p1);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
template <size_t S, typename T>
|
template <size_t S, typename T>
|
||||||
AABB<S,T>
|
AABB<S,T>
|
||||||
|
2
aabb.hpp
2
aabb.hpp
@ -34,6 +34,8 @@ namespace util {
|
|||||||
|
|
||||||
extent<S,T> magnitude (void) const;
|
extent<S,T> magnitude (void) const;
|
||||||
|
|
||||||
|
void expand (point<S,T>);
|
||||||
|
|
||||||
AABB<S,T> operator+ (vector<S,T>) const;
|
AABB<S,T> operator+ (vector<S,T>) const;
|
||||||
AABB<S,T> operator- (vector<S,T>) const;
|
AABB<S,T> operator- (vector<S,T>) const;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user