erebus
view liberebus/src/object.h @ 34:d15ee526daa6
- changed the UI font, made it a bit smaller
- fixed the text positioning in the status bar
- added ThreadPool::clear to remove all pending jobs
- fixed the TargetCamera matrix calculation to avoid singularities when the
camera looks straight up or down.
- fixed ommited normalization in TargetCamera's matrix calculation
- added paths/sec display in the status bar
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Sun, 08 Jun 2014 08:12:05 +0300 |
parents | 93894c232d65 |
children | bab25c0ce337 |
line source
1 #ifndef OBJECT_H_
2 #define OBJECT_H_
4 #include <string>
5 #include "vmath/ray.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 Vector3 calc_normal() const;
21 Vector3 calc_tangent() const;
22 Vector2 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_