Skip to content

Commit ad7dc6a

Browse files
authored
Increase coordinate comparison tolerance (EPS) for wall bounding rectangle calculations (#2087)
1 parent 0048d19 commit ad7dc6a

File tree

5 files changed

+9
-8
lines changed

5 files changed

+9
-8
lines changed

plugins/robots/common/twoDModel/src/engine/items/wallItem.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ using namespace graphicsUtils;
2828
namespace {
2929
constexpr qreal wallFriction = 1.0f;
3030
constexpr qreal wallRestituion = 0.8f;
31+
constexpr qreal wallIntersectionEps = 1e-5;
3132
}
3233

3334
WallItem::WallItem(graphicsUtils::AbstractCoordinateSystem *metricSystem,
@@ -304,10 +305,10 @@ QPolygonF WallItem::collidingPolygon() const
304305
QLineF dc(abcdBoundingRect.bottomLeft(), abcdBoundingRect.bottomRight());
305306
QLineF ad(abcdBoundingRect.topLeft(), abcdBoundingRect.bottomLeft());
306307

307-
QList<QPointF> abIntersection = mathUtils::Geometry::intersection(ab, mPath);
308-
QList<QPointF> bcIntersection = mathUtils::Geometry::intersection(bc, mPath);
309-
QList<QPointF> dcIntersection = mathUtils::Geometry::intersection(dc, mPath);
310-
QList<QPointF> adIntersection = mathUtils::Geometry::intersection(ad, mPath);
308+
QList<QPointF> abIntersection = mathUtils::Geometry::intersection(ab, mPath, wallIntersectionEps);
309+
QList<QPointF> bcIntersection = mathUtils::Geometry::intersection(bc, mPath, wallIntersectionEps);
310+
QList<QPointF> dcIntersection = mathUtils::Geometry::intersection(dc, mPath, wallIntersectionEps);
311+
QList<QPointF> adIntersection = mathUtils::Geometry::intersection(ad, mPath, wallIntersectionEps);
311312

312313
Q_ASSERT(abIntersection.length() == 2);
313314
Q_ASSERT(bcIntersection.length() == 2);

qrtranslations/es/plugins/robots/common/twoDModel_es.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -585,7 +585,7 @@
585585
<context>
586586
<name>twoDModel::items::WallItem</name>
587587
<message>
588-
<location filename="../../../../../plugins/robots/common/twoDModel/src/engine/items/wallItem.cpp" line="68"/>
588+
<location filename="../../../../../plugins/robots/common/twoDModel/src/engine/items/wallItem.cpp" line="69"/>
589589
<source>Wall (W)</source>
590590
<translation>Pared (W)</translation>
591591
</message>

qrtranslations/fr/plugins/robots/common/twoDModel_fr.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -593,7 +593,7 @@
593593
<context>
594594
<name>twoDModel::items::WallItem</name>
595595
<message>
596-
<location filename="../../../../../plugins/robots/common/twoDModel/src/engine/items/wallItem.cpp" line="+68"/>
596+
<location filename="../../../../../plugins/robots/common/twoDModel/src/engine/items/wallItem.cpp" line="+69"/>
597597
<source>Wall (W)</source>
598598
<translation>Mur (W)</translation>
599599
</message>

qrtranslations/ru/plugins/robots/common/twoDModel_ru.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -877,7 +877,7 @@
877877
<context>
878878
<name>twoDModel::items::WallItem</name>
879879
<message>
880-
<location filename="../../../../../plugins/robots/common/twoDModel/src/engine/items/wallItem.cpp" line="+68"/>
880+
<location filename="../../../../../plugins/robots/common/twoDModel/src/engine/items/wallItem.cpp" line="+69"/>
881881
<source>Wall (W)</source>
882882
<translation>Стена (W)</translation>
883883
</message>

qrtranslations/vi/plugins/robots/common/twoDModel_vi.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -585,7 +585,7 @@
585585
<context>
586586
<name>twoDModel::items::WallItem</name>
587587
<message>
588-
<location filename="../../../../../plugins/robots/common/twoDModel/src/engine/items/wallItem.cpp" line="68"/>
588+
<location filename="../../../../../plugins/robots/common/twoDModel/src/engine/items/wallItem.cpp" line="69"/>
589589
<source>Wall (W)</source>
590590
<translation>Tường (W)</translation>
591591
</message>

0 commit comments

Comments
 (0)