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