valueTransform.js 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. //This file is automatically rebuilt by the Cesium build process.
  2. export default "/**\n\
  3. * Transform metadata values following the EXT_structural_metadata spec\n\
  4. * by multiplying by scale and adding the offset. Operations are always\n\
  5. * performed component-wise, even for matrices.\n\
  6. * \n\
  7. * @param {float|vec2|vec3|vec4|mat2|mat3|mat4} offset The offset to add\n\
  8. * @param {float|vec2|vec3|vec4|mat2|mat3|mat4} scale The scale factor to multiply\n\
  9. * @param {float|vec2|vec3|vec4|mat2|mat3|mat4} value The original value.\n\
  10. *\n\
  11. * @return {float|vec2|vec3|vec4|mat2|mat3|mat4} The transformed value of the same scalar/vector/matrix type as the input.\n\
  12. */\n\
  13. float czm_valueTransform(float offset, float scale, float value) {\n\
  14. return scale * value + offset;\n\
  15. }\n\
  16. \n\
  17. vec2 czm_valueTransform(vec2 offset, vec2 scale, vec2 value) {\n\
  18. return scale * value + offset;\n\
  19. }\n\
  20. \n\
  21. vec3 czm_valueTransform(vec3 offset, vec3 scale, vec3 value) {\n\
  22. return scale * value + offset;\n\
  23. }\n\
  24. \n\
  25. vec4 czm_valueTransform(vec4 offset, vec4 scale, vec4 value) {\n\
  26. return scale * value + offset;\n\
  27. }\n\
  28. \n\
  29. mat2 czm_valueTransform(mat2 offset, mat2 scale, mat2 value) {\n\
  30. return matrixCompMult(scale, value) + offset;\n\
  31. }\n\
  32. \n\
  33. mat3 czm_valueTransform(mat3 offset, mat3 scale, mat3 value) {\n\
  34. return matrixCompMult(scale, value) + offset;\n\
  35. }\n\
  36. \n\
  37. mat4 czm_valueTransform(mat4 offset, mat4 scale, mat4 value) {\n\
  38. return matrixCompMult(scale, value) + offset;\n\
  39. }\n\
  40. ";