protected void UpdateGridChannelCount(int numChannels) { var shape = GridShape; shape.NumChannels = numChannels; GridShape = shape; }
/// <summary> /// Calculates rotations for drawing the Scene GUI wireframe. /// </summary> /// <param name="cellArc">Grid cell arc angle</param> /// <param name="lonLatRect">Lon/Lat rectangle</param> /// <param name="shape">Grid shape</param> /// <param name="rotations">Rotations [lon, lat]</param> public static void CalcGridRotations(float cellArc, Rect lonLatRect, GridBuffer.Shape shape, ref Quaternion[,] rotations) { int nLon = shape.Width + 1; int nLat = shape.Height + 1; if (rotations == null || rotations.Length != nLon * nLat) { rotations = new Quaternion[nLon, nLat]; float x = lonLatRect.min.x; float y = lonLatRect.min.y; for (int iLat = 0; iLat < nLat; iLat++) { var qLat = Quaternion.AngleAxis(y + iLat * cellArc, Vector3.left); for (int iLon = 0; iLon < nLon; iLon++) { var qLon = Quaternion.AngleAxis(x + iLon * cellArc, Vector3.up); rotations[iLon, iLat] = qLon * qLat; } } } }
protected void UpdateGridSize(int width, int height) { var shape = GridShape; shape.Width = width; shape.Height = height; GridShape = shape; }