//=======================================================================// // File: line.hpp // // Project: Architecture // // Author: J.M. Albertson // //-----------------------------------------------------------------------// // Copyright (C) 1994-1995, Virtual World Entertainments, // // PROPRIETARY AND CONFIDENTIAL // //=======================================================================// #if !defined(LINE_HPP) # define LINE_HPP # if !defined(RAY_HPP) # include # endif //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Line3D ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ class Line: public Ray { public: Scalar length; Line() {} Line( const Ray &ray, Scalar length ): Ray(ray), length(length) {} Line( const Point3D &start, const UnitVector &direction, Scalar length ): Ray(start,direction), length(length) {} void FindEnd(Point3D *result) {Check(this); Check_Pointer(result); Ray::Project(length, result);} // // Assignment operators // Line& operator=(const Vector3D &vector); Line& operator=(const Point3D &point); // // Ray intersection functions // Scalar DistanceTo( const Plane &plane, Scalar *product ) const; Scalar DistanceTo( const Sphere &sphere, Scalar *penetration ) const; }; #endif