Esempio n. 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);
        }
Esempio n. 2
0
        /*
         * Particle related
         */

        public static void MakeParticleMarker(
            MarkerManager marker, Particle p,
            List <SpringConstraint> springs, List <AngleConstraint> angles, List <PinConstraint> pins
            )
        {
            marker.MakeParticleMarker(p);
            for (var i = 0; i < springs.Count; ++i)
            {
                marker.MakeSpringMarker(springs[i]);
            }
            for (var i = 0; i < angles.Count; ++i)
            {
                marker.MakeAngleMarker(angles[i]);
            }
            for (var i = 0; i < pins.Count; ++i)
            {
                marker.MakePinMarker(pins[i]);
            }
        }
Esempio n. 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);
        }