sphere_t Class Reference

#include <std_primitives.h>

Inheritance diagram for sphere_t:
Inheritance graph
Collaboration diagram for sphere_t:
Collaboration graph

List of all members.

Public Member Functions

 sphere_t (point3d_t centr, PFLOAT rad, const material_t *m)
virtual bound_t getBound () const
virtual bool intersectsBound (exBound_t &b) const
virtual bool intersect (const ray_t &ray, PFLOAT *t, void *userdata) const
virtual void getSurface (surfacePoint_t &sp, const point3d_t &hit, void *userdata) const
virtual const material_tgetMaterial () const

Protected Attributes

point3d_t center
PFLOAT 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,
PFLOAT  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 [inline, virtual]

Implements primitive_t.

Definition at line 23 of file std_primitives.h.

void sphere_t::getSurface ( surfacePoint_t sp,
const point3d_t hit,
void *  userdata 
) const [virtual]

Implements primitive_t.

Definition at line 55 of file std_primitives.cc.

bool sphere_t::intersect ( const ray_t ray,
PFLOAT *  t,
void *  userdata 
) 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.

false if ray misses primitive, true otherwise
t set 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 [inline, virtual]

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

Definition at line 25 of file std_primitives.h.

const material_t* sphere_t::material [protected]

Definition at line 27 of file std_primitives.h.

PFLOAT sphere_t::radius [protected]

Definition at line 26 of file std_primitives.h.

The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on 18 Dec 2009 for YafaRay by  doxygen 1.6.1