35 #include "ParaVector3.h" 59 : mRadius(radius), mCenter(center) {}
76 return (s.mCenter - mCenter).squaredLength() <=
77 Math::Sqr(s.mRadius + mRadius);
92 return ((v - mCenter).squaredLength() <= Math::Sqr(mRadius));
float getRadius(void) const
Returns the radius of the sphere.
Definition: ParaSphere.h:62
bool intersects(const Plane &plane) const
Returns whether or not this sphere intersects a plane.
Definition: ParaSphere.h:85
different physics engine has different winding order.
Definition: EventBinding.h:32
Sphere()
Standard constructor - creates a unit sphere around the origin.
Definition: ParaSphere.h:53
static std::pair< bool, float > intersects(const Ray &ray, const Plane &plane)
Ray / plane intersection, returns boolean result and distance.
Definition: ParaMath.cpp:316
Sphere(const Vector3 ¢er, float radius)
Constructor allowing arbitrary spheres.
Definition: ParaSphere.h:58
const Vector3 & getCenter(void) const
Returns the center point of the sphere.
Definition: ParaSphere.h:68
A sphere primitive, mostly used for bounds checking.
Definition: ParaSphere.h:46
Standard 3-dimensional vector.
Definition: ParaVector3.h:16
void setCenter(const Vector3 ¢er)
Sets the center point of the sphere.
Definition: ParaSphere.h:71
Defines a plane in 3D space.
Definition: ParaPlane.h:23
bool intersects(const Sphere &s) const
Returns whether or not this sphere intersects another sphere.
Definition: ParaSphere.h:74
bool intersects(const Vector3 &v) const
Returns whether or not this sphere intersects a point.
Definition: ParaSphere.h:90
bool intersects(const AxisAlignedBox &box) const
Returns whether or not this sphere intersects a box.
Definition: ParaSphere.h:80
A 3D box aligned with the x/y/z axes.
Definition: ParaAxisAlignedBox.h:16
void setRadius(float radius)
Sets the radius of the sphere.
Definition: ParaSphere.h:65