Ejemplo n.º 1
0
    public void FindLanding()
    {
        if (_camera != null)
        {
            //Vector3 key;
            foreach (var branchLine in TreeInfo.GetVisibleBranhes(_camera))
            {
                if (!_seenTrees.Contains(branchLine.branch.tree))
                {
                    _seenTrees.Add(branchLine.branch.tree);
                }

                /*
                 * Makes gameObjets... too slow...
                 * key=branchLine.startPt.bucket(minLandingSize);
                 * if (!DesiredLandings.ContainsKey(key))
                 * {
                 *  DesiredLandings.Add(key, new LandingSpot());
                 * }
                 * /**/
                if (!branchLine.hasSeen)
                {
                    branchLine.hasSeen = true;
                    if (branchLine.inclanation < _desiredInclination.x && branchLine.inclanation > _desiredInclination.y &&
                        branchLine.radius < _desiredRadius.x && branchLine.radius > _desiredRadius.y)
                    {
                        nLandingSpots++;
                        //_seenBranches.Add(branchLine);
                        float desirability = branchLine.length;
                        primeLanding.Add(new hotspot(desirability, branchLine.position),
                                         new Bounds(branchLine.position, branchLine.endPt - branchLine.startPt));
                        //new Bounds(branchLine.position, hotspot.GetBucketSize(minLandingSize, minMemoryDistance, oneMeterMemoryDistance, branchLine.position, _thisT.position) * Vector3.one));
                    }
                }
            }
        }
    }