Define constructors for Object and Shape; move a bunch of Sphere code to object_sphere
This commit is contained in:
parent
f062efc349
commit
e5601e7f43
2 changed files with 38 additions and 69 deletions
|
@ -17,8 +17,9 @@ class Object
|
|||
{
|
||||
public:
|
||||
Object();
|
||||
Object(Vector3 o);
|
||||
|
||||
Vector3 get_origin();
|
||||
Vector3 get_origin() const;
|
||||
void set_origin(Vector3 v);
|
||||
|
||||
private:
|
||||
|
@ -30,6 +31,9 @@ class Shape
|
|||
: public Object
|
||||
{
|
||||
public:
|
||||
Shape();
|
||||
Shape(Vector3 o);
|
||||
|
||||
virtual int does_intersect(const Ray &ray, float **t) = 0;
|
||||
virtual Vector3 compute_normal(const Vector3 &p) = 0;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue