rayzor

view 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 source
1 #ifndef OBJECT_H_
2 #define OBJECT_H_
4 #include "vmath.h"
5 #include "snode.h"
6 #include "material.h"
8 class Object : public SceneNode {
9 public:
10 Material mtl;
12 Object();
13 virtual ~Object();
15 virtual Vector3 hit_normal(const RayHit &hit) const;
16 };
18 class Sphere : public Object {
19 public:
20 Sphere();
21 ~Sphere();
23 void draw(bool emph = false) const;
25 bool intersect(const Ray &ray, RayHit *hit = 0) const;
26 Vector3 hit_normal(const RayHit &hit) const;
27 };
29 class Box : public Object {
30 public:
31 Box();
32 ~Box();
34 void draw(bool emph = false) const;
36 bool intersect(const Ray &ray, RayHit *hit = 0) const;
37 Vector3 hit_normal(const RayHit &hit) const;
38 };
40 #endif // OBJECT_H_