Urho3D
Public Member Functions | Public Attributes | List of all members
Urho3D::Ray Class Reference

Infinite straight line in three-dimensional space. More...

#include </home/runner/work/urho3d-doxygen.github.io/urho3d-doxygen.github.io/urho3d_repo/Source/Urho3D/Math/Ray.h>

Public Member Functions

 Ray () noexcept=default
 Construct a degenerate ray with zero origin and direction.
 
 Ray (const Vector3 &origin, const Vector3 &direction) noexcept
 Construct from origin and direction. The direction will be normalized.
 
 Ray (const Ray &ray) noexcept=default
 Copy-construct from another ray.
 
Rayoperator= (const Ray &rhs) noexcept=default
 Assign from another ray.
 
bool operator== (const Ray &rhs) const
 Check for equality with another ray.
 
bool operator!= (const Ray &rhs) const
 Check for inequality with another ray.
 
void Define (const Vector3 &origin, const Vector3 &direction)
 Define from origin and direction. The direction will be normalized.
 
Vector3 Project (const Vector3 &point) const
 Project a point on the ray.
 
float Distance (const Vector3 &point) const
 Return distance of a point from the ray.
 
Vector3 ClosestPoint (const Ray &ray) const
 Return closest point to another ray.
 
float HitDistance (const Plane &plane) const
 Return hit distance to a plane, or infinity if no hit.
 
float HitDistance (const BoundingBox &box) const
 Return hit distance to a bounding box, or infinity if no hit.
 
float HitDistance (const Frustum &frustum, bool solidInside=true) const
 Return hit distance to a frustum, or infinity if no hit. If solidInside parameter is true (default) rays originating from inside return zero distance, otherwise the distance to the closest plane.
 
float HitDistance (const Sphere &sphere) const
 Return hit distance to a sphere, or infinity if no hit.
 
float HitDistance (const Vector3 &v0, const Vector3 &v1, const Vector3 &v2, Vector3 *outNormal=nullptr, Vector3 *outBary=nullptr) const
 Return hit distance to a triangle, or infinity if no hit. Optionally return hit normal and hit barycentric coordinate at intersect point.
 
float HitDistance (const void *vertexData, i32 vertexStride, i32 vertexStart, i32 vertexCount, Vector3 *outNormal=nullptr, Vector2 *outUV=nullptr, i32 uvOffset=0) const
 Return hit distance to non-indexed geometry data, or infinity if no hit. Optionally return hit normal and hit uv coordinates at intersect point.
 
float HitDistance (const void *vertexData, i32 vertexStride, const void *indexData, i32 indexSize, i32 indexStart, i32 indexCount, Vector3 *outNormal=nullptr, Vector2 *outUV=nullptr, i32 uvOffset=0) const
 Return hit distance to indexed geometry data, or infinity if no hit. Optionally return hit normal and hit uv coordinates at intersect point.
 
bool InsideGeometry (const void *vertexData, i32 vertexSize, i32 vertexStart, i32 vertexCount) const
 Return whether ray is inside non-indexed geometry.
 
bool InsideGeometry (const void *vertexData, i32 vertexSize, const void *indexData, i32 indexSize, i32 indexStart, i32 indexCount) const
 Return whether ray is inside indexed geometry.
 
Ray Transformed (const Matrix3x4 &transform) const
 Return transformed by a 3x4 matrix. This may result in a non-normalized direction.
 

Public Attributes

Vector3 origin_
 Ray origin.
 
Vector3 direction_
 Ray direction.
 

Detailed Description

Infinite straight line in three-dimensional space.


The documentation for this class was generated from the following files: