Пример #1
0
 public static void GetLaneInfo(int openDriveIndex, float lookAheadDistance, ref RoadLaneInfoUnityCoordinates laneInfo, int lookAheadMode)
 {
     RoadManagerLibraryCS.GetLaneInfo(openDriveIndex, lookAheadDistance, ref tmpLaneInfo, lookAheadMode);
     laneInfo.position   = GetUnityPosition(tmpLaneInfo.pos[0], tmpLaneInfo.pos[1], tmpLaneInfo.pos[2]);
     laneInfo.rotation   = GetUnityRotation(tmpLaneInfo.heading, tmpLaneInfo.pitch, tmpLaneInfo.roll);
     laneInfo.curvature  = tmpLaneInfo.curvature;
     laneInfo.speedLimit = tmpLaneInfo.speed_limit;
     laneInfo.width      = tmpLaneInfo.width;
 }
Пример #2
0
        //public static void GetLaneInfo(int openDriveIndex, float lookAheadDistance, ref RoadLaneInfoUnityCoordinates laneInfo)
        //{
        //    GetLaneInfo(openDriveIndex, lookAheadDistance, ref laneInfo, 0);
        //}
        //public static void GetLaneInfo(int openDriveIndex, float lookAheadDistance, ref RoadLaneInfoUnityCoordinates laneInfo, int laneId)
        //{
        //    RoadManagerLibraryCS.GetLaneInfo(openDriveIndex, lookAheadDistance, ref tmpLaneInfo);
        //    laneInfo.position = GetUnityPosition(tmpLaneInfo.pos[0], tmpLaneInfo.pos[1], tmpLaneInfo.pos[2]);
        //    laneInfo.rotation = GetUnityRotation(tmpLaneInfo.heading, tmpLaneInfo.pitch, tmpLaneInfo.roll);
        //    if (laneId >= 0)
        //        laneInfo.curvature = tmpLaneInfo.curvature;
        //    else
        //        laneInfo.curvature = -tmpLaneInfo.curvature;
        //    laneInfo.speedLimit = tmpLaneInfo.speed_limit;
        //    laneInfo.width = tmpLaneInfo.width;
        //}

        public static void GetLaneInfo(int openDriveIndex, float lookAheadDistance, ref RoadLaneInfoUnityCoordinates laneInfo, LookAheadMode lookAheadMode = LookAheadMode.LaneCenter, int laneId = 0, bool inRoadDrivingDirection = false)
        {
            RoadManagerLibraryCS.GetLaneInfo(openDriveIndex, lookAheadDistance, ref tmpLaneInfo, (int)lookAheadMode, inRoadDrivingDirection);
            laneInfo.position = GetUnityPosition(tmpLaneInfo.pos[0], tmpLaneInfo.pos[1], tmpLaneInfo.pos[2]);
            laneInfo.rotation = GetUnityRotation(tmpLaneInfo.heading, tmpLaneInfo.pitch, tmpLaneInfo.roll);
            if (laneId >= 0)
            {
                laneInfo.curvature = tmpLaneInfo.curvature;
            }
            else
            {
                laneInfo.curvature = -tmpLaneInfo.curvature;
            }
            laneInfo.speedLimit = tmpLaneInfo.speed_limit;
            laneInfo.width      = tmpLaneInfo.width;
        }