Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

toxic::Ring Class Reference

#include <ring.h>

Inheritance diagram for toxic::Ring:

toxic::IAreaLight toxic::IBoundedObject toxic::ILight toxic::IObject toxic::Basis List of all members.

Public Member Functions

 Ring (const sheep::Matrix4 &m, const ISurfaceShader *surface_shader, sheep::Real inner_radius, IntersectionMask intersection_mask=INTERSECT_ALL_RAYS)
 m is the object space to world space transformation matrix.

virtual const sheep::AABB3GetAABB () const
virtual sheep::Real ComputeSurfaceArea () const
 Computes the surface area of this object.

virtual void EvaluateSurface (const sheep::Point2 &input, sheep::Point3 *point, sheep::Vector3 *geometric_normal) const
virtual bool Intersect (const Context &context, const Ray &ray, Hit *hit=0) const

Private Attributes

sheep::Real m_inner_radius2
 Square of the ring's inner radius.

sheep::Point3 m_center
 Center of the object, expressed in world space.

sheep::Vector3 m_ex
sheep::Vector3 m_ey
sheep::Vector3 m_ez
 Basis vectors, expressed in world space.

sheep::AABB3 m_aabb
 Bounding box of the object, expressed in world space.


Constructor & Destructor Documentation

Ring::Ring const sheep::Matrix4 m,
const ISurfaceShader surface_shader,
sheep::Real  inner_radius,
IntersectionMask  intersection_mask = INTERSECT_ALL_RAYS
 

m is the object space to world space transformation matrix.

Parameters:
inner_radius  The inner radius of the ring, in [0..1).

Definition at line 43 of file ring.cpp.

References sheep::AABB3::Extend(), toxic::OBJECT_AABB_EXTENSION(), sheep::sq(), and sheep::AABB3::Transform().


Member Function Documentation

Real Ring::ComputeSurfaceArea  )  const [virtual]
 

Computes the surface area of this object.

Todo:
Implement.

Implements toxic::IBoundedObject.

Definition at line 62 of file ring.cpp.

void Ring::EvaluateSurface const sheep::Point2 input,
sheep::Point3 point,
sheep::Vector3 geometric_normal
const [virtual]
 

Given a point in the unit square (the set of points in [0..1]^2), this method computes the corresponding surface point and normal (both are expressed in world space).

Todo:
Implement.

Implements toxic::IBoundedObject.

Definition at line 67 of file ring.cpp.

const sheep::AABB3 & Ring::GetAABB  )  const [inline, virtual]
 

Returns the Axis Aligned Bounding Box of this object. The AABB is expressed in world space.

Implements toxic::IBoundedObject.

Definition at line 114 of file ring.h.

bool Ring::Intersect const Context context,
const Ray ray,
Hit hit = 0
const [virtual]
 

This method returns true if the ray intersect the object, or false otherwise. If 'hit' is not null, intersection data are reported through the 'hit' parameter (only if an intersection has been found; if no intersection has been found, the 'hit' parameter is left unchanged). The ray is expressed in world space.

Todo:
Handle the case where a=0.0.

Handle the case where a=0.0.

Handle the case where r.m_direction.m_y=0.0.

Handle the case where r.m_direction.m_y=0.0.

Parameters:
ray  'ray' is expressed in world space.

Implements toxic::IObject.

Definition at line 78 of file ring.cpp.

References toxic::Ray::GetType(), toxic::Hit::m_abscissa, toxic::Ray::m_direction, toxic::Hit::m_geometric_normal, m_inner_radius2, toxic::Statistics::m_intersections_found, toxic::Hit::m_object, toxic::Ray::m_origin, toxic::Hit::m_shading_normal, toxic::Context::m_statistics, toxic::Statistics::m_tested_intersections, sheep::Point3::m_x, sheep::Vector3::m_x, sheep::Vector3::m_y, sheep::Point3::m_y, sheep::Point3::m_z, sheep::Vector3::m_z, max(), sheep::Vector3::Norm(), sq(), and toxic::Basis::TransformToLocal().


Member Data Documentation

sheep::AABB3 toxic::Ring::m_aabb [private]
 

Bounding box of the object, expressed in world space.

Definition at line 88 of file ring.h.

sheep::Point3 toxic::Ring::m_center [private]
 

Center of the object, expressed in world space.

Definition at line 86 of file ring.h.

sheep::Vector3 toxic::Ring::m_ex [private]
 

Definition at line 87 of file ring.h.

sheep::Vector3 toxic::Ring::m_ey [private]
 

Definition at line 87 of file ring.h.

sheep::Vector3 toxic::Ring::m_ez [private]
 

Basis vectors, expressed in world space.

Definition at line 87 of file ring.h.

sheep::Real toxic::Ring::m_inner_radius2 [private]
 

Square of the ring's inner radius.

Definition at line 85 of file ring.h.

Referenced by Intersect().


The documentation for this class was generated from the following files:
Generated on Tue May 11 01:31:58 2004 for toxic by doxygen 1.3.6