Beispiel #1
0
        // iterate
        public void iterate(string levelUid, int count)
        {
            // Clear marker competition and shadow values
            foreach (Dictionary <int, MarkerCell> gridRow in _treeSystem.markerGrid[levelUid].Values)
            {
                foreach (MarkerCell gridCell in gridRow.Values)
                {
                    gridCell.clearMarkerCompetition();
                    gridCell.shadowValue = 0;
                }
            }

            for (int i = 0; i < count; i++)
            {
                // Calculate local environment of buds
                _rootMetamer.calculateLocalEnvironment();

                // Determine bud fate
                _rootMetamer.determineBudFate();

                // Append new shoots
                _rootMetamer.appendNewShoots();

                // Update branch width
                _rootMetamer.calculateResources(1);

                // Create constraints
                _rootMetamer.createConstraints();

                _iterations++;
            }

            // Force aabb update
            _rootMetamer.updateAABB();
        }