private void SetMousePos(MouseEvent e)
        {
            ClientRect r = renderer.domElement.GetBoundingClientRect();

            // calculate mouse position in normalized device coordinates
            // (-1 to +1) for both components
            mouse.x = ((double)(e.ClientX-r.Left) / (double)Width) * 2 - 1;
            mouse.y = -  ((double)(e.ClientY-r.Top) / (double)Height)*2  +1;
        }
示例#2
0
 private void OnClick_UseSecureWebSocket(MouseEvent<InputElement> e)
 {
     if (OnViewUseSecureWebSocketChanged != null)
     {
         OnViewUseSecureWebSocketChanged(this, new EventArgs());
     }
 }
示例#3
0
 private void OnClick_DisconnectButton(MouseEvent<ButtonElement> e)
 {
     if (OnViewDisconnecting != null)
     {
         OnViewDisconnecting(this, new EventArgs());
     }
 }
示例#4
0
 private void OnClick_SendButton(MouseEvent<ButtonElement> e)
 {
     if (OnViewSending != null)
     {
         OnViewSending(this, new EventArgs());
     }
 }
示例#5
0
 private void OnClick_ClearLogButton(MouseEvent<ButtonElement> e)
 {
     if (OnViewLogClearing != null)
     {
         OnViewLogClearing(this, new EventArgs());
     }
 }