示例#1
0
    /// <summary>
    /// Method to move the Time Slice based on the onGraspStay event of Leap Motion Interaction.
    /// </summary>
    private void vrlmGraspStayTimeSlice()
    {
        // get grasp point
        Vector3 currentGraspPoint = ibTimeSliceGO.GetGraspPoint(ibTimeSliceGO.graspingController);

        // helper valid to determine validity of "new" selected time index
        int updatedTimeIndex = 0;

        // calculate distance in order to handle "snapping" of the Time Slice to the individual indices of the 3D Radar Chart's FrequencyPolygons
        float distance = currentGraspPoint.y - helper_timeSlice_lastYUpdate;

        if (Mathf.Abs(distance) > tdrcInterface.cnfg3d_scale)     // distance of "snapping" based on the overall 3D Radar Chart's scale
        {
            // update latest y-position
            helper_timeSlice_lastYUpdate = currentGraspPoint.y;

            // determine direction of position update
            if (distance > 0.0f)
            {
                updatedTimeIndex = tdrcInterface.stt_selectedTimeIndex + 1;
            }
            else if (distance < 0.0f)
            {
                updatedTimeIndex = tdrcInterface.stt_selectedTimeIndex - 1;
            }

            // try to conduct time index update
            tdrcInterface.tryTimeSliceUpdateForIndex(updatedTimeIndex);
        }
    }
 private Vector3 GetObjectSpaceGrabPoint(InteractionHand hand)
 {
     return(this.transform.InverseTransformVector(_intObj.GetGraspPoint(hand) - this.transform.position));
 }