/// マウスボタンを押したときに実行するハンドラ protected virtual void form_OnMouseDown(object sender, MouseEventArgs e) { switch (e.Button) { case MouseButtons.Left: { //おっぱいを触っているか判定する bool touched = false; //注視点 on screen float x = (float)(viewport.Width / 2); float y = (float)(viewport.Height / 2); Figure fig; if (figures.TryGetFigure(out fig)) { // todo: figures.TryGetFigure again touched = touched || FindBoneOnScreenPoint(x, y, fig.Tmo.nodemap[TMONodePath.Chichi_Right3]); touched = touched || FindBoneOnScreenPoint(x, y, fig.Tmo.nodemap[TMONodePath.Chichi_Left3]); } if (touched) { fig.ResetSpring(); } } break; } }
/// マウスボタンを押したときに実行するハンドラ protected virtual void form_OnMouseDown(object sender, MouseEventArgs e) { switch (e.Button) { case MouseButtons.Left: if (Control.ModifierKeys == Keys.Control) { figures.SetLightDirection(ScreenToOrientation(e.X, e.Y)); } else { //おっぱいを触っているか判定する bool touched = false; //注視点 on screen float x = (float)(viewport.Width / 2); float y = (float)(viewport.Height / 2); Figure fig; if (figures.TryGetFigure(out fig)) { // todo: figures.TryGetFigure again touched = touched || FindBoneOnScreenPoint(x, y, fig.Tmo.nodemap[TMONodePath.Chichi_Right3]); touched = touched || FindBoneOnScreenPoint(x, y, fig.Tmo.nodemap[TMONodePath.Chichi_Left3]); } if (touched) { fig.ResetSpring(); } } break; } lastScreenPoint.X = e.X; lastScreenPoint.Y = e.Y; }