WindingOrder.js 898 B

12345678910111213141516171819202122232425262728293031323334
  1. import freezeObject from './freezeObject.js';
  2. import WebGLConstants from './WebGLConstants.js';
  3. /**
  4. * Winding order defines the order of vertices for a triangle to be considered front-facing.
  5. *
  6. * @exports WindingOrder
  7. */
  8. var WindingOrder = {
  9. /**
  10. * Vertices are in clockwise order.
  11. *
  12. * @type {Number}
  13. * @constant
  14. */
  15. CLOCKWISE : WebGLConstants.CW,
  16. /**
  17. * Vertices are in counter-clockwise order.
  18. *
  19. * @type {Number}
  20. * @constant
  21. */
  22. COUNTER_CLOCKWISE : WebGLConstants.CCW,
  23. /**
  24. * @private
  25. */
  26. validate : function(windingOrder) {
  27. return windingOrder === WindingOrder.CLOCKWISE ||
  28. windingOrder === WindingOrder.COUNTER_CLOCKWISE;
  29. }
  30. };
  31. export default freezeObject(WindingOrder);