/* * File: Geometry.h * Author: daniel * * Created on August 13, 2010, 5:36 PM */ #ifndef _GEOMETRY_H #define _GEOMETRY_H #include "Ray.h" #include "Common.h" //---------------------------Geometry---------------------- //This is the interface for the geometric part of the bodies //in the scene. It's main job is to determine if it intersects //a given ray and to return the normal of the intersection point. //--------------------------------------------------------- class Geometry{ public: Geometry() : position(Vector3d::Zero()) {}; Geometry(Vector3d _position) : position(_position) {}; ~Geometry(){}; void setPosition(Vector3d position){this->position = position;} Vector3d getPosition() const {return position;} //this checks if the ray intersects the geometry and sets the intersection //point and the normal at that point. It returns 0 if there was no intersection, //1 if the ray intersects from outside and -1 if it intersects from inside virtual int intersectRay(Ray& ray, Vector3d& interPoint, Vector3d& interNormal) = 0; protected: Vector3d position; }; #endif /* _GEOMETRY_H */