IIndexedMesh.h 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /*
  2. * Copyright (c) Contributors to the Open 3D Engine Project.
  3. * For complete copyright and license terms please see the LICENSE at the root of this distribution.
  4. *
  5. * SPDX-License-Identifier: Apache-2.0 OR MIT
  6. *
  7. */
  8. #pragma once
  9. #include "Cry_Color.h"
  10. #include <Vertex.h>
  11. // Description:
  12. // 2D Texture coordinates used by CMesh.
  13. struct SMeshTexCoord
  14. {
  15. SMeshTexCoord() {}
  16. private:
  17. float s, t;
  18. public:
  19. bool IsEquivalent(const SMeshTexCoord& other, float epsilon = 0.00005f) const
  20. {
  21. return
  22. (fabs_tpl(s - other.s) <= epsilon) &&
  23. (fabs_tpl(t - other.t) <= epsilon);
  24. }
  25. ILINE Vec2 GetUV() const
  26. {
  27. return Vec2(s, t);
  28. }
  29. };
  30. // Description:
  31. // RGBA Color description structure used by CMesh.
  32. struct SMeshColor
  33. {
  34. SMeshColor() {}
  35. private:
  36. uint8 r, g, b, a;
  37. public:
  38. explicit SMeshColor(uint8 otherr, uint8 otherg, uint8 otherb, uint8 othera)
  39. {
  40. r = otherr;
  41. g = otherg;
  42. b = otherb;
  43. a = othera;
  44. }
  45. };