void Start() { m_Pose = GetComponent <SteamVR_Behaviour_Pose>(); m_currentMacroHand = GetComponent <MacroHand>(); m_currentMicroHand = GetComponent <MicroHand>(); ChangeModeTypeHand(modeTypeHand); }
public void JoiningSubspace() { MacroHand hp = GetPrimaryHandPressedFromInner(); if (!hp) { return; } if (!hp.m_ContactInteractables[hp.m_currentIndexSelected]) { return; } Rigidbody targetBody = hp.m_ContactInteractables[hp.m_currentIndexSelected].GetComponent <Rigidbody>(); hp.m_Joint.connectedBody = targetBody; m_selectSubspaces++; if (m_consoleLeft) { m_consoleLeft.AddText("m_selectSubspaces: " + m_selectSubspaces); } }
void Start() { m_myHand = GetComponent <Hand>(); m_otherHand = m_myHand.GetOtherMacroHand(); if (interactions) { m_interactionsCoordinated = interactions.GetComponent <Interaction>(); } if (console) { m_console = console.GetComponent <Console>(); m_console.AddText("MACRO HAND NAME: " + transform.name); } GameObject consoleLeft = GameObject.Find("ConsoleLeft"); if (consoleLeft) { m_consoleLeft = consoleLeft.GetComponent <Console>(); } StartCoroutine(InitCoroutine()); }
private void StopJoiningSubspace() { MacroHand hp = GetPrimaryHandPressedFromInner(); if (!hp) { return; } if (m_currentIndexSelected < 0) { return; } if (!hp.m_ContactInteractables[m_currentIndexSelected]) { return; } Rigidbody targetBody = hp.m_ContactInteractables[m_currentIndexSelected].GetComponent <Rigidbody>(); targetBody.velocity = Vector3.zero; targetBody.angularVelocity = Vector3.zero; hp.m_Joint.connectedBody = null; }
public void EndTask() { if (training) { ResetValues(); if (m_trainNumber == 1) { Train_2(); } else if (m_trainNumber == 0) { Train_1(); } WaitScene(); return; } int task = Convert.ToInt32(m_textTaskId.GetComponent <InputField>().text); int version = Convert.ToInt32(m_textVersionId.GetComponent <InputField>().text); CSVFilename = "User-" + m_textUserId.GetComponent <InputField>().text + "-" + "Task-" + task + "-" + "Version-" + version + "-" + "Scenario-" + m_scenarioCase + "-" + "VR" + VR; PositionFilename = "Position_" + CSVFilename; CSVResults = m_textUserId.GetComponent <InputField>().text + "," + task + "," + version + "," + m_scenarioCase + "," + VR + "," + m_totalScenarioTime.ToString(new CultureInfo("en-US")); if (!VR) { CSVResults += "," + m_Player.GetComponent <MouseController>().m_clones + "," + m_Player.GetComponent <MouseController>().m_deletedAcepted + "," + m_Player.GetComponent <MouseController>().m_deletedCanceled + "," + m_Player.GetComponent <MouseController>().m_selectSubspaces + "," + m_Player.GetComponent <MouseController>().interaction.GetComponent <Interaction>().m_selectSingle + "," + m_Player.GetComponent <MouseController>().interaction.GetComponent <Interaction>().m_brushing + "," + m_Player.GetComponent <MouseController>().m_pickupTime.ToString(new CultureInfo("en-US")) + "," + m_Player.GetComponent <MouseController>().m_rotationTime.ToString(new CultureInfo("en-US")) + "," + m_Player.GetComponent <MouseController>().m_traslationTime.ToString(new CultureInfo("en-US")) + "," + m_Player.GetComponent <MouseController>().m_scaleTime.ToString(new CultureInfo("en-US")) + "," + m_Player.GetComponent <MouseController>().m_navSlaving.ToString(new CultureInfo("en-US")) + ", 0 , 0 , 0 , 0, 0" + "," + GetDataSelected(); Cursor.lockState = CursorLockMode.None; } else { MacroHand leftMacro = m_Player.GetComponent <MovementVR>().LeftHand.GetComponent <MacroHand>(); MacroHand rightMacro = m_Player.GetComponent <MovementVR>().RightHand.GetComponent <MacroHand>(); CSVResults += "," + leftMacro.m_clones + rightMacro.m_clones + "," + leftMacro.m_deletedAcepted + rightMacro.m_deletedAcepted + "," + leftMacro.m_deletedCanceled + rightMacro.m_deletedCanceled + "," + leftMacro.m_selectSubspaces + rightMacro.m_selectSubspaces + "," + m_Player.GetComponent <MovementVR>().Coordination.GetComponent <Interaction>().m_selectSingle + "," + m_Player.GetComponent <MovementVR>().Coordination.GetComponent <Interaction>().m_brushing + "," + leftMacro.m_pickupTime.ToString(new CultureInfo("en-US")) + "," + 0 + "," + 0 + "," + leftMacro.m_scaleTime.ToString(new CultureInfo("en-US")) + "," + leftMacro.m_navSlaving.ToString(new CultureInfo("en-US")) + "," + rightMacro.m_pickupTime.ToString(new CultureInfo("en-US")) + "," + 0 + "," + 0 + "," + rightMacro.m_scaleTime.ToString(new CultureInfo("en-US")) + "," + rightMacro.m_navSlaving.ToString(new CultureInfo("en-US")) + "," + GetDataSelected(); } switch (task) { //"UserID, TaskID, Scenario, VR, Time(sec), Clones, Delete accepted, Delete canceled, Select Subspaces(clicks), //" Rotation(sec), Traslation(sec), Scale(sec), NavSlaving(sec), Select Single, Brushing(clicks), " + //" UserAnswer, CorrectAnswer"; case 1: CSVResults += "," + "Regulations"; break; case 2: CSVResults += "," + "Mr Dibbs"; break; case 3: CSVResults += "," + "Clasic Rock and pop"; break; case 4: CSVResults += "," + "Questionario"; break; default: UnityEngine.Debug.Log("Defina uma tarefa"); break; } UnityEngine.Debug.Log(CSVResults); logHandler.Log(CSVResults, CSVFilename); logHandler.LogPosition(m_positions, PositionFilename); ResetValues(); WaitScene(); }