Beispiel #1
0
    void Update()
    {
        frameStartTime = Time.realtimeSinceStartup;

        if (centerManager.UpdateLastCenter())
        {
            Vector3 secondLastCenter = centerManager.GetSecondLastCenter();
            Vector3 lastCenter       = centerManager.GetLastCenter();

            centerMark.transform.position = lastCenter;
            //world.UpdateModel(lastCenter);

            FrameDebugOut("MainWorld Update", "start  lastCenter=" + lastCenter + "  secondLastCenter=" + secondLastCenter);

            world.UpdateWorldModel(lastCenter, secondLastCenter);

            FrameDebugOut("MainWorld Update", "after model update");

            //StartCoroutine(world.UpdateWorldModel());
            worldRenderer.UpdateView();

            FrameDebugOut("MainWorld Update", "after view update");

            world.moveChunks.Clear();

            /*
             * algorithm
             *
             *
             * move the last center
             *
             * check all model chunks
             *   if isinworld radius + 1
             *     mark as keep
             *   else
             *     mark as clear
             *     add to clear model list
             *
             * iterate clear model list
             *   save position of chunk
             *   flip position across last center
             *   create new model chunk
             *   add model chunk
             */



            /*
             * check all view chunks
             *   if isinworld radius
             *     mark as keep
             *   else
             *     mark as clear
             *     add to clear view list
             *
             * iterate clear view list
             *   save position of chunk
             *   flip position across last center
             *   create new view chunk
             *   add view chunk
             */
        }
    }