planeDistance.js 1.1 KB

123456789101112131415161718192021222324252627282930
  1. //This file is automatically rebuilt by the Cesium build process.
  2. export default "/**\n\
  3. * Computes distance from a point to a plane.\n\
  4. *\n\
  5. * @name czm_planeDistance\n\
  6. * @glslFunction\n\
  7. *\n\
  8. * param {vec4} plane A Plane in Hessian Normal Form. See Plane.js\n\
  9. * param {vec3} point A point in the same space as the plane.\n\
  10. * returns {float} The distance from the point to the plane.\n\
  11. */\n\
  12. float czm_planeDistance(vec4 plane, vec3 point) {\n\
  13. return (dot(plane.xyz, point) + plane.w);\n\
  14. }\n\
  15. \n\
  16. /**\n\
  17. * Computes distance from a point to a plane.\n\
  18. *\n\
  19. * @name czm_planeDistance\n\
  20. * @glslFunction\n\
  21. *\n\
  22. * param {vec3} planeNormal Normal for a plane in Hessian Normal Form. See Plane.js\n\
  23. * param {float} planeDistance Distance for a plane in Hessian Normal form. See Plane.js\n\
  24. * param {vec3} point A point in the same space as the plane.\n\
  25. * returns {float} The distance from the point to the plane.\n\
  26. */\n\
  27. float czm_planeDistance(vec3 planeNormal, float planeDistance, vec3 point) {\n\
  28. return (dot(planeNormal, point) + planeDistance);\n\
  29. }\n\
  30. ";