charles/src/objectBox.hh
Eryn Wells 79c951030d Move Stats to its own module
Move Stats to its own module and pass it around to the intersection methods to keep track of how many tests and successful intersections there are.
2014-08-02 15:21:14 -07:00

36 lines
712 B
C++

/* objectBox.hh
* vim: set tw=80:
* Eryn Wells <eryn@erynwells.me>
*/
#include "basics.h"
#include "object.h"
#include "types.hh"
namespace charles {
struct Box
: public Object
{
Box();
Box(const Vector3& near, const Vector3& far);
Vector3& GetNear();
void SetNear(const Vector3& near);
Vector3& GetFar();
void SetFar(const Vector3& far);
bool DoesIntersect(const Ray& ray, TVector& t, Stats& stats) const;
bool point_is_on_surface(const Vector3 &p) const;
Vector3 compute_normal(const Vector3 &p) const;
private:
/** The near, lower left corner. */
Vector3 mNear;
/** The far, upper right corner. */
Vector3 mFar;
};
} /* namespace charles */