54 :mOrigin(origin), mDirection(direction) {}
68 return Vector3(mOrigin + (mDirection *
t));
84 return Math::intersects(*
this,
p);
94 return Math::intersects(*
this,
p.planes,
p.outside == Plane::POSITIVE_SIDE);
104 return Math::intersects(*
this,
s);
114 return Math::intersects(*
this,
box);
A 3D box aligned with the x/y/z axes.
Represents a convex volume bounded by planes.
Defines a plane in 3D space.
Representation of a ray in space, i.e.
const Vector3 & getOrigin(void) const
Gets the origin of the ray.
std::pair< bool, Real > intersects(const PlaneBoundedVolume &p) const
Tests whether this ray intersects the given plane bounded volume.
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.
std::pair< bool, Real > intersects(const AxisAlignedBox &box) const
Tests whether this ray intersects the given box.
Ray(const Vector3 &origin, const Vector3 &direction)
Vector3 getPoint(Real t) const
Gets the position of a point t units along the ray.
void setDirection(const Vector3 &dir)
Sets the direction of the ray.
std::pair< bool, Real > intersects(const Sphere &s) const
Tests whether this ray intersects the given sphere.
const Vector3 & getDirection(void) const
Gets the direction of the ray.
Vector3 operator*(Real t) const
Gets the position of a point t units along the ray.
Reference-counted shared pointer, used for objects where implicit destruction is required.
A sphere primitive, mostly used for bounds checking.
Standard 3-dimensional vector.