//------------------------------------------------------------------------------
// Lamp : Open source game middleware
// Copyright (C) 2004  Junpei Ohtani ( Email : junpee@users.sourceforge.jp )
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
//------------------------------------------------------------------------------

/** @file
 * 球距離ヘッダ
 * @author Junpee
 */

#ifndef SPHERE_DISTANCE_H_
#define SPHERE_DISTANCE_H_

namespace Lamp{

class Sphere;
class Triangle;

//------------------------------------------------------------------------------
/**
 * 球距離
 */
class SphereDistance{
public:
	//--------------------------------------------------------------------------
	// 点
	//--------------------------------------------------------------------------
	/**
	 * 点距離の二乗
	 * @param sphere 球
	 * @param point 点
	 * @return 距離の二乗
	 */
	static float squaredDistance(const Sphere& sphere, const Vector3& point);

	//--------------------------------------------------------------------------
	// 球
	//--------------------------------------------------------------------------
	/**
	 * 球距離の二乗
	 * @param sphere0 球
	 * @param sphere1 球
	 * @return 距離の二乗
	 */
	static float squaredDistance(const Sphere& sphere0, const Sphere& sphere1);

	//--------------------------------------------------------------------------
	// 三角
	//--------------------------------------------------------------------------
	/**
	 * 三角距離の二乗
	 * @param sphere 球
	 * @param triangle 三角
	 * @return 距離の二乗
	 */
	static float squaredDistance(
		const Sphere& sphere, const Triangle& triangle);

private:
	//--------------------------------------------------------------------------
	// コンストラクタの隠蔽
	SphereDistance();

};

//------------------------------------------------------------------------------
} // End of namespace Lamp
#endif // End of SPHERE_DISTANCE_H_
//------------------------------------------------------------------------------
