1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
|
public:
/// Default Constructor. The position and direction are left
/// un-initialized, but the time is set to 0 and infinity respectively.
Ray() : minT(0.001f), maxT(INF) { }
Ray(const Point3D& o, const Vector3D& d, float mint=0.001f, float maxt=INF)
: orig(o), minT(mint), maxT(maxt)
{
//the following calculates the direction, inverse direction
//and flag for the inverse direction
setDirection(d);
}
/// Constructor initializing the ray's origin and direction,
/// and optionally the time parameters. The direction is normalized.
Ray(const Point3D& o, const Vector3D& d, const Differential& dp = Differential(), const Differential& dd = Differential(), float mint=0.001f, float maxt=INF)
: orig(o), dp(dp), dd(dd), minT(mint), maxT(maxt)
{
setDirection(d);
}
|