From: Mikko Rasa Date: Sun, 15 Feb 2015 08:40:37 +0000 (+0200) Subject: Correct TrackAttachment entry endpoint X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=2eb07011edab09bc297d81055d8e27315ce7802a;p=r2c2.git 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. --- 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