23#ifndef VCL_SPACE_CORE_RAY_H
24#define VCL_SPACE_CORE_RAY_H
39template<Po
intConcept Po
intT>
60 static const uint
DIM = PointT::DIM;
91 const PointT&
origin()
const {
return mOrigin; }
107 PointT normalizedDirection()
const {
return mDirection.normalized(); }
109 bool operator==(
const Ray<PointT>& s)
const =
default;
111 bool operator!=(
const Ray<PointT>& s)
const =
default;
117using Ray2 = Ray<Point2<S>>;
119using Ray2i = Ray<Point2i>;
120using Ray2f = Ray<Point2f>;
121using Ray2d = Ray<Point2d>;
124using Ray3 = Ray<Point3<S>>;
126using Ray3i = Ray<Point3i>;
127using Ray3f = Ray<Point3f>;
128using Ray3d = Ray<Point3d>;
144 std::remove_cvref_t<T>,
145 Ray<typename RemoveRef<T>::PointType>>;
A class representing a ray in n-dimensional space. The class is parameterized by a PointConcept,...
Definition ray.h:41
PointT::ScalarType ScalarType
The scalar type of the ray.
Definition ray.h:55
const PointT & direction() const
Returns the direction of the ray.
Definition ray.h:105
Ray(const PointT &origin, const PointT &direction)
Creates a ray with the given origin and direction.
Definition ray.h:74
PointT PointType
The type of point used to represent the origin and direction of the ray.
Definition ray.h:50
static const uint DIM
The dimensionality of the ray.
Definition ray.h:60
const PointT & origin() const
Returns the origin of the ray.
Definition ray.h:91
PointT & origin()
Returns the origin of the ray.
Definition ray.h:84
PointT & direction()
Returns the direction of the ray.
Definition ray.h:98
Ray()
Default constructor. Creates an invalid Ray at the origin (direction is zero).
Definition ray.h:66
A concept representing a 2D Ray.
Definition ray.h:158
A concept representing a 3D Ray.
Definition ray.h:171
A concept representing a Ray.
Definition ray.h:143