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