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); } }
// 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(); }
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); } }
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(); }
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; } }
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; } }
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; } }
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; } }
void OnApplicationQuit() { LiMoRecv.StopArm(); }
// 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(); }
void OnApplicationQuit() { LiMoRecv.StopMotion(); }
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); }
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); }
public static void StopMotion() { LiMoRecv.SendCommand2DLL(LiMoConstant.kEvent_CMD_Motion, LiMoConstant.KEvent_Param1_Stop); }
public static void StopArm() { LiMoRecv.SendCommand2DLL(LiMoConstant.kEvent_CMD_ARM, LiMoConstant.KEvent_Param1_Stop); }