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