/* Vertex.h * * Interface definition for the Vertex class, which stores vertex data and can * detect path intersection (collision). */ #ifndef VERTEX_H_INCLUDED #define VERTEX_H_INCLUDED 1 #include "Obstruction.h" class Vertex : public Obstruction { private: // Member Variables Tuple v1_; Tuple color_; // Color in r, g, b format Tuple litNormal_; // Used for lighting Tuple sumNormal_; // Used for lighting int triCount_; // Used for lighting public: // Constructors/Destructor Vertex(const Tuple& v1, const Tuple& color = Tuple()); virtual ~Vertex(); // Member Functions void addNormal( // Update the vertex's litNormal_ const Tuple& normal); virtual void draw( // Does nothing bool light) const; virtual const double pathIntersect( // Check if path hits vertex const Path& path, double radius) const; virtual const Tuple calcNormal( // Find normal relative to some pos const Tuple& point) const; // Accessor functions const Tuple v() {return v1_;} const Tuple color() {return color_;} const double r() {return color_.x();} const double g() {return color_.y();} const double b() {return color_.z();} const Tuple litNormal() {return litNormal_;} }; #endif // VERTEX_H_INCLUDED