48 FXSphered(FXdouble x,FXdouble y,FXdouble z,FXdouble rad=0.0):center(x,y,z),radius(rad){}
60 FXSphered&
set(
const FXSphered& sphere){ center=sphere.center; radius=sphere.radius;
return *
this; }
63 FXSphered&
set(
const FXVec3d& cen,FXdouble rad=0.0){ center=cen; radius=rad;
return *
this; }
66 FXSphered&
set(FXdouble x,FXdouble y,FXdouble z,FXdouble rad=0.0){ center.
set(x,y,z); radius=rad;
return *
this; }
70 FXbool operator!=(
const FXSphered& s)
const {
return center!=s.center || radius!=s.radius;}
73 FXdouble
diameter()
const {
return radius*2.0; }
76 FXdouble
area()
const {
return radius*radius*12.5663706143591729538505735331; }
79 FXdouble
volume()
const {
return radius*radius*radius*4.18879020478639098461685784437; }
82 FXbool
empty()
const {
return radius<0.0; }
85 FXbool contains(FXdouble x,FXdouble y,FXdouble z)
const;
88 FXbool contains(
const FXVec3d& p)
const;
91 FXbool contains(
const FXRanged& box)
const;
94 FXbool contains(
const FXSphered& sphere)
const;
97 FXSphered& include(FXdouble x,FXdouble y,FXdouble z);
103 FXSphered& includeInRadius(FXdouble x,FXdouble y,FXdouble z);
121 FXint intersect(
const FXVec4d& plane)
const;
127 FXbool intersect(
const FXVec3d& pos,
const FXVec3d& dir,FXdouble hit[])
const;
138 extern FXAPI FXbool overlap(
const FXRanged& a,
const FXSphered& b);
141 extern FXAPI FXbool overlap(
const FXSphered& a,
const FXRanged& b);
144 extern FXAPI FXbool overlap(
const FXSphered& a,
const FXSphered& b);
147 extern FXAPI FXStream& operator<<(FXStream& store,
const FXSphered& sphere);
150 extern FXAPI FXStream& operator>>(FXStream& store,FXSphered& sphere);
FXbool operator==(const FXSphered &s) const
Comparison.
Definition: FXSphered.h:69
FXSphered(const FXSphered &sphere)
Copy constructor.
Definition: FXSphered.h:42
~FXSphered()
Destructor.
Definition: FXSphered.h:133
Bounds.
Definition: FXRanged.h:32
FXdouble volume() const
Volume of sphere.
Definition: FXSphered.h:79
Double-precision 3-element vector.
Definition: FXVec3d.h:28
Double-precision 4x4 matrix.
Definition: FXMat4d.h:32
Spherical bounds.
Definition: FXSphered.h:32
FXSphered & operator=(const FXVec3d &cen)
Assign with vector.
Definition: FXSphered.h:54
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:60
FXdouble area() const
Area of sphere.
Definition: FXSphered.h:76
FXbool empty() const
Test if empty.
Definition: FXSphered.h:82
FXdouble diameter() const
Diameter of sphere.
Definition: FXSphered.h:73
FXSphered & operator=(const FXSphered &sphere)
Assignment.
Definition: FXSphered.h:57