YafaRay Core  v3.2.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Public Member Functions | Protected Attributes | List of all members
sphere_t Class Reference

#include <std_primitives.h>

Inheritance diagram for sphere_t:
Inheritance graph
[legend]
Collaboration diagram for sphere_t:
Collaboration graph
[legend]

Public Member Functions

 sphere_t (point3d_t centr, float rad, const material_t *m)
 
virtual bound_t getBound () const
 
virtual bool intersectsBound (exBound_t &b) const
 
virtual bool intersect (const ray_t &ray, float *t, intersectData_t &data) const
 
virtual void getSurface (surfacePoint_t &sp, const point3d_t &hit, intersectData_t &data) const
 
virtual const material_tgetMaterial () const
 
virtual const triangleObject_tgetMesh () const
 
- Public Member Functions inherited from primitive_t
virtual bool clippingSupport () const
 
virtual bool clipToBound (double bound[2][3], int axis, bound_t &clipped, void *d_old, void *d_new) const
 
virtual ~primitive_t ()
 

Protected Attributes

point3d_t center
 
float radius
 
const material_tmaterial
 

Detailed Description

Definition at line 13 of file std_primitives.h.

Constructor & Destructor Documentation

sphere_t::sphere_t ( point3d_t  centr,
float  rad,
const material_t m 
)
inline

Definition at line 16 of file std_primitives.h.

Member Function Documentation

__BEGIN_YAFRAY bound_t sphere_t::getBound ( ) const
virtual

return the object bound in global ("world") coordinates

Implements primitive_t.

Definition at line 27 of file std_primitives.cc.

virtual const material_t* sphere_t::getMaterial ( ) const
inlinevirtual

Implements primitive_t.

Definition at line 23 of file std_primitives.h.

virtual const triangleObject_t* sphere_t::getMesh ( ) const
inlinevirtual

Definition at line 24 of file std_primitives.h.

void sphere_t::getSurface ( surfacePoint_t sp,
const point3d_t hit,
intersectData_t data 
) const
virtual

Implements primitive_t.

Definition at line 55 of file std_primitives.cc.

bool sphere_t::intersect ( const ray_t ray,
float *  t,
intersectData_t data 
) const
virtual

basic ray primitive interection for raytracing. This should NOT skip intersections outside of [tmin,tmax], unless negative. The caller decides wether t matters or not.

Returns
false if ray misses primitive, true otherwise
Parameters
tset this to raydepth where hit occurs

Implements primitive_t.

Definition at line 33 of file std_primitives.cc.

virtual bool sphere_t::intersectsBound ( exBound_t b) const
inlinevirtual

a possibly more precise check to find out if the primitve really intersects the bound of interest, given that the primitive's bound does. used e.g. for optimized kd-tree construction

Reimplemented from primitive_t.

Definition at line 18 of file std_primitives.h.

Member Data Documentation

point3d_t sphere_t::center
protected

Definition at line 26 of file std_primitives.h.

const material_t* sphere_t::material
protected

Definition at line 28 of file std_primitives.h.

float sphere_t::radius
protected

Definition at line 27 of file std_primitives.h.


The documentation for this class was generated from the following files: