54 :mOrigin(origin), mDirection(direction) {}
68 return Vector3(mOrigin + (mDirection * t));
Representation of a ray in space, i.e.
float Real
Software floating point type.
std::pair< bool, Real > intersects(const Plane &p) const
Tests whether this ray intersects the given plane.
void setOrigin(const Vector3 &origin)
Sets the origin of the ray.
PlaneList planes
Publicly accessible plane list, you can modify this direct.
Defines a plane in 3D space.
void setDirection(const Vector3 &dir)
Sets the direction of the ray.
A 3D box aligned with the x/y/z axes.
static std::pair< bool, Real > intersects(const Ray &ray, const Plane &plane)
Ray / plane intersection, returns boolean result and distance.
std::pair< bool, Real > intersects(const Sphere &s) const
Tests whether this ray intersects the given sphere.
Ray(const Vector3 &origin, const Vector3 &direction)
const Vector3 & getDirection(void) const
Gets the direction of the ray.
A sphere primitive, mostly used for bounds checking.
Standard 3-dimensional vector.
Represents a convex volume bounded by planes.
std::pair< bool, Real > intersects(const AxisAlignedBox &box) const
Tests whether this ray intersects the given box.
const Vector3 & getOrigin(void) const
Gets the origin of the ray.
Vector3 operator*(Real t) const
Gets the position of a point t units along the ray.
std::pair< bool, Real > intersects(const PlaneBoundedVolume &p) const
Tests whether this ray intersects the given plane bounded volume.
Vector3 getPoint(Real t) const
Gets the position of a point t units along the ray.