first commit
This commit is contained in:
45
thirdparty/ode-0.16.5/OPCODE/Ice/IcePlane.cpp
vendored
Normal file
45
thirdparty/ode-0.16.5/OPCODE/Ice/IcePlane.cpp
vendored
Normal file
@@ -0,0 +1,45 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
* Contains code for planes.
|
||||
* \file IcePlane.cpp
|
||||
* \author Pierre Terdiman
|
||||
* \date April, 4, 2000
|
||||
*/
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
* Plane class.
|
||||
* \class Plane
|
||||
* \author Pierre Terdiman
|
||||
* \version 1.0
|
||||
*/
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Precompiled Header
|
||||
#include "Stdafx.h"
|
||||
|
||||
using namespace IceMaths;
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
* Computes the plane equation from 3 points.
|
||||
* \param p0 [in] first point
|
||||
* \param p1 [in] second point
|
||||
* \param p2 [in] third point
|
||||
* \return Self-reference
|
||||
*/
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
Plane& Plane::Set(const Point& p0, const Point& p1, const Point& p2)
|
||||
{
|
||||
Point Edge0 = p1 - p0;
|
||||
Point Edge1 = p2 - p0;
|
||||
|
||||
n = Edge0 ^ Edge1;
|
||||
n.Normalize();
|
||||
|
||||
d = -(p0 | n);
|
||||
|
||||
return *this;
|
||||
}
|
||||
Reference in New Issue
Block a user