rayzor

diff src/object.h @ 12:d94a69933a71

lots of stuff, can't remember
author John Tsiombikas <nuclear@member.fsf.org>
date Sat, 12 Apr 2014 23:28:24 +0300
parents a68dbf80d547
children 964f8ea5f095
line diff
     1.1 --- a/src/object.h	Thu Apr 10 08:42:33 2014 +0300
     1.2 +++ b/src/object.h	Sat Apr 12 23:28:24 2014 +0300
     1.3 @@ -1,12 +1,17 @@
     1.4  #ifndef OBJECT_H_
     1.5  #define OBJECT_H_
     1.6  
     1.7 -class Object {
     1.8 +#include "vmath.h"
     1.9 +#include "xfnode.h"
    1.10 +
    1.11 +class Object : public SceneNode {
    1.12 +protected:
    1.13 +	void pre_draw() const;
    1.14 +	void post_draw() const;
    1.15 +
    1.16  public:
    1.17  	Object();
    1.18  	virtual ~Object();
    1.19 -
    1.20 -	virtual void draw() const = 0;
    1.21  };
    1.22  
    1.23  class Sphere : public Object {
    1.24 @@ -15,6 +20,18 @@
    1.25  	~Sphere();
    1.26  
    1.27  	void draw() const;
    1.28 +
    1.29 +	bool intersect(const Ray &ray, float *dist = 0) const;
    1.30 +};
    1.31 +
    1.32 +class Box : public Object {
    1.33 +public:
    1.34 +	Box();
    1.35 +	~Box();
    1.36 +
    1.37 +	void draw() const;
    1.38 +
    1.39 +	bool intersect(const Ray &ray, float *dist = 0) const;
    1.40  };
    1.41  
    1.42  #endif	// OBJECT_H_