//=======================================================================//
// File:		sphere.hpp                                                   //
// Project: Architecture                                                 //
// Author:	J.M. Albertson                                               //
//-----------------------------------------------------------------------//
// Copyright (C) 1994-1995, Virtual World Entertainments,                //
// PROPRIETARY AND CONFIDENTIAL                                          //
//=======================================================================//

#if !defined(SPHERE_HPP)
#	define SPHERE_HPP

#	if !defined(POINT3D_HPP)
#		include <point3d.hpp>
#	endif

	class Plane;

	//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Sphere ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

	class Sphere SIGNATURED
	{
	 public:
		Point3D
			center;
		Scalar
			radius;

		Sphere()
			{}
		Sphere(
			const Point3D &A_Point,
			Scalar Radius
		):
			center(A_Point),
			radius(Radius)
				{}
		Sphere(
			Scalar X,
			Scalar Y,
			Scalar Z,
			Scalar Radius
		):
			center(X,Y,Z),
			radius(Radius)
				{}

		//
		// Intersection functions
		//
		Logical
			Contains(const Point3D &point) const;
		Logical
			Intersects(const Sphere &sphere) const;
		Logical
			Intersects(const Plane &plane) const;

		friend ostream&
			operator<<(ostream& Stream, const Sphere &A_Sphere);
	};

#endif
