18 template<
int N,
class T>
class Box:
public Vector<N,T>
32 { m_size=rhs.m_size; }
40 const Vector<N,T>& size(
void)
const {
return m_size; }
49 template<
int N,
class T,
class U>
52 return Vector<N,T>(lhs).
operator==(rhs) && lhs.size()==rhs.size();
58 template<
int N,
class T,
class U>
61 return Vector<N,T>(lhs).
operator!=(rhs) || lhs.size()!=rhs.size();
67 template<
int N,
class T,
class U>
77 template<
int N,
class T,
class U,
class V>
89 template<
class T,
class U,
class V>
103 template<
int N,
class T>
107 return lhs.size()[0];
113 template<
int N,
class T>
117 return lhs.size()[1];
123 template<
int N,
class T>
127 return lhs.size()[2];
133 template<
class T,
class U,
class V,
class W,
class X>
144 template<
class T,
class U,
class V,
class W,
class X,
class Y,
class Z>
148 set(lhs.size(),w,h,d);
155 template<
class T,
class U,
class V>
165 template<
class T,
class U,
class V,
class W>
168 set(lhs.size(),w,h,d);
175 template<
class T,
class U>
178 return point[0]>box[0] && point[0]<box[0]+box.size()[0] &&
179 point[1]>box[1] && point[1]<box[1]+box.size()[1];
185 template<
class T,
class U>
188 return box1[0]+box1.size()[0]>box2[0] && box1[0]<box2[0]+box2.size()[0] &&
189 box1[1]+box1.size()[1]>box2[1] && box1[1]<box2[1]+box2.size()[1];
195 template<
class T,
class U>
198 return point[0]>box[0] && point[0]<box[0]+box.size()[0] &&
199 point[1]>box[1] && point[1]<box[1]+box.size()[1] &&
200 point[2]>box[2] && point[2]<box[2]+box.size()[2];
206 template<
class T,
class U>
209 return box1[0]+box1.size()[0]>box2[0] && box1[0]<box2[0]+box2.size()[0] &&
210 box1[1]+box1.size()[1]>box2[1] && box1[1]<box2[1]+box2.size()[1] &&
211 box1[2]+box1.size()[2]>box2[2] && box1[2]<box2[2]+box2.size()[2];
228 F32 baseRadius,F32 endRadius);
233 FE_DL_EXPORT
const Box3
aabb(
const Vector3f& location,F32 radius);
238 template<
int N,
class T>
Box< 2, T > & resize(Box< 2, T > &lhs, U w, V h)
Resize by explicit elements (2D)
Definition: Box.h:156
FE_DL_EXPORT const Box3 aabb(const Vector3f &location, const Vector3f &span, F32 baseRadius, F32 endRadius)
Returns Box enveloping a tapered cylinder.
Definition: Box.cc:13
bool intersecting(const Box< 3, T > &box, const Vector< 3, U > &point)
Returns true if the box contains the point.
Definition: Box.h:196
bool operator!=(const Box< N, T > &lhs, const Box< N, U > &rhs)
Test inequality.
Definition: Box.h:59
T height(const Box< N, T > &lhs)
Get the box height.
Definition: Box.h:114
kernel
Definition: namespace.dox:3
Box< N, T > & resize(Box< N, T > &lhs, const Vector< N, U > &size)
Change the size.
Definition: Box.h:68
bool intersecting(const Box< 2, T > &box, const Vector< 2, U > &point)
Returns true if the box contains the point.
Definition: Box.h:176
T width(const Box< N, T > &lhs)
Get the box width.
Definition: Box.h:104
bool intersecting(const Box< 2, T > &box1, const Box< 2, U > &box2)
Returns true if the boxes overlap.
Definition: Box.h:186
N-dimensional axis-aligned bounding-box.
Definition: Box.h:18
String print(const Box< N, T > &box)
Print to a string.
Definition: Box.h:239
Dense vector - size fixed by template.
Definition: Vector.h:19
T depth(const Box< N, T > &lhs)
Get the box depth.
Definition: Box.h:124
bool intersecting(const Box< 3, T > &box1, const Box< 3, U > &box2)
Returns true if the boxes overlap.
Definition: Box.h:207
Automatically reference-counted string container.
Definition: String.h:128
Box< 3, T > & resize(Box< 3, T > &lhs, U w, V h, W d)
Resize by explicit elements (3D)
Definition: Box.h:166
U32 size(const Vector< N, T > &lhs)
Return the number of elements.
Definition: Vector.h:635
bool operator==(const Box< N, T > &lhs, const Box< N, U > &rhs)
Test equality.
Definition: Box.h:50