#include <ConvexQuad.h>
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 AABB & | getBoundingBox () const |
virtual const Point3D & | getCentroid () 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 |
TODO make more general using vertices with normals, etc.
Definition at line 17 of file ConvexQuad.h.
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.
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] |
The | ray that will be tested against. |
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] |
Implements rcrt::Traceable.
Definition at line 112 of file ConvexQuad.cpp.
References box.
const Point3D & rcrt::ConvexQuad::getCentroid | ( | ) | const [virtual] |
Implements rcrt::Traceable.
Definition at line 117 of file ConvexQuad.cpp.
References center.
Vec3D rcrt::ConvexQuad::getSNormal | ( | float | a, | |
float | b | |||
) | const [virtual] |
a | 2D Parameterization of the surface | |
b | 2D Parameterization of the surface |
Implements rcrt::Primitive.
Definition at line 142 of file ConvexQuad.cpp.
References normal.
Vec3D rcrt::ConvexQuad::getGNormal | ( | float | a, | |
float | b | |||
) | const [virtual] |
a | 2D Parameterization of the surface | |
b | 2D Parameterization of the surface |
Implements rcrt::Primitive.
Definition at line 147 of file ConvexQuad.cpp.
References normal.
Point2D rcrt::ConvexQuad::getUV | ( | float | a, | |
float | b | |||
) | const [virtual] |
a | 2D Parameterization of the surface | |
b | 2D Parameterization of the surface |
Implements rcrt::Primitive.
Definition at line 152 of file ConvexQuad.cpp.
Point3D rcrt::ConvexQuad::va [private] |
Point3D rcrt::ConvexQuad::vb [private] |
Point3D rcrt::ConvexQuad::vc [private] |
Point3D rcrt::ConvexQuad::vd [private] |
Point3D rcrt::ConvexQuad::center [private] |
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] |