64 : mRadius(radius), mCenter(center) {}
81 return (s.
mCenter - mCenter).squaredLength() <=
97 return ((v - mCenter).squaredLength() <=
Math::Sqr(mRadius));
Sphere(const Vector3 ¢er, Real radius)
Constructor allowing arbitrary spheres.
const Vector3 & getCenter(void) const
Returns the center point of the sphere.
float Real
Software floating point type.
Defines a plane in 3D space.
Sphere()
Standard constructor - creates a unit sphere around the origin.
A 3D box aligned with the x/y/z axes.
static std::pair< bool, Real > intersects(const Ray &ray, const Plane &plane)
Ray / plane intersection, returns boolean result and distance.
bool intersects(const Plane &plane) const
Returns whether or not this sphere intersects a plane.
void setCenter(const Vector3 ¢er)
Sets the center point of the sphere.
A sphere primitive, mostly used for bounds checking.
static Real Sqr(Real fValue)
Real getRadius(void) const
Returns the radius of the sphere.
Standard 3-dimensional vector.
void setRadius(Real radius)
Sets the radius of the sphere.
bool intersects(const Sphere &s) const
Returns whether or not this sphere intersects another sphere.
bool intersects(const Vector3 &v) const
Returns whether or not this sphere intersects a point.
bool intersects(const AxisAlignedBox &box) const
Returns whether or not this sphere intersects a box.