// Because all of these tests were written assuming open drive coordinates, but our geometry is in
        // Unity coordinates, rather than re-write all the test cases, we just convert from OpenDRIVE to Unity here
        static Geometry ConstructGeometryFromOpenDriveCoordinates(
            GeometryKind geometryKind, float headingDegrees, float length, float sAbsolute, float x, float z,
            ArcData arcData     = default, SpiralData spiralData         = default,
            Poly3Data poly3Data = default, ParamPoly3Data paramPoly3Data = default)
        {
            var pose = OpenDriveMapElementFactory.FromOpenDriveGlobalToUnity(math.radians(headingDegrees), x, z);

            return(ConstructGeometry(geometryKind, pose, length, sAbsolute,
                                     arcData, spiralData, poly3Data, paramPoly3Data));
        }
 static Geometry ConstructGeometry(
     GeometryKind geometryKind, RigidTransform pose, float length, float sAbsolute,
     ArcData arcData     = default, SpiralData spiralData         = default,
     Poly3Data poly3Data = default, ParamPoly3Data paramPoly3Data = default)
 {
     return(new Geometry()
     {
         length = length,
         sRoad = sAbsolute,
         startPose = pose,
         geometryKind = geometryKind,
         arcData = arcData,
         spiralData = spiralData,
         poly3Data = poly3Data,
         paramPoly3Data = paramPoly3Data
     });
 }
예제 #3
0
        // Because all of these tests were written assuming open drive coordinates, but our geometry is in
        // Unity coordinates, rather than re-write all the test cases, we just convert from OpenDRIVE to Unity here
        static Geometry ConstructGeometryFromOpenDriveCoordinates(
            float headingDegrees, float length, float sAbsolute, float x, float z,
            GeometryKind geometryKind, ArcData arcData = default, SpiralData spiralData = default,
            Poly3Data poly3Data = default, ParamPoly3Data paramPoly3Data = default)
        {
            var pose = OpenDriveMapElementFactory.FromOpenDriveGlobalToUnity(math.radians(headingDegrees), x, z);

            return(new Geometry()
            {
                length = length,
                sRoad = sAbsolute,
                startPose = pose,
                geometryKind = geometryKind,
                arcData = arcData,
                spiralData = spiralData,
                poly3Data = poly3Data,
                paramPoly3Data = paramPoly3Data
            });
        }