rayzor

diff src/object.h @ 17:79609d482762

the renderer renders, also fixed an unnoticed matrix conversion problem between scenegraph and min3d
author John Tsiombikas <nuclear@member.fsf.org>
date Mon, 14 Apr 2014 07:34:45 +0300
parents a9a948809c6f
children
line diff
     1.1 --- a/src/object.h	Sun Apr 13 09:54:51 2014 +0300
     1.2 +++ b/src/object.h	Mon Apr 14 07:34:45 2014 +0300
     1.3 @@ -3,11 +3,16 @@
     1.4  
     1.5  #include "vmath.h"
     1.6  #include "snode.h"
     1.7 +#include "material.h"
     1.8  
     1.9  class Object : public SceneNode {
    1.10  public:
    1.11 +	Material mtl;
    1.12 +
    1.13  	Object();
    1.14  	virtual ~Object();
    1.15 +
    1.16 +	virtual Vector3 hit_normal(const RayHit &hit) const;
    1.17  };
    1.18  
    1.19  class Sphere : public Object {
    1.20 @@ -17,7 +22,8 @@
    1.21  
    1.22  	void draw(bool emph = false) const;
    1.23  
    1.24 -	bool intersect(const Ray &ray, float *dist = 0) const;
    1.25 +	bool intersect(const Ray &ray, RayHit *hit = 0) const;
    1.26 +	Vector3 hit_normal(const RayHit &hit) const;
    1.27  };
    1.28  
    1.29  class Box : public Object {
    1.30 @@ -27,7 +33,8 @@
    1.31  
    1.32  	void draw(bool emph = false) const;
    1.33  
    1.34 -	bool intersect(const Ray &ray, float *dist = 0) const;
    1.35 +	bool intersect(const Ray &ray, RayHit *hit = 0) const;
    1.36 +	Vector3 hit_normal(const RayHit &hit) const;
    1.37  };
    1.38  
    1.39  #endif	// OBJECT_H_