!B (Sandbox) (CE-21795) Importing models with multisubmaterials via fbx switches...
[CRYENGINE.git] / Code / Sandbox / Plugins / LodGeneratorPlugin / panel / AutoUVBaseType.h
blobaace95a93bbb42c138e1e360f9e23d0678eae4d1
1 #pragma once
3 namespace LODGenerator
5 struct SAutoUVEdge;
6 struct SAutoUVVertex
8 Vec3 pos;
9 Vec2 projected;
10 Vec3 smoothedNormal;
13 struct SAutoUVVertexNormal
15 SAutoUVVertexNormal() : normal(ZERO), weighting(0.0f) {}
16 Vec3 normal;
17 float weighting;
20 struct SAutoUVFace
22 SAutoUVVertex *v[3];
23 SAutoUVEdge* edges[3];
24 float a[3];
25 bool bDone;
28 struct SAutoUVEdge
30 SAutoUVVertex *v[2];
31 SAutoUVFace *faces[2];
34 struct SAutoUVStackEntry
36 SAutoUVEdge *edge;
37 Vec2 projected[2];
40 struct SAutoUVTri
42 public:
43 SAutoUVTri(Vec2 &a, Vec2 &b, Vec2 &c, Vec3 &ap, Vec3 &bp, Vec3 &cp, SAutoUVVertex *va, SAutoUVVertex *vb, SAutoUVVertex *vc);
45 public:
46 Vec2 v[3];
47 Vec3 pos[3];
48 Vec3 tangent;
49 Vec3 bitangent;
50 Vec3 normal;
51 SAutoUVVertex *orig[3];
54 struct SAutoUVFinalVertex
56 Vec3 pos;
57 Vec2 uv;
58 Vec3 tangent;
59 Vec3 bitangent;
60 Vec3 normal;
61 SAutoUVVertex *orig;
64 struct SAutoUVSquare
66 public:
67 SAutoUVSquare(int _w, int _h, float _mx, float _my, int polyStart, int polyEnd);
68 bool operator <(const SAutoUVSquare &rhs) const;
69 void Rotate();
70 void RotateTris(std::vector<SAutoUVTri> &tris);
72 public:
73 int w,h;
74 int x,y;
75 int s,e;
76 float mx,my;
79 class SAutoUVExpandingRasteriser
81 public:
82 SAutoUVExpandingRasteriser(float resolution);
83 ~SAutoUVExpandingRasteriser();
85 void ExpandToFitVertices(int bbMin[2], int bbMax[2]);
86 bool RayTest(Vec2 &a, Vec2 &b, Vec2 c, int x, int y);
87 bool RasteriseTriangle(Vec2 &a, Vec2 &b, Vec2 &c, bool bWrite);
89 public:
90 int m_min[2];
91 int m_max[2];
92 char *m_pixels;
93 float m_resolution;
94 bool m_bInitialised;