예제 #1
0
        private void DrawIcon(double longitude, double latitude, VesselType vt, Color iconColor, MapIcons.OtherIcon icon = MapIcons.OtherIcon.None)
        {
            var position = new Rect((float)(longitudeToPixels(longitude, latitude) - iconPixelSize / 2),
                                    (float)(latitudeToPixels(longitude, latitude) - iconPixelSize / 2),
                                    iconPixelSize, iconPixelSize);

            Rect shadow = position;

            shadow.x += iconShadowShift.x;
            shadow.y += iconShadowShift.y;

            iconMaterial.color = iconColorShadowValue;
            Graphics.DrawTexture(shadow, MapView.OrbitIconsMap, MapIcons.VesselTypeIcon(vt, icon), 0, 0, 0, 0, iconMaterial);

            iconMaterial.color = iconColor;
            Graphics.DrawTexture(position, MapView.OrbitIconsMap, MapIcons.VesselTypeIcon(vt, icon), 0, 0, 0, 0, iconMaterial);
        }
예제 #2
0
        private void DrawOrbitIcon(Vessel thatVessel, MapIcons.OtherIcon iconType, Color iconColor, double givenPoint = 0)
        {
            double timePoint = start;
            switch (iconType) {
                case MapIcons.OtherIcon.AP:
                    timePoint += thatVessel.orbit.timeToAp;
                    break;
                case MapIcons.OtherIcon.PE:
                    timePoint += thatVessel.orbit.timeToPe;
                    break;
                case MapIcons.OtherIcon.AN:
                case MapIcons.OtherIcon.DN:
                case MapIcons.OtherIcon.NODE:
                    timePoint = givenPoint;
                    break;
            }

            if (JUtil.OrbitMakesSense(thatVessel)) {
                bool collision;
                Vector2d coord;
                if (GetPositionAtT(thatVessel, thatVessel.orbit, start, timePoint, out coord, out collision) && !collision) {
                    DrawIcon(coord.x, coord.y, thatVessel.vesselType, iconColor, iconType);
                }
            }
        }
예제 #3
0
        private void DrawIcon(double longitude, double latitude, VesselType vt, Color iconColor, MapIcons.OtherIcon icon = MapIcons.OtherIcon.None)
        {
            var position = new Rect((float)(longitudeToPixels(longitude, latitude) - iconPixelSize / 2),
                               (float)(latitudeToPixels(longitude, latitude) - iconPixelSize / 2),
                               iconPixelSize, iconPixelSize);

            Rect shadow = position;
            shadow.x += iconShadowShift.x;
            shadow.y += iconShadowShift.y;

            iconMaterial.color = iconColorShadowValue;
            Graphics.DrawTexture(shadow, MapView.OrbitIconsMap, MapIcons.VesselTypeIcon(vt, icon), 0, 0, 0, 0, iconMaterial);

            iconMaterial.color = iconColor;
            Graphics.DrawTexture(position, MapView.OrbitIconsMap, MapIcons.VesselTypeIcon(vt, icon), 0, 0, 0, 0, iconMaterial);
        }