diff options
author | Thales Lima Oliveira <thaleslima.ufu@gmail.com> | 2016-08-31 23:09:16 -0300 |
---|---|---|
committer | Thales Lima Oliveira <thaleslima.ufu@gmail.com> | 2016-08-31 23:09:16 -0300 |
commit | 8f475833e585692544cb0f481b0dce0c3439a1a9 (patch) | |
tree | ea8d2e02c184cc62b124da354d251fde57ac57e0 /Project/Bus.cpp | |
parent | c478afa9fbef4b21ea85dbc266169b9eebf369a9 (diff) | |
download | PSP.git-8f475833e585692544cb0f481b0dce0c3439a1a9.tar.gz PSP.git-8f475833e585692544cb0f481b0dce0c3439a1a9.tar.xz PSP.git-8f475833e585692544cb0f481b0dce0c3439a1a9.zip |
Transformer complete
Diffstat (limited to 'Project/Bus.cpp')
-rw-r--r-- | Project/Bus.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/Project/Bus.cpp b/Project/Bus.cpp index 9484328..9f38da0 100644 --- a/Project/Bus.cpp +++ b/Project/Bus.cpp @@ -36,7 +36,7 @@ void Bus::Draw(wxPoint2DDouble translation, double scale) const DrawRectangle(pts); glPopMatrix(); } - // Draw element (layer 2) + // Draw bus (layer 2) // Push the current matrix on stack. glPushMatrix(); // Rotate the matrix around the object position. @@ -77,8 +77,10 @@ bool Bus::Contains(wxPoint2DDouble position) const bool Bus::Intersects(wxRect2DDouble rect) const { if(m_angle == 0.0 || m_angle == 180.0) return m_rect.Intersects(rect); + + return RotatedRectanglesIntersects(m_rect, rect, m_angle, 0.0); - wxPoint2DDouble m_rectCorners[4] = {m_rect.GetLeftTop(), m_rect.GetLeftBottom(), m_rect.GetRightBottom(), + /*wxPoint2DDouble m_rectCorners[4] = {m_rect.GetLeftTop(), m_rect.GetLeftBottom(), m_rect.GetRightBottom(), m_rect.GetRightTop()}; wxPoint2DDouble rectCorners[4] = {rect.GetLeftTop(), rect.GetLeftBottom(), rect.GetRightBottom(), rect.GetRightTop()}; @@ -144,7 +146,7 @@ bool Bus::Intersects(wxRect2DDouble rect) const } return true; - // return rect.Intersects(m_rect); + // return rect.Intersects(m_rect);*/ } bool Bus::PickboxContains(wxPoint2DDouble position) { |