48 FXSphered(FXdouble x,FXdouble y,FXdouble z,FXdouble rad=0.0):center(x,y,z),radius(rad){}
57 FXSphered&
set(
const FXSphered& sphere){ center=sphere.center; radius=sphere.radius;
return *
this; }
60 FXSphered&
set(
const FXVec3d& cen,FXdouble rad=0.0){ center=cen; radius=rad;
return *
this; }
63 FXSphered&
set(FXdouble x,FXdouble y,FXdouble z,FXdouble rad=0.0){ center.
set(x,y,z); radius=rad;
return *
this; }
67 FXbool operator!=(
const FXSphered& s)
const {
return center!=s.center || radius!=s.radius;}
70 FXdouble
diameter()
const {
return radius*2.0; }
73 FXdouble
area()
const {
return radius*radius*12.5663706143591729538505735331; }
76 FXdouble
volume()
const {
return radius*radius*radius*4.18879020478639098461685784437; }
79 FXbool
empty()
const {
return radius<0.0; }
82 FXbool contains(FXdouble x,FXdouble y,FXdouble z)
const;
85 FXbool contains(
const FXVec3d& p)
const;
88 FXbool contains(
const FXRanged& box)
const;
91 FXbool contains(
const FXSphered& sphere)
const;
94 FXSphered& include(FXdouble x,FXdouble y,FXdouble z);
100 FXSphered& includeInRadius(FXdouble x,FXdouble y,FXdouble z);
118 FXint intersect(
const FXVec4d& plane)
const;
124 FXbool intersect(
const FXVec3d& pos,
const FXVec3d& dir,FXdouble hit[])
const;
135 extern FXAPI FXbool overlap(
const FXRanged& a,
const FXSphered& b);
138 extern FXAPI FXbool overlap(
const FXSphered& a,
const FXRanged& b);
141 extern FXAPI FXbool overlap(
const FXSphered& a,
const FXSphered& b);
144 extern FXAPI FXStream& operator<<(FXStream& store,
const FXSphered& sphere);
147 extern FXAPI FXStream& operator>>(FXStream& store,FXSphered& sphere);
FXbool operator==(const FXSphered &s) const
Comparison.
Definition: FXSphered.h:66
FXSphered(const FXSphered &sphere)
Copy constructor.
Definition: FXSphered.h:42
~FXSphered()
Destructor.
Definition: FXSphered.h:130
Bounds.
Definition: FXRanged.h:32
FXdouble volume() const
Volume of sphere.
Definition: FXSphered.h:76
Double-precision 3-element vector.
Definition: FXVec3d.h:28
Double-precision 4x4 matrix.
Definition: FXMat4d.h:32
Spherical bounds.
Definition: FXSphered.h:32
FXSphered(const FXVec3d &cen, FXdouble rad=0.0)
Initialize from center and radius.
Definition: FXSphered.h:45
FXSphered(FXdouble x, FXdouble y, FXdouble z, FXdouble rad=0.0)
Initialize from center and radius.
Definition: FXSphered.h:48
Definition: FX4Splitter.h:28
Double-precision 4-element vector.
Definition: FXVec4d.h:28
FXSphered()
Default constructor; value is not initialized.
Definition: FXSphered.h:39
FXSphered & set(const FXSphered &sphere)
Set value from another sphere.
Definition: FXSphered.h:57
FXdouble area() const
Area of sphere.
Definition: FXSphered.h:73
FXbool empty() const
Test if empty.
Definition: FXSphered.h:79
FXdouble diameter() const
Diameter of sphere.
Definition: FXSphered.h:70
FXSphered & operator=(const FXSphered &sphere)
Assignment.
Definition: FXSphered.h:54