charles/src/object.h

42 lines
723 B
C
Raw Normal View History

2013-09-07 16:09:19 -07:00
/* object.h
*
2013-09-10 09:18:05 -07:00
* Declaration of abstract, top-level scene objects. The Object class is the top of this hierarchy. All other scene
* objects are based on it. The Shape class defines a visible shape in the scene.
2013-09-07 16:09:19 -07:00
*
* Eryn Wells <eryn@erynwells.me>
*/
2013-09-10 09:18:05 -07:00
#ifndef __OBJECT_H__
#define __OBJECT_H__
2013-09-07 16:09:19 -07:00
2013-09-07 16:48:50 -07:00
#include "basics.h"
2013-09-07 22:22:27 -07:00
#include "texture.h"
2013-09-07 16:48:50 -07:00
2013-09-10 09:18:05 -07:00
class Object
{
public:
Object();
Object(Vector3 o);
2013-09-07 16:48:50 -07:00
Vector3 get_origin() const;
2013-09-10 09:18:05 -07:00
void set_origin(Vector3 v);
2013-09-07 16:48:50 -07:00
2013-09-10 09:18:05 -07:00
private:
Vector3 origin;
};
2013-09-07 18:26:32 -07:00
2013-09-07 16:48:50 -07:00
2013-09-10 09:18:05 -07:00
class Shape
: public Object
{
public:
Shape();
Shape(Vector3 o);
2013-09-10 21:04:56 -07:00
virtual int does_intersect(const Ray &ray, float **t) const = 0;
virtual Vector3 compute_normal(const Vector3 &p) const = 0;
2013-09-10 09:18:05 -07:00
};
2013-09-07 16:48:50 -07:00
2013-09-07 16:09:19 -07:00
#endif