Clone of PhatAC @ https://github.com/floaterxk/PhatAC

Polygon.h 1.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. #pragma once
  2. #include "MathLib.h"
  3. class CVertexArray;
  4. class CSWVertex;
  5. enum eCullModes
  6. {
  7. CullCW = 0,
  8. CullNone = 1,
  9. CullUnknown = 2
  10. };
  11. class CPolygon
  12. {
  13. public:
  14. CPolygon();
  15. ~CPolygon();
  16. static void SetPackVerts(CVertexArray *Verts);
  17. void Destroy();
  18. BOOL UnPack(BYTE** ppData, ULONG iSize);
  19. void make_plane();
  20. BOOL polygon_hits_ray(const Ray& ray, float *time);
  21. BOOL point_in_polygon(const Vector& point);
  22. // !! PeaFIXed
  23. BOOL peafixed_polygon_hits_ray(const Ray& ray, float *depth);
  24. static CVertexArray *pack_verts;
  25. CSWVertex** m_pVertexObjects; // 0x00
  26. WORD* m_pVertexIndices; // 0x04
  27. CSWVertex** m_pVertexUnks; // 0x08
  28. short m_iPolyIndex; // 0x0C
  29. BYTE m_iVertexCount; // 0x0E
  30. BYTE m_iPolyType; // 0x0F
  31. DWORD m_iCullType; // 0x10 - 0=CULLCW, 1=CULLNONE (aka: m_iUnknown)
  32. BYTE* m_Face1_UVIndices; // 0x14
  33. BYTE* m_Face2_UVIndices; // 0x18
  34. short m_Face1_TexIndex; // 0x1C
  35. short m_Face2_TexIndex; // 0x1E
  36. Plane m_plane; // 0x20
  37. };