GlobalVertex.cs 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. using Autodesk.Max;
  2. namespace Max2Babylon
  3. {
  4. public struct GlobalVertex
  5. {
  6. public int BaseIndex { get; set; }
  7. public int CurrentIndex { get; set; }
  8. public IPoint3 Position { get; set; }
  9. public IPoint3 Normal { get; set; }
  10. public IPoint2 UV { get; set; }
  11. public IPoint2 UV2 { get; set; }
  12. public override int GetHashCode()
  13. {
  14. return base.GetHashCode();
  15. }
  16. public override bool Equals(object obj)
  17. {
  18. if (!(obj is GlobalVertex))
  19. {
  20. return false;
  21. }
  22. var other = (GlobalVertex)obj;
  23. if (other.BaseIndex != BaseIndex)
  24. {
  25. return false;
  26. }
  27. if (!other.Position.IsAlmostEqualTo(Position, Tools.Epsilon))
  28. {
  29. return false;
  30. }
  31. if (!other.Normal.IsAlmostEqualTo(Normal, Tools.Epsilon))
  32. {
  33. return false;
  34. }
  35. if (UV != null && !other.UV.IsAlmostEqualTo(UV, Tools.Epsilon))
  36. {
  37. return false;
  38. }
  39. if (UV2 != null && !other.UV2.IsAlmostEqualTo(UV2, Tools.Epsilon))
  40. {
  41. return false;
  42. }
  43. return true;
  44. }
  45. }
  46. }