rcrt::ConvexQuad Class Reference

#include <ConvexQuad.h>

Inheritance diagram for rcrt::ConvexQuad:

Inheritance graph
[legend]
Collaboration diagram for rcrt::ConvexQuad:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 ConvexQuad (SolidObject *parent, const Point3D &pa, const Point3D &pb, const Point3D &pc, const Point3D &pd)
virtual ~ConvexQuad ()
virtual Intersection intersect (Ray &r) const
virtual const AABBgetBoundingBox () const
virtual const Point3DgetCentroid () const
virtual Vec3D getSNormal (float a, float b) const
virtual Vec3D getGNormal (float a, float b) const
virtual Point2D getUV (float a, float b) const

Private Member Functions

bool isInside (Intersection &is) const

Private Attributes

Point3D va
Point3D vb
Point3D vc
Point3D vd
Point3D center
Vec3D normal
AABB box


Detailed Description

A quad primitive. Currently only used for displacement mapping.

TODO make more general using vertices with normals, etc.

Definition at line 17 of file ConvexQuad.h.


Constructor & Destructor Documentation

rcrt::ConvexQuad::ConvexQuad ( SolidObject parent,
const Point3D pa,
const Point3D pb,
const Point3D pc,
const Point3D pd 
)

Definition at line 9 of file ConvexQuad.cpp.

References box, rcrt::AABB::extend(), normal, rcrt::Vec3D::normalize(), vc, and vd.

rcrt::ConvexQuad::~ConvexQuad (  )  [virtual]

Definition at line 18 of file ConvexQuad.cpp.


Member Function Documentation

bool rcrt::ConvexQuad::isInside ( Intersection is  )  const [private]

Definition at line 22 of file ConvexQuad.cpp.

References rcrt::Vec3D::abs(), rcrt::Vec2D::det(), rcrt::Intersection::getPosition(), normal, rcrt::Intersection::setUV(), va, vb, vc, vd, rcrt::Vec3D::x(), rcrt::Vec3D::y(), and rcrt::Vec3D::z().

Referenced by intersect().

Intersection rcrt::ConvexQuad::intersect ( Ray r  )  const [virtual]

Parameters:
The ray that will be tested against.
Returns:
An Intersection that contains the closest intersection that can be determined.

Implements rcrt::Traceable.

Definition at line 122 of file ConvexQuad.cpp.

References rcrt::Vec3D::abs(), rcrt::Ray::atDistance(), rcrt::Ray::dir(), isInside(), normal, rcrt::Ray::org(), and va.

Referenced by rcrt::DisplacedTriangle::intersect().

const AABB & rcrt::ConvexQuad::getBoundingBox (  )  const [virtual]

Returns:
The minimum Axis-Aligned Bounding Box of this Traceable.

Implements rcrt::Traceable.

Definition at line 112 of file ConvexQuad.cpp.

References box.

const Point3D & rcrt::ConvexQuad::getCentroid (  )  const [virtual]

Returns:
Some kind of central point of this object. This may just be an approximation (e.g. the central point of the AABB).

Implements rcrt::Traceable.

Definition at line 117 of file ConvexQuad.cpp.

References center.

Vec3D rcrt::ConvexQuad::getSNormal ( float  a,
float  b 
) const [virtual]

Parameters:
a 2D Parameterization of the surface
b 2D Parameterization of the surface
Returns:
The local space shading normal of the parameterized point on the primitive.

Implements rcrt::Primitive.

Definition at line 142 of file ConvexQuad.cpp.

References normal.

Vec3D rcrt::ConvexQuad::getGNormal ( float  a,
float  b 
) const [virtual]

Parameters:
a 2D Parameterization of the surface
b 2D Parameterization of the surface
Returns:
The local space geometry normal of the parameterized point on the primitive.

Implements rcrt::Primitive.

Definition at line 147 of file ConvexQuad.cpp.

References normal.

Point2D rcrt::ConvexQuad::getUV ( float  a,
float  b 
) const [virtual]

Parameters:
a 2D Parameterization of the surface
b 2D Parameterization of the surface
Returns:
UV texture coordinates of this point.

Implements rcrt::Primitive.

Definition at line 152 of file ConvexQuad.cpp.


Member Data Documentation

Point3D rcrt::ConvexQuad::va [private]

Definition at line 20 of file ConvexQuad.h.

Referenced by intersect(), and isInside().

Point3D rcrt::ConvexQuad::vb [private]

Definition at line 20 of file ConvexQuad.h.

Referenced by isInside().

Point3D rcrt::ConvexQuad::vc [private]

Definition at line 20 of file ConvexQuad.h.

Referenced by ConvexQuad(), and isInside().

Point3D rcrt::ConvexQuad::vd [private]

Definition at line 20 of file ConvexQuad.h.

Referenced by ConvexQuad(), and isInside().

Point3D rcrt::ConvexQuad::center [private]

Definition at line 20 of file ConvexQuad.h.

Referenced by getCentroid().

Vec3D rcrt::ConvexQuad::normal [private]

Definition at line 21 of file ConvexQuad.h.

Referenced by ConvexQuad(), getGNormal(), getSNormal(), intersect(), and isInside().

AABB rcrt::ConvexQuad::box [private]

Definition at line 22 of file ConvexQuad.h.

Referenced by ConvexQuad(), and getBoundingBox().


The documentation for this class was generated from the following files:
Generated on Thu Jan 31 19:33:04 2008 for RenderingCompetitionRayTracer by  doxygen 1.5.3