From 7028c19d8d5e61b9d4474ebb64ca3369554b945e Mon Sep 17 00:00:00 2001 From: cxl Date: Thu, 28 Jun 2018 17:51:52 +0000 Subject: [PATCH] Core: Bearing renamed to Direction (because of conflict with GEO bearing name) git-svn-id: svn://ultimatepp.org/upp/trunk@12026 f0d560ea-af0d-0410-9eb7-867de7ffcac7 --- uppsrc/Core/Gtypes.cpp | 2 +- uppsrc/Core/Gtypes.h | 6 +++++- uppsrc/plugin/box2d/box2d.upp | 2 -- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/uppsrc/Core/Gtypes.cpp b/uppsrc/Core/Gtypes.cpp index 1629f3a48..472195194 100644 --- a/uppsrc/Core/Gtypes.cpp +++ b/uppsrc/Core/Gtypes.cpp @@ -156,7 +156,7 @@ Pointf Polar(const Pointf& p, double r, double a) return p + r * Polar(a); } -double Bearing(const Pointf& p) +double Direction(const Pointf& p) { return atan2(p.y, p.x); } diff --git a/uppsrc/Core/Gtypes.h b/uppsrc/Core/Gtypes.h index 19a334968..dd2368352 100644 --- a/uppsrc/Core/Gtypes.h +++ b/uppsrc/Core/Gtypes.h @@ -733,8 +733,12 @@ Pointf Mid(const Pointf& a, const Pointf& b); Pointf Orthogonal(const Pointf& p); double Squared(const Pointf& p); double Length(const Pointf& p); -double Bearing(const Pointf& p); +double Direction(const Pointf& p); double Distance(const Pointf& p1, const Pointf& p2); double SquaredDistance(const Pointf& p1, const Pointf& p2); Pointf Polar(double a); Pointf Polar(const Pointf& p, double r, double a); + +// deprecated because of confusing name: + +inline double Bearing(const Pointf& p) { return Direction(p); } diff --git a/uppsrc/plugin/box2d/box2d.upp b/uppsrc/plugin/box2d/box2d.upp index e74d11347..6ff003589 100644 --- a/uppsrc/plugin/box2d/box2d.upp +++ b/uppsrc/plugin/box2d/box2d.upp @@ -1,7 +1,5 @@ description "Box2D\3770,128,128"; -optimize_speed; - file Box2D.h, Collision readonly separator,