Om
1.0.0
A universal framework for multimedia simulation
|
A class that represents a ray in 3D space. More...
#include <omRay3D.h>
Public Member Functions | |
Ray3D () | |
Create a ray starting at the origin pointing in the positive Z direction. More... | |
Ray3D (const VectorND< T, 3 > &newOrigin, const VectorND< T, 3 > &newDirection) | |
Create a ray with the specified origin and direction. More... | |
VectorND< T, 3 > | getPositionAt (T parameter) const |
Get the position along the ray at the specified parameter value. More... | |
Ray3D< T > | normalize () const |
Return a new ray with a unit-length direction vector. More... | |
Bool | intersectsSphere (const VectorND< T, 3 > &position, T radius) const |
Return whether or not this ray intersects the specified sphere. More... | |
Bool | intersectsSphere (const Sphere3D< T > &sphere) const |
Return whether or not this ray intersects the specified sphere. More... | |
Bool | intersectsSphere (const VectorND< T, 3 > &position, T radius, T &distance) const |
Return whether or not this ray intersects the specified sphere. More... | |
Bool | intersectsSphere (const Sphere3D< T > &sphere, T &distance) const |
Return whether or not this ray intersects the specified sphere. More... | |
Bool | intersectsTriangle (const VectorND< T, 3 > &v1, const VectorND< T, 3 > &v2, const VectorND< T, 3 > &v3) const |
Return whether or not this ray intersects the specified triangle. More... | |
Bool | intersectsTriangle (const VectorND< T, 3 > &v1, const VectorND< T, 3 > &v2, const VectorND< T, 3 > &v3, T &distance) const |
Return whether or not this ray intersects the specified triangle. More... | |
Bool | intersectsTriangle (const VectorND< T, 3 > &v1, const VectorND< T, 3 > &v2, const VectorND< T, 3 > &v3, T &distance, T &u, T &v) const |
Return whether or not this ray intersects the specified triangle. More... | |
Bool | intersectsCylinder (const VectorND< T, 3 > &p1, const VectorND< T, 3 > &axis, T height, T radius, T &distance) const |
Return whether or not this ray intersects a cylinder with the specified attributes. More... | |
Bool | intersectsCylinder2 (const VectorND< T, 3 > &p1, const VectorND< T, 3 > &axis, T height, T radius1, T radius2, T &distance) const |
Return whether or not this ray intersects a cylinder with the specified attributes. More... | |
Bool | intersectsCapsule (const VectorND< T, 3 > &p1, const VectorND< T, 3 > &axis, T height, T radius, T &distance) const |
Return whether or not this ray intersects a capsule with the specified attributes. More... | |
Bool | intersectsCapsule2 (const VectorND< T, 3 > &p1, const VectorND< T, 3 > &axis, T height, T radius1, T radius2, T &distance) const |
Return whether or not this ray intersects a capsule with the specified attributes. More... | |
Public Attributes | |
VectorND< T, 3 > | origin |
The origin of the ray in 3D space;. More... | |
VectorND< T, 3 > | direction |
The direction of the ray in 3D space. More... | |
A class that represents a ray in 3D space.
This class contains two data members: origin and direction. Origin represents the starting position of the ray and direction represents the positively parameterized direction along the ray.
|
inline |
Create a ray starting at the origin pointing in the positive Z direction.
|
inline |
Create a ray with the specified origin and direction.
|
inline |
Get the position along the ray at the specified parameter value.
This position is calculated using the equation: position = origin + parameter*direction.
|
inline |
Return a new ray with a unit-length direction vector.
|
inline |
Return whether or not this ray intersects the specified sphere.
|
inline |
Return whether or not this ray intersects the specified sphere.
|
inline |
Return whether or not this ray intersects the specified sphere.
The distance along the ray where the intersection occured is placed in the output parameter.
|
inline |
Return whether or not this ray intersects the specified sphere.
The distance along the ray where the intersection occured is placed in the output parameter.
|
inline |
Return whether or not this ray intersects the specified triangle.
|
inline |
Return whether or not this ray intersects the specified triangle.
The distance along the ray where the intersection occured is placed in the output parameter.
|
inline |
Return whether or not this ray intersects the specified triangle.
The distance along the ray where the intersection occured is placed in the output parameter, along with the first two barycentric coordinates.
|
inline |
Return whether or not this ray intersects a cylinder with the specified attributes.
The distance along the ray where the intersection occured is placed in the output parameter.
The cylinder is specified by an endpoint, unit axis vector, height, and radius.
|
inline |
Return whether or not this ray intersects a cylinder with the specified attributes.
The distance along the ray where the intersection occured is placed in the output parameter.
The cylinder is specified by an endpoint, unit axis vector, height, and radii. This method allows the cylinder endpoints to have different radii.
|
inline |
Return whether or not this ray intersects a capsule with the specified attributes.
The distance along the ray where the intersection occured is placed in the output parameter.
The capsule is specified by an endpoint, unit axis vector, height, and radius.
|
inline |
Return whether or not this ray intersects a capsule with the specified attributes.
The distance along the ray where the intersection occured is placed in the output parameter.
The capsule is specified by an endpoint, unit axis vector, height, and radii. This method allows the capsule endpoints to have different radii.
VectorND<T,3> om::math::Ray3D< T >::origin |
The origin of the ray in 3D space;.
VectorND<T,3> om::math::Ray3D< T >::direction |
The direction of the ray in 3D space.