CurveRoad.js 814 B

12345678910111213141516171819202122
  1. import VectorType from "../enum/VectorType.js";
  2. import Geometry from "./Geometry.js";
  3. import Road from "./Road.js";
  4. import Constant from "../Constant";
  5. export default class CurveRoad extends Road {
  6. constructor(startId, endId, vectorId) {
  7. super(startId, endId, vectorId);
  8. this.startId = startId;
  9. this.endId = endId;
  10. this.points = []; //中心线上一系列控制点。数组是从start到end。
  11. this.leftEdgeId = null;
  12. this.rightEdgeId = null;
  13. this.leftLanes = []; //二维数组。第一维表示第几个车道,第二维是一组点
  14. this.rightLanes = [];
  15. this.width = Constant.defaultRoadWidth; //默认宽度
  16. this.leftDrivewayCount = 2; //左边的车道个数
  17. this.rightDrivewayCount = 2; //右边的车道个数
  18. this.geoType = VectorType.CurveRoad;
  19. }
  20. }