コード例 #1
0
    void OnVRPNButtonEvent(VRPNButtonController.VRPNButtonReport report)
    {
        if (report.button == 1 && report.state == 1)
        {
            moveWorkspace = true;

            currentClutchingPos.x = trackerPos.x;
            currentClutchingPos.y = trackerPos.y;
            currentClutchingPos.z = trackerPos.z;

            currentScaleFactor = trackerQuat.z;
            currentScale       = xCoef;
            return;
        }
        moveWorkspace = false;
    }
コード例 #2
0
 /// <summary>
 /// Button event handler
 /// </summary>
 /// <param name="buttonNumber">Button number.</param>
 /// <param name="buttonState">Button state (1 for pressed, 0 for released).</param>
 void OnVRPNButtonEvent(VRPNButtonController.VRPNButtonReport report)
 {
     if (report.button == 0 && report.state == 1)
     {
         lastPressedTime = System.DateTime.Now;
         checkTime       = true;
     }
     if (report.button == 0 && report.state == 0)
     {
         double diffSecs = System.DateTime.Now.Subtract(lastPressedTime).TotalSeconds;
         if (diffSecs < 1.0f)
         {
             selectCurrentAtom = true;
         }
         checkTime  = false;
         applyForce = false;
     }
 }