示例#1
0
        void ICommand.Undo()
        {
            var current = _sim.uidDistributer.current;

            _a = _sim.MakeAngleByUID(_aUID, _bUID, _mUID, _stiffness);
            _a.OverrideUID(_uid);

            _sim.uidDistributer.SetCounter(current);

            _marker.MakeAngleMarker(_a);
        }
示例#2
0
        bool ICommand.Do()
        {
            if (_uid == -1)
            {
                Debug.Log(_aUID + " -> " + _bUID + " + " + _mUID);
                _a   = _sim.MakeAngleByUID(_aUID, _bUID, _mUID, _stiffness);
                _uid = _a.uid;
            }
            else
            {
                var current = _sim.uidDistributer.current;

                _a = _sim.MakeAngleByUID(_aUID, _bUID, _mUID, _stiffness);
                _a.OverrideUID(_uid);

                _sim.uidDistributer.SetCounter(current);

                _marker.MakeAngleMarker(_a);
            }

            _marker.MakeAngleMarker(_a);
            return(true);
        }
示例#3
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]);
            }
        }