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){}
63 FXRangef&
set(
const FXRangef& bounds){ lower=bounds.lower; upper=bounds.upper;
return *
this; }
72 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; }
75 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; }
85 FXbool operator!=(
const FXRangef& r)
const {
return lower!=r.lower || upper!=r.upper; }
88 FXfloat
width()
const {
return upper.x-lower.x; }
91 FXfloat
height()
const {
return upper.y-lower.y; }
94 FXfloat
depth()
const {
return upper.z-lower.z; }
97 FXfloat
area()
const {
return (width()*height()+width()*depth()+height()*depth())*2.0f; }
100 FXfloat
volume()
const {
return width()*height()*depth(); }
103 FXfloat longest()
const;
106 FXfloat shortest()
const;
109 FXfloat diameter()
const;
112 FXfloat radius()
const;
121 FXbool empty()
const;
124 FXbool contains(FXfloat x,FXfloat y,FXfloat z)
const;
127 FXbool contains(
const FXVec3f& p)
const;
130 FXbool contains(
const FXRangef& bounds)
const;
133 FXbool contains(
const FXSpheref& sphere)
const;
136 FXRangef& include(FXfloat x,FXfloat y,FXfloat z);
148 FXint intersect(
const FXVec4f& plane)
const;
154 FXbool intersect(
const FXVec3f& pos,
const FXVec3f& dir,FXfloat hit[])
const;
168 extern FXAPI FXbool overlap(
const FXRangef& a,
const FXRangef& b);
171 extern FXAPI FXRangef unite(
const FXRangef& a,
const FXRangef& b);
174 extern FXAPI FXRangef intersect(
const FXRangef& a,
const FXRangef& b);
177 extern FXAPI FXStream& operator<<(FXStream& store,
const FXRangef& bounds);
180 extern FXAPI FXStream& operator>>(FXStream& store,FXRangef& bounds);
FXfloat volume() const
Volume of box.
Definition: FXRangef.h:100
FXRangef(const FXVec3f &p)
Initialize with a single point.
Definition: FXRangef.h:45
~FXRangef()
Destructor.
Definition: FXRangef.h:163
FXfloat area() const
Area of box.
Definition: FXRangef.h:97
FXVec3f corner(FXint c) const
Get corner number 0..7.
Definition: FXRangef.h:157
FXRangef(const FXRangef &bounds)
Initialize with another range.
Definition: FXRangef.h:42
FXfloat width() const
Width of box.
Definition: FXRangef.h:88
Definition: FX4Splitter.h:28
FXVec3f & operator[](FXint i)
Indexing with 0..1.
Definition: FXRangef.h:78
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
Spherical bounds.
Definition: FXSpheref.h:32
Bounds.
Definition: FXRangef.h:32
FXfloat height() const
Height of box.
Definition: FXRangef.h:91
const FXVec3f & operator[](FXint i) const
Indexing with 0..1.
Definition: FXRangef.h:81
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
FXVec3f & set(const FXVec3f &v)
Set value from another vector.
Definition: FXVec3f.h:63
FXbool operator==(const FXRangef &r) const
Comparison.
Definition: FXRangef.h:84
FXfloat depth() const
Depth of box.
Definition: FXRangef.h:94
FXRangef & operator=(const FXRangef &bounds)
Assignment.
Definition: FXRangef.h:60
Single-precision 4-element vector.
Definition: FXVec4f.h:28