public static void ConnectedStatusCallBack(int status) { Debug.Log("NoloVR_AndroidPlayform ConnectedStatusCallBack:" + status); switch (status) { case 0: playformError = NoloError.DisConnect; NoloVR_System.GetInstance().realTrackDevices = NoloVR_Plugins.GetTrackModel(); break; case 1: playformError = NoloError.None; NoloVR_System.GetInstance().realTrackDevices = NoloVR_Plugins.GetTrackModel(); break; default: break; } }
public void Update() { if (Time.frameCount != preFrame) { preFrame = Time.frameCount; preControllerStates = controllerStates; if (NoloVR_Playform.GetInstance().GetPlayformError() == NoloError.None && NoloVR_Playform.GetInstance().GetAuthentication()) { controllerStates = NoloVR_Plugins.GetControllerStates(index); electricity = NoloVR_Plugins.GetElectricity(index); connectStatus = NoloVR_Plugins.GetNoloConnectStatus(index); float yaw = real_yaw * 57.3f; pose = NoloVR_Plugins.GetPose(index); if (index == 0) { //pose.pos += pose.rot * new Vector3(0, 0.08f, 0.062f); pose.rot = Quaternion.Euler(new Vector3(0, -yaw, 0)); //pose.pos -= pose.rot * new Vector3(0, 0.08f, 0.062f); } if (isTurnAround) { if (NoloVR_Controller.recPosition == Vector3.zero) { NoloVR_Controller.recPosition = NoloVR_Plugins.GetPose(0).pos; } var rot = pose.rot.eulerAngles; rot += new Vector3(0, 180 + yaw, 0); pose.rot = Quaternion.Euler(rot); Vector3 revec = Quaternion.Euler(new Vector3(0, 180 + yaw, 0)) * pose.pos + NoloVR_Controller.recPosition; pose.pos.x = revec.x; pose.pos.z = revec.z; pose.vecVelocity.x = -pose.vecVelocity.x; pose.vecVelocity.z = -pose.vecVelocity.z; return; } } if (NoloVR_System.GetInstance().realTrackDevices != 3 && NoloVR_System.GetInstance().realTrackDevices != 6) { NoloVR_System.GetInstance().realTrackDevices = NoloVR_Plugins.GetTrackModel(); } } }
public static uint GetButtonMask(NoloButtonID button) { #if NOLO_6DOF if (NoloVR_Plugins.GetTrackModel() == 3) { return(0); } else { switch (button) { case NoloButtonID.TouchPad: return(1 << 0); case NoloButtonID.Trigger: return(1 << 1); case NoloButtonID.Menu: return(1 << 2); case NoloButtonID.System: return(1 << 3); case NoloButtonID.Grip: return(1 << 4); default: return(0); } } #elif NOLO_3DOF if (NoloVR_Plugins.GetTrackModel() == 6) { switch (button) { case NoloButtonID.TouchPad: return(1 << 0); case NoloButtonID.Trigger: return(1 << 1); case NoloButtonID.System: return(1 << 3); case NoloButtonID.SystemLongPress: return(0); case NoloButtonID.Back: return(1 << 2); case NoloButtonID.VolumeDown: return(0); case NoloButtonID.VolumeUp: return(0); default: return(0); } } else { switch (button) { case NoloButtonID.TouchPad: return(1 << 1); case NoloButtonID.Trigger: return(1 << 0); case NoloButtonID.System: return(1 << 2); case NoloButtonID.SystemLongPress: return(1 << 3); case NoloButtonID.Back: return(1 << 4); case NoloButtonID.VolumeDown: return(1 << 6); case NoloButtonID.VolumeUp: return(1 << 7); default: return(0); } } #else return(0); #endif }