erebus
annotate liberebus/src/object.h @ 10:506e114b7ca2
foo
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Sat, 24 May 2014 17:43:46 +0300 |
parents | a932848de652 |
children | e9da2916bc79 |
rev | line source |
---|---|
nuclear@2 | 1 #ifndef OBJECT_H_ |
nuclear@2 | 2 #define OBJECT_H_ |
nuclear@2 | 3 |
nuclear@2 | 4 #include <string> |
nuclear@2 | 5 #include "vmath/ray.h" |
nuclear@2 | 6 |
nuclear@2 | 7 class Object; |
nuclear@2 | 8 |
nuclear@2 | 9 struct RayHit { |
nuclear@2 | 10 float dist; |
nuclear@4 | 11 Ray world_ray, local_ray; |
nuclear@2 | 12 |
nuclear@2 | 13 const Object *obj, *subobj; |
nuclear@2 | 14 }; |
nuclear@2 | 15 |
nuclear@2 | 16 enum class ObjType { null, geom, camera }; |
nuclear@2 | 17 |
nuclear@2 | 18 class Object { |
nuclear@2 | 19 private: |
nuclear@2 | 20 std::string name; |
nuclear@2 | 21 |
nuclear@2 | 22 public: |
nuclear@2 | 23 Object(); |
nuclear@2 | 24 virtual ~Object() = default; |
nuclear@2 | 25 |
nuclear@2 | 26 virtual ObjType get_type() const; |
nuclear@2 | 27 |
nuclear@2 | 28 virtual void set_name(const char *name); |
nuclear@2 | 29 virtual const char *get_name() const; |
nuclear@2 | 30 |
nuclear@2 | 31 virtual bool intersect(const Ray &ray, RayHit *hit = 0) const; |
nuclear@2 | 32 }; |
nuclear@2 | 33 |
nuclear@2 | 34 #endif // OBJECT_H_ |