vertexPolyList.h 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. //-----------------------------------------------------------------------------
  2. // Copyright (c) 2012 GarageGames, LLC
  3. //
  4. // Permission is hereby granted, free of charge, to any person obtaining a copy
  5. // of this software and associated documentation files (the "Software"), to
  6. // deal in the Software without restriction, including without limitation the
  7. // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
  8. // sell copies of the Software, and to permit persons to whom the Software is
  9. // furnished to do so, subject to the following conditions:
  10. //
  11. // The above copyright notice and this permission notice shall be included in
  12. // all copies or substantial portions of the Software.
  13. //
  14. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  15. // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  16. // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  17. // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  18. // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  19. // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
  20. // IN THE SOFTWARE.
  21. //-----------------------------------------------------------------------------
  22. #ifndef _VERTEXPOLYLIST_H_
  23. #define _VERTEXPOLYLIST_H_
  24. #ifndef _ABSTRACTPOLYLIST_H_
  25. #include "collision/abstractPolyList.h"
  26. #endif
  27. /// A simple polylist which only gathers the unique verticies passed to it.
  28. class VertexPolyList : public AbstractPolyList
  29. {
  30. public:
  31. VertexPolyList();
  32. virtual ~VertexPolyList() {}
  33. // AbstractPolyList
  34. U32 addPoint(const Point3F& p);
  35. U32 addPlane(const PlaneF& plane) { return 0; }
  36. void begin(BaseMatInstance* material,U32 surfaceKey) {}
  37. void plane(U32 v1,U32 v2,U32 v3) {}
  38. void plane(const PlaneF& p) {}
  39. void plane(const U32 index) {}
  40. void vertex(U32 vi) {}
  41. void end() {}
  42. const PlaneF& getIndexedPlane(const U32 index);
  43. /// Clears any captured verts.
  44. void clear();
  45. /// Returns true if the polylist contains no verts.
  46. bool isEmpty() const { return mVertexList.empty(); }
  47. /// Returns the vertex list.
  48. Vector<Point3F>& getVertexList() { return mVertexList; }
  49. /// Returns the constant vertex list.
  50. const Vector<Point3F>& getVertexList() const { return mVertexList; }
  51. protected:
  52. /// The unique verts we captured.
  53. Vector<Point3F> mVertexList;
  54. };
  55. #endif // _VERTEXPOLYLIST_H_