From 2eb07011edab09bc297d81055d8e27315ce7802a Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Sun, 15 Feb 2015 10:40:37 +0200 Subject: [PATCH] Correct TrackAttachment entry endpoint Since endpoint direction points outwards from the endpoint, we want to find one that's as close to opposite to the TrackAttachment's direction as possible. --- source/libr2c2/trackattachment.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/libr2c2/trackattachment.cpp b/source/libr2c2/trackattachment.cpp index 0241668..9e3d244 100644 --- a/source/libr2c2/trackattachment.cpp +++ b/source/libr2c2/trackattachment.cpp @@ -69,7 +69,7 @@ void TrackAttachment::attach_to_closest(float limit) for(unsigned i=0; iget_snap_node(i); - Angle adiff = abs(wrap_balanced(sn.rotation-rotation)); + Angle adiff = abs(wrap_balanced(sn.rotation+Angle::half_turn()-rotation)); if(adiff