| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293 |
- $#include "Sphere.h"
- /// %Sphere in three-dimensional space.
- class Sphere
- {
- public:
- /// Construct undefined.
- Sphere();
-
- /// Copy-construct from another sphere.
- Sphere(const Sphere& sphere);
-
- /// Construct from center and radius.
- Sphere(const Vector3& center, float radius);
-
- /// Construct from an array of vertices.
- Sphere(const Vector3* vertices, unsigned count);
-
- /// Construct from a bounding box.
- Sphere(const BoundingBox& box);
-
- /// Construct from a frustum.
- Sphere(const Frustum& frustum);
-
- /// Construct from a polyhedron.
- Sphere(const Polyhedron& poly);
-
- /// Test for equality with another sphere.
- bool operator == (const Sphere& rhs) const;
-
- /// Define from another sphere.
- void Define(const Sphere& sphere);
-
- /// Define from center and radius.
- void Define(const Vector3& center, float radius);
-
- /// Define from an array of vertices.
- void Define(const Vector3* vertices, unsigned count);
-
- /// Define from a bounding box.
- void Define(const BoundingBox& box);
-
- /// Define from a frustum.
- void Define(const Frustum& frustum);
-
- /// Define from a polyhedron.
- void Define(const Polyhedron& poly);
-
- /// Merge a point.
- void Merge(const Vector3& point);
-
- /// Merge an array of vertices.
- void Merge(const Vector3* vertices, unsigned count);
-
- /// Merge a bounding box.
- void Merge(const BoundingBox& box);
-
- /// Merge a frustum.
- void Merge(const Frustum& frustum);
-
- /// Merge a polyhedron.
- void Merge(const Polyhedron& poly);
-
- /// Merge a sphere.
- void Merge(const Sphere& sphere);
-
- /// Clear to undefined state.
- void Clear();
-
- /// Test if a point is inside.
- Intersection IsInside(const Vector3& point) const;
-
- /// Test if another sphere is inside, outside or intersects.
- Intersection IsInside(const Sphere& sphere) const;
-
- /// Test if another sphere is (partially) inside or outside.
- Intersection IsInsideFast(const Sphere& sphere) const;
-
- /// Test if a bounding box is inside, outside or intersects.
- Intersection IsInside(const BoundingBox& box) const;
-
- /// Test if a bounding box is (partially) inside or outside.
- Intersection IsInsideFast(const BoundingBox& box) const;
-
- /// Return distance of a point to the surface, or 0 if inside.
- float Distance(const Vector3& point) const;
-
- /// Sphere center.
- Vector3 center_ @ center;
-
- /// Sphere radius.
- float radius_ @ radius;
- };
|