Ejemplo n.º 1
0
//**********************************************************************
//
// * Find the intersection of this plane and a line defined by a direction
//   and a point on the line.  Return true if the line intersects the plane and
//   return the point of intersection through the reference parameter, 
//   otherwise return false.
//
//======================================================================
bool SJCPlane::
Intersect(const SJCVector3f& point, const SJCVector3f& direction, 
	  SJCVector3f& intersection) const
//======================================================================i
{
  if (IsParallel(direction))
    return false;
  else  {
   
    intersection = point + direction * -( (m_normal * point) + 
                   m_distance) / (m_normal * direction);
    return true;
  }// else 
}// Intersect
Ejemplo n.º 2
0
bool
PlaneGeometry::IsOnPlane( const PlaneGeometry *plane ) const
{
  return ( IsParallel( plane ) && (Distance( plane->GetOrigin() ) < eps) );
}
Ejemplo n.º 3
0
bool Plane::Equals(const Plane &other, float epsilon) const
{
    return IsParallel(other, epsilon) && EqualAbs(d, other.d, epsilon);
}