Esempio n. 1
0
        void FixedUpdate()
        {
            {
                m_deltaTime += Time.fixedDeltaTime;
                m_CurrPos    = transform.position;

                Vector3 _forward = transform.forward;
                Vector3 _right   = transform.right;
                Vector3 vec3     = new Vector3(_forward.x, 0, _forward.z);
                Vector3 vec4     = new Vector3(_right.x, 0, _right.z);

                float deg1 = ContAngle(_forward, vec3);
                if (_forward.y > 0)
                {
                    deg1 *= -1.0f;
                }

                float deg2 = ContAngle(_right, vec4);
                if (_right.y < 0)
                {
                    deg2 *= -1.0f;
                }

                Vector3 _rot = new Vector3(deg1, 0, deg2);
                LiMoRecv.KiWi_MotionData_Set((m_startTime + m_deltaTime), _rot.x, _rot.y, _rot.z, m_CurrPos.x, m_CurrPos.y, m_CurrPos.z, _forward.x, _forward.y, _forward.z);
            }
        }
Esempio n. 2
0
        // Use this for initialization
        void Start()
        {
            //KiWi_MotionData_Config(5.0f, 20.0f, 30.0f, 60.0f, 60.0f, 60.0f, 500, 5);
            LiMoRecv.KiWi_MotionData_Config(ActuratorMaxSpeed, ActuratorSmooth);
            LiMoRecv.KiWi_MotionData_MaxValue(MaxMove_surge, MaxMove_sway, MaxMove_heave, MaxRot_roll, MaxRot_pitch, MaxRot_yaw);

            LiMoRecv.StartMotion();
        }
Esempio n. 3
0
 public static void SendVibEffect(int id, int weight)
 {
     if (mLastVibStrength[id] != weight)
     {
         mLastVibStrength[id] = weight;
         LiMoRecv.SendCommand2DLL(LiMoConstant.kEvent_CMD_VibratorNormal, (int)LiMoConstant.ChairVibratorNormal.cEvent_Param_VibratorPlay, id, weight);
     }
 }
Esempio n. 4
0
        void Update()
        {
            LeftArmX   = LiMoRecv.KiWi_GetLeftArmX();
            LeftArmY   = LiMoRecv.KiWi_GetLeftArmY();
            LeftSlider = LiMoRecv.KiWi_GetLeftSlider();

            RightArmX   = LiMoRecv.KiWi_GetRightArmX();
            RightArmY   = LiMoRecv.KiWi_GetRightArmY();
            RightSlider = LiMoRecv.KiWi_GetRightSlider();

            Foot1 = LiMoRecv.KiWi_GetFoot1();
            Foot2 = LiMoRecv.KiWi_GetFoot2();
            Foot3 = LiMoRecv.KiWi_GetFoot3();

            SetLeftTrigger();
            SetLeftAction();
            SetRightTrigger();
            SetRightAction();
        }
Esempio n. 5
0
        void SetLeftAction()
        {
            int Tvalue = LiMoRecv.KiWi_GetLeftAction();

            LeftActionDown = false;
            LeftActionUp   = false;
            if (Tvalue == 0)
            {
                if (LeftAction)
                {
                    LeftActionUp = true;
                }
                LeftAction = false;
            }
            else
            {
                if (!LeftAction)
                {
                    LeftActionDown = true;
                }
                LeftAction = true;
            }
        }
Esempio n. 6
0
        void SetLeftTrigger()
        {
            int Tvalue = LiMoRecv.KiWi_GetLeftTrigger();

            LeftTriggerDown = false;
            LeftTriggerUp   = false;
            if (Tvalue == 0)
            {
                if (LeftTrigger)
                {
                    LeftTriggerUp = true;
                }
                LeftTrigger = false;
            }
            else
            {
                if (!LeftTrigger)
                {
                    LeftTriggerDown = true;
                }
                LeftTrigger = true;
            }
        }
Esempio n. 7
0
        void SetRightAction()
        {
            int Tvalue = LiMoRecv.KiWi_GetRightAction();

            RightActionDown = false;
            RightActionUp   = false;
            if (Tvalue == 0)
            {
                if (RightAction)
                {
                    RightActionUp = true;
                }
                RightAction = false;
            }
            else
            {
                if (!RightAction)
                {
                    RightActionDown = true;
                }
                RightAction = true;
            }
        }
Esempio n. 8
0
        void SetRightTrigger()
        {
            int Tvalue = LiMoRecv.KiWi_GetRightTrigger();

            RightTriggerDown = false;
            RightTriggerUp   = false;
            if (Tvalue == 0)
            {
                if (RightTrigger)
                {
                    RightTriggerUp = true;
                }
                RightTrigger = false;
            }
            else
            {
                if (!RightTrigger)
                {
                    RightTriggerDown = true;
                }
                RightTrigger = true;
            }
        }
Esempio n. 9
0
 void OnApplicationQuit()
 {
     LiMoRecv.StopArm();
 }
Esempio n. 10
0
 // Use this for initialization
 void Start()
 {
     //KiWi_MotionData_Config(5.0f, 20.0f, 30.0f, 60.0f, 60.0f, 60.0f, 500, 5);
     LiMoRecv.StartArm();
 }
Esempio n. 11
0
 void OnApplicationQuit()
 {
     LiMoRecv.StopMotion();
 }
Esempio n. 12
0
 public static void SendVibEffectAllChair(int weight, int Duration)
 {
     LiMoRecv.SendCommand2DLL(LiMoConstant.kEvent_CMD_VibratorNormal, (int)LiMoConstant.ChairVibratorNormal.cEvent_Param_VibratorPlay, (int)LiMoConstant.ChairVibratorID.c_VIBID_Chair_ALL, weight, Duration);
 }
Esempio n. 13
0
 public static void SendVibEffect(int id, int weight, int Duration)
 {
     LiMoRecv.SendCommand2DLL(LiMoConstant.kEvent_CMD_VibratorNormal, (int)LiMoConstant.ChairVibratorNormal.cEvent_Param_VibratorPlay, id, weight, Duration);
 }
Esempio n. 14
0
 public static void StopMotion()
 {
     LiMoRecv.SendCommand2DLL(LiMoConstant.kEvent_CMD_Motion, LiMoConstant.KEvent_Param1_Stop);
 }
Esempio n. 15
0
 public static void StopArm()
 {
     LiMoRecv.SendCommand2DLL(LiMoConstant.kEvent_CMD_ARM, LiMoConstant.KEvent_Param1_Stop);
 }