public void UpdateSelected(ref List <IData3DCollection> _datasets, ISystem selectedsystem, GalacticMapObject selectedgmo, float widthly, float heightly, Vector3 rotation) { if (_datasets == null) { return; } foreach (IData3DCollection dataset in _datasets) { if (dataset is TexturedQuadDataCollection) { TexturedQuadDataCollection tqdc = dataset as TexturedQuadDataCollection; foreach (TexturedQuadData tqd in tqdc.Primatives) { int id = (int)tqd.Tag; if (id == 0) { tqd.UpdateVertices(new PointData(selectedsystem.X, selectedsystem.Y, selectedsystem.Z), rotation, widthly, heightly / 2, 0, heightly / 4 + heightly / 16); } else if (selectedgmo.Points.Count > 0) { long gmotarget = TargetClass.GetTargetGMO(); float hoff = (gmotarget == selectedgmo.ID) ? (heightly * gmoseltarget) : (heightly * gmoselonly); tqd.UpdateVertices(selectedgmo.Points[0].Convert(), rotation, widthly, heightly / 2, 0, hoff); } } } } }
public void UpdateBookmarks(ref List <IData3DCollection> _datasets, float widthly, float heightly, Vector3 rotation) { if (_datasets == null) { return; } foreach (IData3DCollection dataset in _datasets) { TexturedQuadDataCollection tqdc = dataset as TexturedQuadDataCollection; foreach (TexturedQuadData tqd in tqdc.Primatives) { PointData pd; if ((int)tqd.Tag2 == 1) { HistoryEntry vs = (HistoryEntry)tqd.Tag; pd = new PointData(vs.System.X, vs.System.Y, vs.System.Z); } else { BookmarkClass bc = (BookmarkClass)tqd.Tag; pd = new PointData(bc.x, bc.y, bc.z); } tqd.UpdateVertices(pd, rotation, widthly, heightly, 0, heightly / 2); } } }
public void UpdateGridCoordZoom(ref List <IData3DCollection> _datasets, float zoom) { IData3DCollection gridLOD2 = _datasets.SingleOrDefault(s => s.Name == "text bitmap LOD2"); if (gridLOD2 != null) { TexturedQuadDataCollection tqdc = gridLOD2 as TexturedQuadDataCollection; float LODfade = (float)Math.Max(Math.Min((0.2 / zoom - 1.0) / 2.0, 1.0), 0.0); Color calpha = Color.FromArgb((int)(255 * LODfade), Color.White); tqdc.SetColour(calpha); //Console.WriteLine("LOD {0} fade {1} Color {2}", tqdc.Name, LODfade, calpha); } }
public void UpdateGalObjects(ref List <IData3DCollection> _datasets, float widthly, float heightly, Vector3 rotation) { if (_datasets == null) { return; } foreach (IData3DCollection dataset in _datasets) { if (dataset is TexturedQuadDataCollection) { TexturedQuadDataCollection tqdc = dataset as TexturedQuadDataCollection; foreach (TexturedQuadData tqd in tqdc.Primatives) { GalacticMapObject gmo = tqd.Tag as GalacticMapObject; Debug.Assert(gmo != null); if (gmo.Points.Count > 0) // paranoia since its an external data source { int id = (int)tqd.Tag2; if (id == 0) { tqd.UpdateVertices(gmo.Points[0].Convert(), rotation, widthly, heightly); } else if (id == 1) { tqd.UpdateVertices(gmo.Points[0].Convert(), rotation, (widthly / 10 * gmo.Name.Length), (heightly / 3), 0, heightly * gmonameoff); } else { tqd.UpdateVertices(gmo.Points[0].Convert(), rotation, widthly, heightly, 0, heightly * gmotargetoff); } } } } } }