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); }
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); }
/* * 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]); } }