erebus
diff liberebus/src/geomobj.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/geomobj.h Mon Apr 28 05:58:22 2014 +0300 1.2 +++ b/liberebus/src/geomobj.h Mon Apr 28 06:31:10 2014 +0300 1.3 @@ -1,50 +1,50 @@ 1.4 -#ifndef GEOMOBJ_H_ 1.5 -#define GEOMOBJ_H_ 1.6 - 1.7 -#include "object.h" 1.8 -#include "brdf.h" 1.9 - 1.10 -class GeomObject : public Object { 1.11 -public: 1.12 - Reflectance *brdf; 1.13 - 1.14 - ObjType get_type() const override; 1.15 - 1.16 - bool intersect(const Ray &ray, RayHit *hit = 0) const override; 1.17 -}; 1.18 - 1.19 -class Sphere : public GeomObject { 1.20 -public: 1.21 - bool intersect(const Ray &ray, RayHit *hit = 0) const override; 1.22 -}; 1.23 - 1.24 -class Box : public GeomObject { 1.25 -public: 1.26 - bool intersect(const Ray &ray, RayHit *hit = 0) const override; 1.27 -}; 1.28 - 1.29 -class Triangle : public GeomObject { 1.30 -public: 1.31 - Vector3 v[3]; 1.32 - Vector3 normal; 1.33 - Vector3 vnorm[3]; 1.34 - Vector2 vtex[3]; 1.35 - 1.36 - bool intersect(const Ray &ray, RayHit *hit = 0) const override; 1.37 -}; 1.38 - 1.39 -class Mesh : public GeomObject { 1.40 -private: 1.41 - std::vector<Triangle> faces; 1.42 - 1.43 -public: 1.44 - void begin(); 1.45 - void vertex(float x, float y, float z); 1.46 - void normal(float x, float y, float z); 1.47 - void texcoord(float u, float v); 1.48 - void end(); 1.49 - 1.50 - bool intersect(const Ray &ray, RayHit *hit = 0) const override; 1.51 -}; 1.52 - 1.53 -#endif // GEOMOBJ_H_ 1.54 \ No newline at end of file 1.55 +#ifndef GEOMOBJ_H_ 1.56 +#define GEOMOBJ_H_ 1.57 + 1.58 +#include "object.h" 1.59 +#include "brdf.h" 1.60 + 1.61 +class GeomObject : public Object { 1.62 +public: 1.63 + Reflectance *brdf; 1.64 + 1.65 + ObjType get_type() const override; 1.66 + 1.67 + bool intersect(const Ray &ray, RayHit *hit = 0) const override; 1.68 +}; 1.69 + 1.70 +class Sphere : public GeomObject { 1.71 +public: 1.72 + bool intersect(const Ray &ray, RayHit *hit = 0) const override; 1.73 +}; 1.74 + 1.75 +class Box : public GeomObject { 1.76 +public: 1.77 + bool intersect(const Ray &ray, RayHit *hit = 0) const override; 1.78 +}; 1.79 + 1.80 +class Triangle : public GeomObject { 1.81 +public: 1.82 + Vector3 v[3]; 1.83 + Vector3 normal; 1.84 + Vector3 vnorm[3]; 1.85 + Vector2 vtex[3]; 1.86 + 1.87 + bool intersect(const Ray &ray, RayHit *hit = 0) const override; 1.88 +}; 1.89 + 1.90 +class Mesh : public GeomObject { 1.91 +private: 1.92 + std::vector<Triangle> faces; 1.93 + 1.94 +public: 1.95 + void begin(); 1.96 + void vertex(float x, float y, float z); 1.97 + void normal(float x, float y, float z); 1.98 + void texcoord(float u, float v); 1.99 + void end(); 1.100 + 1.101 + bool intersect(const Ray &ray, RayHit *hit = 0) const override; 1.102 +}; 1.103 + 1.104 +#endif // GEOMOBJ_H_