Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/vector.cpp

    r7b36fe rfee69b  
    222222 * \param *Origin first vector of line
    223223 * \param *LineVector second vector of line
    224  * \return true -  \a this contains intersection point on return, false - line is parallel to plane (even if in-plane)
     224 * \return true -  \a this contains intersection point on return, false - line is parallel to plane
    225225 */
    226226bool Vector::GetIntersectionWithPlane(const Vector * const PlaneNormal, const Vector * const PlaneOffset, const Vector * const Origin, const Vector * const LineVector)
     
    235235  Direction.Normalize();
    236236  Log() << Verbose(1) << "INFO: Direction is " << Direction << "." << endl;
    237   //Log() << Verbose(1) << "INFO: PlaneNormal is " << *PlaneNormal << " and PlaneOffset is " << *PlaneOffset << "." << endl;
    238237  factor = Direction.ScalarProduct(PlaneNormal);
    239   if (fabs(factor) < MYEPSILON) { // Uniqueness: line parallel to plane?
    240     Log() << Verbose(1) << "BAD: Line is parallel to plane, no intersection." << endl;
     238  if (factor < MYEPSILON) { // Uniqueness: line parallel to plane?
     239    eLog() << Verbose(2) << "Line is parallel to plane, no intersection." << endl;
    241240    return false;
    242241  }
     
    244243  helper.SubtractVector(Origin);
    245244  factor = helper.ScalarProduct(PlaneNormal)/factor;
    246   if (fabs(factor) < MYEPSILON) { // Origin is in-plane
    247     Log() << Verbose(1) << "GOOD: Origin of line is in-plane." << endl;
     245  if (factor < MYEPSILON) { // Origin is in-plane
     246    Log() << Verbose(1) << "Origin of line is in-plane, simple." << endl;
    248247    CopyVector(Origin);
    249248    return true;
     
    259258  helper.SubtractVector(PlaneOffset);
    260259  if (helper.ScalarProduct(PlaneNormal) < MYEPSILON) {
    261     Log() << Verbose(1) << "GOOD: Intersection is " << *this << "." << endl;
     260    Log() << Verbose(1) << "INFO: Intersection at " << *this << " is good." << endl;
    262261    return true;
    263262  } else {
     
    354353  Vector parallel;
    355354  double factor = 0.;
     355  double pfactor = 0.;
    356356  if (fabs(a.ScalarProduct(&b)*a.ScalarProduct(&b)/a.NormSquared()/b.NormSquared() - 1.) < MYEPSILON) {
    357357    parallel.CopyVector(Line1a);
Note: See TracChangeset for help on using the changeset viewer.