Shkyera Engine
Easy to use, game engine for Python
Loading...
Searching...
No Matches
shkyera::Ray Struct Reference

#include <Ray.hpp>

Public Member Functions

glm::vec3 at (float t) const
 
float project (const Ray &other) const
 
float project (const glm::vec3 &point) const
 

Public Attributes

glm::vec3 origin
 
glm::vec3 direction
 

Member Function Documentation

◆ at()

glm::vec3 shkyera::Ray::at ( float  t) const

Get the coordinate of the point on the ray at time t.

Returns
The point along the ray that is t units away from origin.

◆ project() [1/2]

float shkyera::Ray::project ( const glm::vec3 &  point) const

Project another point onto this ray. Find the point on this ray that is closest to the other ray. Project other ray onto this ray and find the distance from this ray's origin to the projection as a unit of normalized direction.

Parameters
otherRay which should be projected
Returns
distance from origin in the ray's direction to the closest point (a non-negative value)

◆ project() [2/2]

float shkyera::Ray::project ( const Ray other) const

Project another ray onto this ray. Find the point on this ray that is closest to the other ray. Project other ray onto this ray and find the distance from this ray's origin to the projection as a unit of normalized direction

Parameters
otherRay which should be projected
Returns
distance from origin in the ray's direction to the closest point (a non-negative value)

Member Data Documentation

◆ direction

glm::vec3 shkyera::Ray::direction

◆ origin

glm::vec3 shkyera::Ray::origin

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