erebus
view liberebus/src/object.h @ 48:9971a08f4104
merged
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Wed, 24 Feb 2016 00:29:31 +0200 |
parents | bab25c0ce337 |
children |
line source
1 #ifndef OBJECT_H_
2 #define OBJECT_H_
4 #include <string>
5 #include <gmath/gmath.h>
7 class Object;
8 class SceneNode;
10 class RayHit {
11 public:
12 float dist;
13 Ray world_ray, local_ray;
15 const SceneNode *node;
16 const Object *obj, *subobj;
18 RayHit();
20 Vec3 calc_normal() const;
21 Vec3 calc_tangent() const;
22 Vec2 calc_texcoords() const;
23 };
25 enum class ObjType { null, geom, camera };
27 class Object {
28 private:
29 std::string name;
31 public:
32 Object();
33 virtual ~Object() = default;
35 virtual ObjType get_type() const;
37 virtual void set_name(const char *name);
38 virtual const char *get_name() const;
40 virtual bool intersect(const Ray &ray, RayHit *hit = 0) const;
41 };
43 #endif // OBJECT_H_