#include <DynamicObject.h>
Public Member Functions | |
DynamicObject (std::string name) | |
virtual | ~DynamicObject () |
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 Attributes | |
BIH< Primitive > | localTree |
Dynamic objects are stored and loaded in world space coordinates to avoid matrix multiplications.
Uses a BIH that can be recomputed very fast, instead of a SAH based KDTree.
Definition at line 18 of file DynamicObject.h.
rcrt::DynamicObject::DynamicObject | ( | std::string | name | ) |
Definition at line 8 of file DynamicObject.cpp.
References rcrt::Matrix4D::identity(), rcrt::SolidObject::invWorldMatrix, and rcrt::SolidObject::worldMatrix.
rcrt::DynamicObject::~DynamicObject | ( | ) | [virtual] |
Definition at line 14 of file DynamicObject.cpp.
void rcrt::DynamicObject::setPrimitives | ( | std::vector< Primitive * > * | prList | ) | [virtual] |
Implements rcrt::SolidObject.
Definition at line 19 of file DynamicObject.cpp.
References localTree.
void rcrt::DynamicObject::setWorldMatrix | ( | const Matrix4D & | mat | ) | [virtual] |
This does nothing, as we are alway in worldspace.
Reimplemented from rcrt::SolidObject.
Definition at line 24 of file DynamicObject.cpp.
Intersection rcrt::DynamicObject::intersect | ( | Ray & | r | ) | const [virtual] |
The | ray that will be tested against. |
Implements rcrt::Traceable.
Definition at line 29 of file DynamicObject.cpp.
References rcrt::Intersection::isValid(), and localTree.
const AABB & rcrt::DynamicObject::getBoundingBox | ( | ) | const [virtual] |
Implements rcrt::Traceable.
Definition at line 39 of file DynamicObject.cpp.
References localTree.
const Point3D & rcrt::DynamicObject::getCentroid | ( | ) | const [virtual] |
Implements rcrt::Traceable.
Definition at line 44 of file DynamicObject.cpp.
References localTree.
BIH<Primitive> rcrt::DynamicObject::localTree [private] |
Definition at line 21 of file DynamicObject.h.
Referenced by getBoundingBox(), getCentroid(), intersect(), and setPrimitives().