51 FXRangef(FXfloat x,FXfloat y,FXfloat z):lower(x,y,z),upper(x,y,z){}
54 FXRangef(FXfloat xl,FXfloat xh,FXfloat yl,FXfloat yh,FXfloat zl,FXfloat zh):lower(xl,yl,zl),upper(xh,yh,zh){}
66 FXRangef&
set(
const FXRangef& bounds){ lower=bounds.lower; upper=bounds.upper;
return *
this; }
75 FXRangef&
set(FXfloat x,FXfloat y,FXfloat z){ lower.x=upper.x=x; lower.y=upper.y=y; lower.z=upper.z=z;
return *
this; }
78 FXRangef&
set(FXfloat xl,FXfloat xh,FXfloat yl,FXfloat yh,FXfloat zl,FXfloat zh){ lower.
set(xl,yl,zl); upper.
set(xh,yh,zh);
return *
this; }
88 FXbool operator!=(
const FXRangef& r)
const {
return lower!=r.lower || upper!=r.upper; }
91 FXfloat
width()
const {
return upper.x-lower.x; }
94 FXfloat
height()
const {
return upper.y-lower.y; }
97 FXfloat
depth()
const {
return upper.z-lower.z; }
100 FXfloat
area()
const {
return (width()*height()+width()*depth()+height()*depth())*2.0f; }
103 FXfloat
volume()
const {
return width()*height()*depth(); }
106 FXfloat longest()
const;
109 FXfloat shortest()
const;
112 FXfloat diameter()
const;
115 FXfloat radius()
const;
124 FXbool empty()
const;
127 FXbool contains(FXfloat x,FXfloat y,FXfloat z)
const;
130 FXbool contains(
const FXVec3f& p)
const;
133 FXbool contains(
const FXRangef& bounds)
const;
136 FXbool contains(
const FXSpheref& sphere)
const;
139 FXRangef& include(FXfloat x,FXfloat y,FXfloat z);
151 FXint intersect(
const FXVec4f& plane)
const;
157 FXbool intersect(
const FXVec3f& pos,
const FXVec3f& dir,FXfloat hit[])
const;
171 extern FXAPI FXbool overlap(
const FXRangef& a,
const FXRangef& b);
174 extern FXAPI FXRangef unite(
const FXRangef& a,
const FXRangef& b);
177 extern FXAPI FXRangef intersect(
const FXRangef& a,
const FXRangef& b);
180 extern FXAPI FXStream& operator<<(FXStream& store,
const FXRangef& bounds);
183 extern FXAPI FXStream& operator>>(FXStream& store,FXRangef& bounds);
FXVec3f & set(FXfloat d)
Assign with constant.
Definition: FXVec3f.h:66
FXfloat volume() const
Volume of box.
Definition: FXRangef.h:103
FXRangef(const FXVec3f &p)
Initialize with a single point.
Definition: FXRangef.h:45
~FXRangef()
Destructor.
Definition: FXRangef.h:166
FXfloat area() const
Area of box.
Definition: FXRangef.h:100
FXVec3f corner(FXint c) const
Get corner number 0..7.
Definition: FXRangef.h:160
FXRangef(const FXRangef &bounds)
Initialize with another range.
Definition: FXRangef.h:42
FXfloat width() const
Width of box.
Definition: FXRangef.h:91
Definition: FX4Splitter.h:28
FXVec3f & operator[](FXint i)
Indexing with 0..1.
Definition: FXRangef.h:81
FXRangef(FXfloat x, FXfloat y, FXfloat z)
Initialize with a single point.
Definition: FXRangef.h:51
FXRangef(FXfloat xl, FXfloat xh, FXfloat yl, FXfloat yh, FXfloat zl, FXfloat zh)
Initialize with explicit values.
Definition: FXRangef.h:54
Single-precision 3-element vector.
Definition: FXVec3f.h:28
Single-precision 4x4 matrix.
Definition: FXMat4f.h:32
FXRangef & operator=(const FXVec3f &p)
Assign with vector.
Definition: FXRangef.h:60
Spherical bounds.
Definition: FXSpheref.h:32
Bounds.
Definition: FXRangef.h:32
FXfloat height() const
Height of box.
Definition: FXRangef.h:94
const FXVec3f & operator[](FXint i) const
Indexing with 0..1.
Definition: FXRangef.h:84
FXRangef()
Default constructor; value is not initialized.
Definition: FXRangef.h:39
FXRangef(const FXVec3f &l, const FXVec3f &h)
Initialize with corner points.
Definition: FXRangef.h:48
FXbool operator==(const FXRangef &r) const
Comparison.
Definition: FXRangef.h:87
FXfloat depth() const
Depth of box.
Definition: FXRangef.h:97
FXRangef & operator=(const FXRangef &bounds)
Assignment.
Definition: FXRangef.h:63
Single-precision 4-element vector.
Definition: FXVec4f.h:28