#include <solidmaterial.h>
Inheritance diagram for SolidMaterial:
Public Member Functions | |
virtual Magick::Color | get_color (const Point3D &intersection_point) const |
virtual double | get_diffuse (const Point3D &intersection_point) const |
virtual double | get_opacity (const Point3D &intersection_point) const |
virtual double | get_reflection (const Point3D &intersection_point) const |
virtual double | get_reflectivity (const Point3D &intersection_point) const |
virtual double | get_refraction_index (const Point3D &intersection_point) const |
virtual bool | is_light (const Point3D &intersection_point) const |
virtual void | set_diffuse (double diffuse) |
virtual void | set_is_light (bool v) |
virtual void | set_opacity (double opacity) |
SolidMaterial (const SolidMaterial &other) | |
Copy constructor. | |
SolidMaterial (Magick::Color m_color, bool is_light, double reflection, double diffuse, double reflectivity, double refraction, double opacity) | |
Fully construct a material with no defaults. | |
SolidMaterial (Magick::Color m_color, double reflect=1.0f, double diffuse=0.25f, bool is_light=false, double opacity=OPAQUE) | |
SolidMaterial (bool is_light) | |
virtual | ~SolidMaterial () |
Protected Member Functions | |
virtual void | normalize_opacity () |
Ensure m_opacity remains within the range of 0.0f to 1.0f. | |
Protected Attributes | |
Magick::Color | m_color |
This is the color of the material. | |
double | m_diffusion_factor |
bool | m_is_light_source |
Is this material a light source? | |
double | m_opacity |
double | m_reflection_coefficient |
double | m_reflectivity |
double | m_refraction_index |
This describes the amount of refraction occuring within the object. | |
Static Private Attributes | |
static SolidMaterialStaticInit | m_init |
Dummy variable to run static initialization. | |
Classes | |
class | SolidMaterialStaticInit |
Static initialization. Registers the material with the PluginFactory. More... |
Definition at line 15 of file solidmaterial.h.
SolidMaterial::SolidMaterial | ( | bool | is_light | ) | [inline] |
Definition at line 73 of file solidmaterial.h.
SolidMaterial::SolidMaterial | ( | Magick::Color | m_color, | |
double | reflect = 1.0f , |
|||
double | diffuse = 0.25f , |
|||
bool | is_light = false , |
|||
double | opacity = OPAQUE | |||
) | [inline] |
Definition at line 82 of file solidmaterial.h.
SolidMaterial::SolidMaterial | ( | Magick::Color | m_color, | |
bool | is_light, | |||
double | reflection, | |||
double | diffuse, | |||
double | reflectivity, | |||
double | refraction, | |||
double | opacity | |||
) | [inline] |
SolidMaterial::SolidMaterial | ( | const SolidMaterial & | other | ) | [inline] |
virtual SolidMaterial::~SolidMaterial | ( | ) | [inline, virtual] |
Definition at line 118 of file solidmaterial.h.
Color SolidMaterial::get_color | ( | const Point3D & | intersection_point | ) | const [virtual] |
Calculate color at given point on the material.
Implements Material.
Definition at line 11 of file solidmaterial.cpp.
References m_color.
double SolidMaterial::get_diffuse | ( | const Point3D & | intersection_point | ) | const [virtual] |
Get the diffusion coefficient at the point.
intersection_point | Point in space where ray intersected an object |
Implements Material.
Definition at line 25 of file solidmaterial.cpp.
References m_diffusion_factor.
double SolidMaterial::get_opacity | ( | const Point3D & | intersection_point | ) | const [virtual] |
Get the opacity of this material at the point.
intersection_point | Point in space where ray intersected an object |
Implements Material.
Definition at line 50 of file solidmaterial.cpp.
References m_opacity.
double SolidMaterial::get_reflection | ( | const Point3D & | intersection_point | ) | const [virtual] |
Get reflection coefficient at the point.
intersection_point | Point in space where ray intersected an object |
Implements Material.
Definition at line 35 of file solidmaterial.cpp.
References m_reflection_coefficient.
double SolidMaterial::get_reflectivity | ( | const Point3D & | intersection_point | ) | const [virtual] |
Get reflectivity at the point.
intersection_point | Point in space where ray intersected an object |
Implements Material.
Definition at line 40 of file solidmaterial.cpp.
References m_reflectivity.
double SolidMaterial::get_refraction_index | ( | const Point3D & | intersection_point | ) | const [virtual] |
Get the index of refraction at the given point. Note that varying the index of refraction across the material will most likely return results that are not accurate.
intersection_point | Point in space where ray intersected an object |
Implements Material.
Definition at line 45 of file solidmaterial.cpp.
References m_refraction_index.
bool SolidMaterial::is_light | ( | const Point3D & | intersection_point | ) | const [virtual] |
Determine if material emits light at given point. Note: due to the rendering algoritm currently being used, varying this value based on position might have unexpected results.
Implements Material.
Definition at line 16 of file solidmaterial.cpp.
References m_is_light_source.
virtual void SolidMaterial::normalize_opacity | ( | ) | [inline, protected, virtual] |
Ensure m_opacity remains within the range of 0.0f to 1.0f.
Definition at line 61 of file solidmaterial.h.
References m_opacity, OPAQUE, and TRANSPARENT.
Referenced by set_opacity().
Here is the caller graph for this function:
void SolidMaterial::set_diffuse | ( | double | diffuse | ) | [virtual] |
Set the diffusion coefficient for the object. Subclasses are not required to do anything useful with this information.
Implements Material.
Definition at line 30 of file solidmaterial.cpp.
References m_diffusion_factor.
void SolidMaterial::set_is_light | ( | bool | v | ) | [virtual] |
Set whether or not object emits light. Subclasses are not required to do anything useful with this information.
v | True if material emits light |
Implements Material.
Definition at line 20 of file solidmaterial.cpp.
References m_is_light_source.
void SolidMaterial::set_opacity | ( | double | opacity | ) | [virtual] |
Set opacity for the object. Subclasses are not required to do anything useful with this information.
opacity | The suggested opacity for the material |
Implements Material.
Definition at line 55 of file solidmaterial.cpp.
References m_opacity, and normalize_opacity().
Here is the call graph for this function:
Magick::Color SolidMaterial::m_color [protected] |
This is the color of the material.
Definition at line 48 of file solidmaterial.h.
Referenced by get_color().
double SolidMaterial::m_diffusion_factor [protected] |
This describes how much this material scatters the light off the surface. This value is between 0 and 1, 0 means the material scatters 0% of the light, a 1 means the material scatters 100% of the light.
Definition at line 41 of file solidmaterial.h.
Referenced by get_diffuse(), and set_diffuse().
SolidMaterial::SolidMaterialStaticInit SolidMaterial::m_init [static, private] |
bool SolidMaterial::m_is_light_source [protected] |
Is this material a light source?
Definition at line 51 of file solidmaterial.h.
Referenced by is_light(), and set_is_light().
double SolidMaterial::m_opacity [protected] |
This is how opaque the object is, or more correctly how transparent the object. A value of 0 is fully opaque, a value of 1.0 is fully transparent.
Definition at line 55 of file solidmaterial.h.
Referenced by get_opacity(), normalize_opacity(), and set_opacity().
double SolidMaterial::m_reflection_coefficient [protected] |
This is the percentage of light that is reflected off this material. This value is between 0 and 1, 0 means the material reflects 0% of the light, a 1 means the material reflects 100% of the light.
Definition at line 36 of file solidmaterial.h.
Referenced by get_reflection().
double SolidMaterial::m_reflectivity [protected] |
This number describes how reflective this material is. Higher numbers mean shinier objects.
Definition at line 45 of file solidmaterial.h.
Referenced by get_reflectivity().
double SolidMaterial::m_refraction_index [protected] |
This describes the amount of refraction occuring within the object.
Definition at line 58 of file solidmaterial.h.
Referenced by get_refraction_index().