YafaRay Core  v3.2.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
std_primitives.h
Go to the documentation of this file.
1 
2 #ifndef Y_STD_PRIMITIVE_H
3 #define Y_STD_PRIMITIVE_H
4 
5 #include <core_api/primitive.h>
6 
8 
10 class paraMap_t;
11 class object3d_t;
12 
14 {
15  public:
16  sphere_t(point3d_t centr, float rad, const material_t *m): center(centr), radius(rad), material(m) {}
17  virtual bound_t getBound() const;
18  virtual bool intersectsBound(exBound_t &b) const { return true; };
19  //virtual bool clippingSupport() const { return false; }
20  //virtual bool clipToBound(double bound[2][3], int axis, bound_t &clipped, void *d_old, void *d_new) const {return false;}
21  virtual bool intersect(const ray_t &ray, float *t, intersectData_t &data) const;
22  virtual void getSurface(surfacePoint_t &sp, const point3d_t &hit, intersectData_t &data) const;
23  virtual const material_t* getMaterial() const { return material; }
24  virtual const triangleObject_t* getMesh() const { return nullptr; }
25  protected:
27  float radius;
29 };
30 
32 
34 
35 #endif //Y_STD_PRIMITIVE_H
virtual const triangleObject_t * getMesh() const
virtual bool intersect(const ray_t &ray, float *t, intersectData_t &data) const =0
#define __BEGIN_YAFRAY
virtual void getSurface(surfacePoint_t &sp, const point3d_t &hit, intersectData_t &data) const =0
Definition: ray.h:11
point3d_t center
sphere_t(point3d_t centr, float rad, const material_t *m)
Definition: bound.h:50
object3d_t * sphere_factory(paraMap_t &params, renderEnvironment_t &env)
virtual const material_t * getMaterial() const
const material_t * material
virtual bool intersectsBound(exBound_t &b) const
#define YAFRAYCORE_EXPORT
float radius
virtual bound_t getBound() const =0
#define __END_YAFRAY