#include <AffineObject.h>
Public Member Functions | |
AffineObject (std::string name) | |
virtual | ~AffineObject () |
void | setPrimitives (std::vector< Primitive * > *prList) |
virtual void | setWorldMatrix (const Matrix4D &mat) |
virtual Intersection | intersect (Ray &r) const |
virtual const AABB & | getBoundingBox () const |
virtual const Point3D & | getCentroid () const |
Private Member Functions | |
void | updateWorldBox () |
Private Attributes | |
SAHKDtree< Primitive > | localTree |
AABB | worldBox |
Uses a local space KDtree built with the SAH for maximum efficiency.
Definition at line 19 of file AffineObject.h.
rcrt::AffineObject::AffineObject | ( | std::string | name | ) |
Definition at line 8 of file AffineObject.cpp.
rcrt::AffineObject::~AffineObject | ( | ) | [virtual] |
Definition at line 12 of file AffineObject.cpp.
void rcrt::AffineObject::updateWorldBox | ( | ) | [private] |
Definition at line 16 of file AffineObject.cpp.
References localTree, worldBox, and rcrt::SolidObject::worldMatrix.
Referenced by setPrimitives(), and setWorldMatrix().
void rcrt::AffineObject::setPrimitives | ( | std::vector< Primitive * > * | prList | ) | [virtual] |
prList | a vector of primitives. |
Implements rcrt::SolidObject.
Definition at line 21 of file AffineObject.cpp.
References localTree, rcrt::Object::name, and updateWorldBox().
Referenced by testDispl1().
void rcrt::AffineObject::setWorldMatrix | ( | const Matrix4D & | mat | ) | [virtual] |
Reimplemented from rcrt::SolidObject.
Definition at line 28 of file AffineObject.cpp.
References rcrt::Matrix4D::inverse(), rcrt::SolidObject::invWorldMatrix, updateWorldBox(), and rcrt::SolidObject::worldMatrix.
Referenced by testDispl1().
Intersection rcrt::AffineObject::intersect | ( | Ray & | r | ) | const [virtual] |
The | ray that will be tested against. |
Implements rcrt::Traceable.
Definition at line 35 of file AffineObject.cpp.
References rcrt::Ray::atDistance(), rcrt::Intersection::backSide(), rcrt::Ray::dir(), rcrt::Intersection::getGNormalL(), rcrt::Intersection::getParams(), rcrt::Intersection::getPosition(), rcrt::Intersection::getPrimitive(), rcrt::Intersection::getSNormalL(), rcrt::AABB::intersect(), rcrt::SolidObject::invWorldMatrix, rcrt::Intersection::isValid(), localTree, rcrt::Ray::org(), rcrt::Ray::setMinDist(), rcrt::Ray::tris, worldBox, rcrt::SolidObject::worldMatrix, rcrt::Point2D::x(), and rcrt::Point2D::y().
const AABB & rcrt::AffineObject::getBoundingBox | ( | ) | const [virtual] |
Implements rcrt::Traceable.
Definition at line 57 of file AffineObject.cpp.
References worldBox.
const Point3D & rcrt::AffineObject::getCentroid | ( | ) | const [virtual] |
Implements rcrt::Traceable.
Definition at line 62 of file AffineObject.cpp.
References rcrt::AABB::getCentroid(), and worldBox.
SAHKDtree<Primitive> rcrt::AffineObject::localTree [private] |
Definition at line 22 of file AffineObject.h.
Referenced by intersect(), setPrimitives(), and updateWorldBox().
AABB rcrt::AffineObject::worldBox [private] |
Definition at line 23 of file AffineObject.h.
Referenced by getBoundingBox(), getCentroid(), intersect(), and updateWorldBox().