Beispiel #1
0
        public void UpdateStates()
        {
            ValidateFaces();
            CalculateLocalValues();

            if (NegativeX != null)
            {
                NegativeX.UpdateStates();
            }
            if (NegativeY != null)
            {
                NegativeY.UpdateStates();
            }
            if (NegativeZ != null)
            {
                NegativeZ.UpdateStates();
            }
            if (PositiveX != null)
            {
                PositiveX.UpdateStates();
            }
            if (PositiveY != null)
            {
                PositiveY.UpdateStates();
            }
            if (PositiveZ != null)
            {
                PositiveZ.UpdateStates();
            }
        }
Beispiel #2
0
        public void UpdateStates()
        {
            switch (State)
            {
            case StateType.Invalid:
            {
                UpdateInvalid();

                if (Split == true)
                {
                    UpdateInvalidChildren();
                }
            }
            break;

            case StateType.Visible:
            {
                var distance = GetDistance();

                // Split?
                if (distance < Terrain.LocalDistances[Depth])
                {
                    if (Split == false && CanSplit == true)
                    {
                        SplitNow();
                    }
                }
                // Unsplit?
                else
                {
                    if (Split == true && CanUnsplit == true)
                    {
                        UnsplitNow();
                    }
                }

                if (Split == true)
                {
                    ChildBL.UpdateStates();
                    ChildBR.UpdateStates();
                    ChildTL.UpdateStates();
                    ChildTR.UpdateStates();
                }
            }
            break;
            }
        }