|
@@ -778,21 +778,18 @@ export default class ListenLayer {
|
|
Constant.minAdsorbPix
|
|
Constant.minAdsorbPix
|
|
);
|
|
);
|
|
|
|
|
|
|
|
+ let line1 = mathUtil.createLine1(
|
|
|
|
+ joinInfo.position,
|
|
|
|
+ leftJoinInfo.position
|
|
|
|
+ );
|
|
|
|
+ let position1 = mathUtil.getJoinLinePoint(position, line1);
|
|
if (
|
|
if (
|
|
- mathUtil.getDistance(position, leftJoinInfo.position) >
|
|
|
|
- mathUtil.getDistance(position, rightJoinInfo.position)
|
|
|
|
|
|
+ mathUtil.isContainForSegment(
|
|
|
|
+ position1,
|
|
|
|
+ joinInfo.position,
|
|
|
|
+ leftJoinInfo.position
|
|
|
|
+ )
|
|
) {
|
|
) {
|
|
- if (joinInfo.distance < curveRoad.rightWidth) {
|
|
|
|
- curveRoadInfo = {
|
|
|
|
- curveRoadId: curveRoadId,
|
|
|
|
- type: VectorType.CurveRoad,
|
|
|
|
- distance: joinInfo.distance,
|
|
|
|
- x: joinInfo.position.x,
|
|
|
|
- y: joinInfo.position.y,
|
|
|
|
- };
|
|
|
|
- }
|
|
|
|
- curveRoadInfo.dir = "right";
|
|
|
|
- } else {
|
|
|
|
if (joinInfo.distance < curveRoad.leftWidth) {
|
|
if (joinInfo.distance < curveRoad.leftWidth) {
|
|
curveRoadInfo = {
|
|
curveRoadInfo = {
|
|
curveRoadId: curveRoadId,
|
|
curveRoadId: curveRoadId,
|
|
@@ -803,8 +800,44 @@ export default class ListenLayer {
|
|
};
|
|
};
|
|
}
|
|
}
|
|
curveRoadInfo.dir = "left";
|
|
curveRoadInfo.dir = "left";
|
|
|
|
+ } else {
|
|
|
|
+ curveRoadInfo = {
|
|
|
|
+ curveRoadId: curveRoadId,
|
|
|
|
+ type: VectorType.CurveRoad,
|
|
|
|
+ distance: joinInfo.distance,
|
|
|
|
+ x: joinInfo.position.x,
|
|
|
|
+ y: joinInfo.position.y,
|
|
|
|
+ };
|
|
|
|
+ curveRoadInfo.dir = "right";
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ // if (
|
|
|
|
+ // mathUtil.getDistance(position, leftJoinInfo.position) >
|
|
|
|
+ // mathUtil.getDistance(position, rightJoinInfo.position)
|
|
|
|
+ // ) {
|
|
|
|
+ // if (joinInfo.distance < curveRoad.rightWidth) {
|
|
|
|
+ // curveRoadInfo = {
|
|
|
|
+ // curveRoadId: curveRoadId,
|
|
|
|
+ // type: VectorType.CurveRoad,
|
|
|
|
+ // distance: joinInfo.distance,
|
|
|
|
+ // x: joinInfo.position.x,
|
|
|
|
+ // y: joinInfo.position.y,
|
|
|
|
+ // };
|
|
|
|
+ // }
|
|
|
|
+ // curveRoadInfo.dir = "right";
|
|
|
|
+ // } else {
|
|
|
|
+ // if (joinInfo.distance < curveRoad.leftWidth) {
|
|
|
|
+ // curveRoadInfo = {
|
|
|
|
+ // curveRoadId: curveRoadId,
|
|
|
|
+ // type: VectorType.CurveRoad,
|
|
|
|
+ // distance: joinInfo.distance,
|
|
|
|
+ // x: joinInfo.position.x,
|
|
|
|
+ // y: joinInfo.position.y,
|
|
|
|
+ // };
|
|
|
|
+ // }
|
|
|
|
+ // curveRoadInfo.dir = "left";
|
|
|
|
+ // }
|
|
|
|
+
|
|
if (leftJoinInfo.distance < Constant.minAdsorbPix) {
|
|
if (leftJoinInfo.distance < Constant.minAdsorbPix) {
|
|
const index = mathUtil.getCurvesIndexForCurvesPoints(
|
|
const index = mathUtil.getCurvesIndexForCurvesPoints(
|
|
leftJoinInfo.position,
|
|
leftJoinInfo.position,
|