using System; using System.Collections.Generic; using System.Text; using SalsaModel.Scheduling; namespace SalsaModel.Actions { class MoveHand : IAction { readonly PositionModel.Side _side; readonly SalsaMover _mover; readonly Location _relativeDest; Location _startPos; /// /// Sets up an action to move the specified hand, to a location /// relative to the point at the center of the hips, rotated /// according to the wall. /// /// which hand to move /// mover to animate /// destination position of hand, relative to the point at the /// center of the hips. The Y axis is forwards along the wall. public MoveHand(PositionModel.Side side, SalsaMover mover, Location to) { _side = side; _mover = mover; _relativeDest = to; } public void Start() { _startPos = _mover.Model.AbsToRelPos(_mover.Model.GetArm(_side).Wrist); } public void Update(double percent) { _mover.Model.GetArm(_side).Wrist = _mover.Model.RelToAbsPos(_startPos.FractionTo(_relativeDest, percent)); _mover.AlignElbow(_side, SalsaMover.ElbowStyle.Out); } public void End() { } public string DescriptiveCode { get { return "Hand"; } } } }