Exemple #1
0
        protected virtual void RotateWrist(Quaternion processedWristImu)
        {
            if (Wrist == null)
            {
                return;
            }

            Quaternion yawOffset    = Quaternion.Euler(0, WristYaw, 0);
            Quaternion preRotation  = Quaternion.Euler(preRotWrist) * yawOffset;
            Quaternion postRotation = Quaternion.Euler(postRotWrist);

            Wrist.RotateWrist(preRotation * processedWristImu * postRotation);
        }
Exemple #2
0
        //private void Update()
        //{
        //    //if (Input.GetKeyDown(KeyCode.Space))
        //    //{
        //    //    rumbleTest();
        //    //}
        //}

        //void rumbleTest()
        //{
        //    float powerPercent = 1; // 0 ~ 1 (ex 0.5 = 50%)
        //    ushort durationMS = 1000;
        //    Manus.ManusSetVibration(HandDataManager.ManusSession, DeviceType, powerPercent, durationMS);
        //    Debug.Log("Rumble!!");
        //}

        protected virtual Wrist AddWristComponent()
        {
            if (_wristTransform == null)
            {
                Debug.LogError("Attempted to add a wrist component to the hand with laterality " + DeviceType + ", but the wrist transform for this hand is missing.");

                return(null);
            }

            Wrist newWrist = _wristTransform.gameObject.AddComponent <Wrist>();

            newWrist.DeviceType = DeviceType;
            newWrist.Hand       = this;

            return(newWrist);
        }