20 lines
594 B
GLSL
20 lines
594 B
GLSL
/**
|
|
* Computes the point along a ray at the given time. <code>time</code> can be positive, negative, or zero.
|
|
*
|
|
* @name czm_pointAlongRay
|
|
* @glslFunction
|
|
*
|
|
* @param {czm_ray} ray The ray to compute the point along.
|
|
* @param {float} time The time along the ray.
|
|
*
|
|
* @returns {vec3} The point along the ray at the given time.
|
|
*
|
|
* @example
|
|
* czm_ray ray = czm_ray(vec3(0.0), vec3(1.0, 0.0, 0.0)); // origin, direction
|
|
* vec3 v = czm_pointAlongRay(ray, 2.0); // (2.0, 0.0, 0.0)
|
|
*/
|
|
vec3 czm_pointAlongRay(czm_ray ray, float time)
|
|
{
|
|
return ray.origin + (time * ray.direction);
|
|
}
|