X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Fyoink;a=blobdiff_plain;f=src%2FMoof%2FRay.hh;fp=src%2FMoof%2FRay.hh;h=0000000000000000000000000000000000000000;hp=6d4705a81d4f24998597c17617e95f309caeb231;hb=831f04d4bc19a390415ac0bbac4331c7a65509bc;hpb=299af4f2047e767e5d79501c26444473bda64c64 diff --git a/src/Moof/Ray.hh b/src/Moof/Ray.hh deleted file mode 100644 index 6d4705a..0000000 --- a/src/Moof/Ray.hh +++ /dev/null @@ -1,79 +0,0 @@ - -/*] Copyright (c) 2009-2010, Charles McGarvey [************************** -**] All rights reserved. -* -* vi:ts=4 sw=4 tw=75 -* -* Distributable under the terms and conditions of the 2-clause BSD license; -* see the file COPYING for a complete text of the license. -* -**************************************************************************/ - -#ifndef _MOOF_RAY_HH_ -#define _MOOF_RAY_HH_ - -#include -#include -#include -#include - - -namespace Mf { - - -/** - * A line that goes to infinity. - */ - -template -struct Ray : public Drawable -{ - typedef cml::vector< Scalar, cml::fixed > Vector; - - // solution = point + t*direction - Vector point; - Vector direction; - - struct Contact - { - Scalar distance; // distance from the origin to the nearest point - Vector normal; // surface normal at contact point - - bool operator < (const Contact& rhs) - { - return distance < rhs.distance; - } - }; - - void solve(Vector& p, Scalar t) const - { - p = point + t*direction; - } - - void draw(Scalar alpha = 0.0) const - { - Vector end = point + 1000.0 * direction; - // FIXME this is kinda cheesy - - Mf::Texture::resetBind(); - glBegin(GL_LINES); - glVertex(point); - glVertex(end); - glEnd(); - } - - void normalize() - { - direction.normalize(); - } -}; - - -typedef Ray<2> Ray2; -typedef Ray<3> Ray3; - - -} // namespace Mf - -#endif // _MOOF_RAY_HH_ -