07072b370f
- aggiornamenti vari.
50 lines
1.5 KiB
C++
50 lines
1.5 KiB
C++
//----------------------------------------------------------------------------
|
|
// EgalTech 2014-2015
|
|
//----------------------------------------------------------------------------
|
|
// File : EGkPlane3d.h Data : 25.02.15 Versione : 1.6b7
|
|
// Contenuto : Dichiarazione classe piano Plane3d.
|
|
//
|
|
//
|
|
//
|
|
// Modifiche : 08.04.14 DS Creazione modulo.
|
|
// 25.02.15 DS Agg. PointInPlane*.
|
|
//
|
|
//----------------------------------------------------------------------------
|
|
|
|
#pragma once
|
|
|
|
#include "/EgtDev/Include/EGkPoint3d.h"
|
|
|
|
//-----------------------------------------------------------------------------
|
|
class Plane3d
|
|
{
|
|
public :
|
|
Vector3d vtN ;
|
|
double dDist ;
|
|
} ;
|
|
|
|
//-----------------------------------------------------------------------------
|
|
inline bool
|
|
SetPlane( const Point3d& ptP, const Vector3d& vtN, Plane3d& plPlane)
|
|
{
|
|
if ( vtN.IsSmall())
|
|
return false ;
|
|
plPlane.vtN = vtN ;
|
|
plPlane.dDist = ( ptP - ORIG) * plPlane.vtN ;
|
|
return true ;
|
|
}
|
|
|
|
//-----------------------------------------------------------------------------
|
|
inline bool
|
|
PointInPlaneApprox( const Point3d& ptP, const Plane3d& plPlane)
|
|
{
|
|
return ( fabs( (( ptP - ORIG) * plPlane.vtN) - plPlane.dDist) < EPS_SMALL) ;
|
|
}
|
|
|
|
//-----------------------------------------------------------------------------
|
|
inline bool
|
|
PointInPlaneExact( const Point3d& ptP, const Plane3d& plPlane)
|
|
{
|
|
return ( fabs( (( ptP - ORIG) * plPlane.vtN) - plPlane.dDist) < EPS_ZERO) ;
|
|
}
|