Example #1
0
        /// <summary>
        ///
        /// </summary>
        void Start()
        {
            _graph       = CreateGrid(_countX, _countY);
            _vertexState = new int[_graph.Vertices.Count];

            _currVertex  = _graph.Vertices[0];
            _currHedge   = _currVertex.First;
            _initialized = true;
        }
Example #2
0
        // Use this for initialization
        void Start()
        {
            // create a graph
            _graph = CreateGrid(_countX, _countY);

            // create array of vertex states
            _vertexStates = new int[_graph.Vertices.Count];

            // set current vertex & halfedge
            _currVertex = _graph.Vertices[0];
            _currHedge  = _currVertex.First;

            _initialized = true;
        }
Example #3
0
        /// <summary>
        ///
        /// </summary>
        void Update()
        {
            if (Input.GetKeyDown(KeyCode.LeftArrow))
            {
                _currHedge = _currHedge.PreviousAtStart;
            }

            if (Input.GetKeyDown(KeyCode.RightArrow))
            {
                _currHedge = _currHedge.NextAtStart;
            }

            if (Input.GetKeyDown(KeyCode.UpArrow))
            {
                _currHedge  = _currHedge.Twin;
                _currVertex = _currHedge.Start;
            }

            UpdateNeighborhood();
        }
Example #4
0
        // Update is called once per frame
        void Update()
        {
            if (Input.GetKeyDown(KeyCode.LeftArrow))
            {
                _currHedge = _currHedge.PreviousAtStart;
            }

            if (Input.GetKeyDown(KeyCode.RightArrow))
            {
                _currHedge = _currHedge.NextAtStart;
            }

            if (Input.GetKeyDown(KeyCode.UpArrow))
            {
                _currHedge  = _currHedge.Twin;
                _currVertex = _currHedge.Start;
            }

            UpdateVertexStates();

            var target = (Vector3)_currVertex.Position;

            CameraPivot.position = Vector3.Lerp(CameraPivot.position, target, Time.deltaTime * _cameraStiffness);
        }