transformPlane.js 615 B

1234567891011121314151617
  1. //This file is automatically rebuilt by the Cesium build process.
  2. export default "/**\n\
  3. * Transforms a plane.\n\
  4. * \n\
  5. * @name czm_transformPlane\n\
  6. * @glslFunction\n\
  7. *\n\
  8. * @param {vec4} plane The plane in Hessian Normal Form.\n\
  9. * @param {mat4} transform The inverse-transpose of a transformation matrix.\n\
  10. */\n\
  11. vec4 czm_transformPlane(vec4 plane, mat4 transform) {\n\
  12. vec4 transformedPlane = transform * plane;\n\
  13. // Convert the transformed plane to Hessian Normal Form\n\
  14. float normalMagnitude = length(transformedPlane.xyz);\n\
  15. return transformedPlane / normalMagnitude;\n\
  16. }\n\
  17. ";