C++ / OpenCL Raytracer
object.h
1 #ifndef OBJECT_H
2 #define OBJECT_H
3 
4 #include "ray.h"
5 #define CL_TARGET_OPENCL_VERSION 220
6 #pragma warning(disable : 4996)
7 #pragma warning(disable : 4244)
8 #include "CL/cl.h"
9 #include "CL/cl_platform.h"
10 
11 class Material;
12 
19 struct HitRecord {
20  double m_dT;
24 };
25 
27 class Object {
28 public:
35  virtual bool Hit(const Ray &r, HitRecord &rec, double tMin, double tMax) const = 0;
42  virtual int clType() const = 0;
49  virtual Vector3D clCenter() const = 0;
56  virtual double clRadius() const = 0;
63  virtual Vector3D clBound1() const = 0;
70  virtual Vector3D clBound2() const = 0;
77  virtual cl_double8 CurMat() const = 0;
78 };
79 
80 typedef std::vector<Object*> vList;
81 #endif // OBJECT_H
double m_dT
Position along ray where intersection takes place.
Definition: object.h:20
virtual cl_double8 CurMat() const =0
Material * m_pmCurMat
Pointer to Material that the specified pixel should render.
Definition: object.h:23
virtual int clType() const =0
Definition: object.h:19
Definition: material.h:9
Definition: vector.h:16
virtual Vector3D clCenter() const =0
virtual Vector3D clBound1() const =0
Vector3D m_vP
Vector3D location of intersection.
Definition: object.h:21
virtual double clRadius() const =0
Definition: object.h:27
Vector3D m_vNormal
Vector3D normal to point of intersection.
Definition: object.h:22
virtual bool Hit(const Ray &r, HitRecord &rec, double tMin, double tMax) const =0
Definition: ray.h:7
virtual Vector3D clBound2() const =0