diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2017-03-05 16:44:50 +0100 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2017-03-05 16:44:50 +0100 |
commit | 5dbf1809c6e3e905b94b8764e99491e608122261 (patch) | |
tree | 5e5a5360db15d86d59ec8c6e4f7eb511388c5a9a /core/math/quick_hull.h | |
parent | 45438e9918d421b244bfd7776a30e67dc7f2d3e3 (diff) | |
download | redot-engine-5dbf1809c6e3e905b94b8764e99491e608122261.tar.gz |
A Whole New World (clang-format edition)
I can show you the code
Pretty, with proper whitespace
Tell me, coder, now when did
You last write readable code?
I can open your eyes
Make you see your bad indent
Force you to respect the style
The core devs agreed upon
A whole new world
A new fantastic code format
A de facto standard
With some sugar
Enforced with clang-format
A whole new world
A dazzling style we all dreamed of
And when we read it through
It's crystal clear
That now we're in a whole new world of code
Diffstat (limited to 'core/math/quick_hull.h')
-rw-r--r-- | core/math/quick_hull.h | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/core/math/quick_hull.h b/core/math/quick_hull.h index 7bd23d31f2..43a802e6bd 100644 --- a/core/math/quick_hull.h +++ b/core/math/quick_hull.h @@ -29,16 +29,14 @@ #ifndef QUICK_HULL_H #define QUICK_HULL_H +#include "geometry.h" +#include "list.h" #include "rect3.h" #include "set.h" -#include "list.h" -#include "geometry.h" class QuickHull { public: - - struct Edge { union { @@ -46,19 +44,18 @@ public: uint64_t id; }; - - bool operator<(const Edge& p_edge) const { + bool operator<(const Edge &p_edge) const { return id < p_edge.id; } - Edge(int p_vtx_a=0,int p_vtx_b=0) { + Edge(int p_vtx_a = 0, int p_vtx_b = 0) { - if (p_vtx_a>p_vtx_b) { - SWAP(p_vtx_a,p_vtx_b); + if (p_vtx_a > p_vtx_b) { + SWAP(p_vtx_a, p_vtx_b); } - vertices[0]=p_vtx_a; - vertices[1]=p_vtx_b; + vertices[0] = p_vtx_a; + vertices[1] = p_vtx_b; } }; @@ -68,28 +65,31 @@ public: int vertices[3]; Vector<int> points_over; - bool operator<(const Face& p_face) const { + bool operator<(const Face &p_face) const { return points_over.size() < p_face.points_over.size(); } - }; -private: +private: struct FaceConnect { - List<Face>::Element *left,*right; - FaceConnect() { left=NULL; right=NULL; } + List<Face>::Element *left, *right; + FaceConnect() { + left = NULL; + right = NULL; + } }; struct RetFaceConnect { - List<Geometry::MeshData::Face>::Element *left,*right; - RetFaceConnect() { left=NULL; right=NULL; } + List<Geometry::MeshData::Face>::Element *left, *right; + RetFaceConnect() { + left = NULL; + right = NULL; + } }; public: - static uint32_t debug_stop_after; - static Error build(const Vector<Vector3>& p_points,Geometry::MeshData& r_mesh); - + static Error build(const Vector<Vector3> &p_points, Geometry::MeshData &r_mesh); }; #endif // QUICK_HULL_H |