summaryrefslogtreecommitdiff
path: root/physics.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'physics.cpp')
-rw-r--r--physics.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/physics.cpp b/physics.cpp
index 0c67747..31dbc66 100644
--- a/physics.cpp
+++ b/physics.cpp
@@ -245,10 +245,10 @@ struct Shrinkwrap {
return stack[top - 1 - i];
};
auto ccw = [](v2f a, v2f b, v2f c) {
- float angle =
- (b.y - a.y) * (c.x - b.x) -
- (b.x - a.x) * (c.y - b.y);
- return angle > -0.00001f;
+ float angle =
+ (b.y - a.y) * (c.x - b.x) -
+ (b.x - a.x) * (c.y - b.y);
+ return angle > -0.00001f;
};
for (i = 0; i < src_count; i++) {
v2f p = src[i];
@@ -259,13 +259,13 @@ struct Shrinkwrap {
src,
src + src_count,
[p0](const v2f& f, const v2f& s) {
- float a =
- (f.y - p0.y) * (s.x - f.x) -
- (f.x - p0.x) * (s.y - f.y);
- bool colinear = fabsf(a) < 0.001f;
- if (colinear)
- return v2f::mag(p0 - s) >= v2f::mag(p0 - f);
- return a < 0.0f;
+ float a =
+ (f.y - p0.y) * (s.x - f.x) -
+ (f.x - p0.x) * (s.y - f.y);
+ bool colinear = fabsf(a) < 0.001f;
+ if (colinear)
+ return v2f::mag(p0 - s) >= v2f::mag(p0 - f);
+ return a < 0.0f;
}
);
for (i = 0; i < src_count; i++) {