Пример #1
0
        public void Undo()
        {
            var current = _sim.uidDistributer.current;

            _s = _sim.MakeSpringByUID(_aUID, _bUID, _stiffness);
            _s.OverrideUID(_uid);

            _sim.uidDistributer.SetCounter(current);

            _marker.MakeSpringMarker(_s);
        }
Пример #2
0
        /*
         * Methods
         */

        public override SimElement MakeSimElement(AlignedEditableForm aef, List <SimElement> simElements)
        {
            var a = simElements[aef.uid2idxDic[_aUID]] as Particle;
            var b = simElements[aef.uid2idxDic[_bUID]] as Particle;

            var sc = new SpringConstraint(a, b, _stiffness);

            sc.OverrideUID(uid);

            return(sc);
        }
Пример #3
0
        public bool Do()
        {
            if (_uid == -1)
            {
                _s   = _sim.MakeSpringByUID(_aUID, _bUID, _stiffness);
                _uid = _s.uid;
            }
            else
            {
                var current = _sim.uidDistributer.current;

                _s = _sim.MakeSpringByUID(_aUID, _bUID, _stiffness);
                _s.OverrideUID(_uid);

                _sim.uidDistributer.SetCounter(current);
            }
            _marker.MakeSpringMarker(_s);
            return(true);
        }