pointAlongRay.js 736 B

123456789101112131415161718192021
  1. //This file is automatically rebuilt by the Cesium build process.
  2. export default "/**\n\
  3. * Computes the point along a ray at the given time. <code>time</code> can be positive, negative, or zero.\n\
  4. *\n\
  5. * @name czm_pointAlongRay\n\
  6. * @glslFunction\n\
  7. *\n\
  8. * @param {czm_ray} ray The ray to compute the point along.\n\
  9. * @param {float} time The time along the ray.\n\
  10. * \n\
  11. * @returns {vec3} The point along the ray at the given time.\n\
  12. * \n\
  13. * @example\n\
  14. * czm_ray ray = czm_ray(vec3(0.0), vec3(1.0, 0.0, 0.0)); // origin, direction\n\
  15. * vec3 v = czm_pointAlongRay(ray, 2.0); // (2.0, 0.0, 0.0)\n\
  16. */\n\
  17. vec3 czm_pointAlongRay(czm_ray ray, float time)\n\
  18. {\n\
  19. return ray.origin + (time * ray.direction);\n\
  20. }\n\
  21. ";