nuclear@2: #ifndef OBJECT_H_ nuclear@2: #define OBJECT_H_ nuclear@2: nuclear@2: #include nuclear@2: #include "vmath/ray.h" nuclear@2: nuclear@2: class Object; nuclear@2: nuclear@2: struct RayHit { nuclear@2: float dist; nuclear@4: Ray world_ray, local_ray; nuclear@2: nuclear@2: const Object *obj, *subobj; nuclear@2: }; nuclear@2: nuclear@2: enum class ObjType { null, geom, camera }; nuclear@2: nuclear@2: class Object { nuclear@2: private: nuclear@2: std::string name; nuclear@2: nuclear@2: public: nuclear@2: Object(); nuclear@2: virtual ~Object() = default; nuclear@2: nuclear@2: virtual ObjType get_type() const; nuclear@2: nuclear@2: virtual void set_name(const char *name); nuclear@2: virtual const char *get_name() const; nuclear@2: nuclear@2: virtual bool intersect(const Ray &ray, RayHit *hit = 0) const; nuclear@2: }; nuclear@2: nuclear@2: #endif // OBJECT_H_