erebus
diff liberebus/src/object.h @ 2:474a0244f57d
fixed specialization mistake
fixed line endings
added makefiles
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Mon, 28 Apr 2014 06:31:10 +0300 |
parents | 4abdce1361b9 |
children | a932848de652 |
line diff
1.1 --- a/liberebus/src/object.h Mon Apr 28 05:58:22 2014 +0300 1.2 +++ b/liberebus/src/object.h Mon Apr 28 06:31:10 2014 +0300 1.3 @@ -1,44 +1,44 @@ 1.4 -#ifndef OBJECT_H_ 1.5 -#define OBJECT_H_ 1.6 - 1.7 -#include <string> 1.8 -#include "vmath/ray.h" 1.9 - 1.10 -class Object; 1.11 - 1.12 -struct RayHit { 1.13 - float dist; 1.14 - const Ray world_ray, local_ray; 1.15 - 1.16 - const Object *obj, *subobj; 1.17 -}; 1.18 - 1.19 -enum class ObjType { null, geom, camera }; 1.20 - 1.21 -class Object { 1.22 -private: 1.23 - std::string name; 1.24 - Matrix4x4 xform; 1.25 - mutable Matrix4x4 inv_xform; 1.26 - mutable bool inv_xform_valid; 1.27 - 1.28 -public: 1.29 - Object(); 1.30 - virtual ~Object() = default; 1.31 - 1.32 - virtual ObjType get_type() const; 1.33 - 1.34 - virtual void set_name(const char *name); 1.35 - virtual const char *get_name() const; 1.36 - 1.37 - virtual void set_xform(const Matrix4x4 &mat); 1.38 - virtual void set_xform(const Matrix4x4 &mat, const Matrix4x4 &inv_mat); 1.39 - 1.40 - virtual Matrix4x4 &get_xform(); // invalidates inv_xform 1.41 - virtual const Matrix4x4 &get_xform() const; 1.42 - virtual const Matrix4x4 &get_inv_xform() const; 1.43 - 1.44 - virtual bool intersect(const Ray &ray, RayHit *hit = 0) const; 1.45 -}; 1.46 - 1.47 -#endif // OBJECT_H_ 1.48 \ No newline at end of file 1.49 +#ifndef OBJECT_H_ 1.50 +#define OBJECT_H_ 1.51 + 1.52 +#include <string> 1.53 +#include "vmath/ray.h" 1.54 + 1.55 +class Object; 1.56 + 1.57 +struct RayHit { 1.58 + float dist; 1.59 + const Ray world_ray, local_ray; 1.60 + 1.61 + const Object *obj, *subobj; 1.62 +}; 1.63 + 1.64 +enum class ObjType { null, geom, camera }; 1.65 + 1.66 +class Object { 1.67 +private: 1.68 + std::string name; 1.69 + Matrix4x4 xform; 1.70 + mutable Matrix4x4 inv_xform; 1.71 + mutable bool inv_xform_valid; 1.72 + 1.73 +public: 1.74 + Object(); 1.75 + virtual ~Object() = default; 1.76 + 1.77 + virtual ObjType get_type() const; 1.78 + 1.79 + virtual void set_name(const char *name); 1.80 + virtual const char *get_name() const; 1.81 + 1.82 + virtual void set_xform(const Matrix4x4 &mat); 1.83 + virtual void set_xform(const Matrix4x4 &mat, const Matrix4x4 &inv_mat); 1.84 + 1.85 + virtual Matrix4x4 &get_xform(); // invalidates inv_xform 1.86 + virtual const Matrix4x4 &get_xform() const; 1.87 + virtual const Matrix4x4 &get_inv_xform() const; 1.88 + 1.89 + virtual bool intersect(const Ray &ray, RayHit *hit = 0) const; 1.90 +}; 1.91 + 1.92 +#endif // OBJECT_H_