Exemplo n.º 1
0
        private static void CreateCells(Parachute p)
        {
            // Layout n number of cells from left to right around the top section of an ellipse
            // Todo: current algorithm does not preserve planform area as it warps the wing around the ellipse
            // Todo: GUI planform area should report post-warp area, including tapering and such

            var config   = p.Config;
            var centroid = ParachuteMaths.GetCanopyCentroid(config);

            // Todo: model induced drag based on aspect ratio and shape tapering
            float aspectRatio = ParachuteMaths.GetAspectRatio(p.Config);

            for (int i = 0; i < config.NumCells; i++)
            {
                float areaMultiplier = 1f;//config.PlanformAreaEllipse.Evaluate(i/(float) (config.NumCells - 1));

                var cell = CreateCell(p, areaMultiplier, aspectRatio);
                var t    = ParachuteMaths.GetCellTransform(config, centroid, i);
                LayoutCell(cell, t);
                cell.name = "Cell_" + i;
                p.Sections.Add(new Section()
                {
                    Cell = cell
                });
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Takes an existing parachute system and resets it to factory state
        /// </summary>
        /// <param name="p"></param>
        public static void LayoutCells(Parachute p)
        {
            var config   = p.Config;
            var centroid = ParachuteMaths.GetCanopyCentroid(config);

            for (int i = 0; i < config.NumCells; i++)
            {
                var cell = p.Sections[i].Cell;
                var t    = ParachuteMaths.GetCellTransform(config, centroid, i);
                LayoutCell(cell, t);
            }
        }