//------------------------------------------------------------------------------
// 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 TRIANGLE_INTERSECTION_H_
#define TRIANGLE_INTERSECTION_H_

namespace Lamp{

class Triangle;

//------------------------------------------------------------------------------
/**
 * 三角交差
 */
class TriangleIntersection{
public:
	//--------------------------------------------------------------------------
	// 点
	//--------------------------------------------------------------------------
	/**
	 * 点交差
	 * @param triangle 三角
	 * @param point 点
	 * @param range 交差範囲
	 * @return 交差していればtrue
	 */
	static bool intersect(const Triangle& triangle, const Vector3& point,
		float range = Math::epsilon);

	//--------------------------------------------------------------------------
	// 三角
	//--------------------------------------------------------------------------
	/**
	 * 三角交差
	 * @param triangle0 三角
	 * @param triangle1 三角
	 * @return 交差していればtrue
	 */
	static bool intersect(const Triangle& triangle0, const Triangle& triangle1);

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

};

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