|
@@ -27,191 +27,195 @@ using System.Text;
|
|
|
|
|
|
|
|
public class OVRGearVrControllerTest : MonoBehaviour
|
|
public class OVRGearVrControllerTest : MonoBehaviour
|
|
|
{
|
|
{
|
|
|
- public class BoolMonitor
|
|
|
|
|
- {
|
|
|
|
|
- public delegate bool BoolGenerator();
|
|
|
|
|
-
|
|
|
|
|
- private string m_name = "";
|
|
|
|
|
- private BoolGenerator m_generator;
|
|
|
|
|
- private bool m_prevValue = false;
|
|
|
|
|
- private bool m_currentValue = false;
|
|
|
|
|
- private bool m_currentValueRecentlyChanged = false;
|
|
|
|
|
- private float m_displayTimeout = 0.0f;
|
|
|
|
|
- private float m_displayTimer = 0.0f;
|
|
|
|
|
-
|
|
|
|
|
- public BoolMonitor(string name, BoolGenerator generator, float displayTimeout = 0.5f)
|
|
|
|
|
- {
|
|
|
|
|
- m_name = name;
|
|
|
|
|
- m_generator = generator;
|
|
|
|
|
- m_displayTimeout = displayTimeout;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- public void Update()
|
|
|
|
|
- {
|
|
|
|
|
- m_prevValue = m_currentValue;
|
|
|
|
|
- m_currentValue = m_generator();
|
|
|
|
|
-
|
|
|
|
|
- if (m_currentValue != m_prevValue)
|
|
|
|
|
- {
|
|
|
|
|
- m_currentValueRecentlyChanged = true;
|
|
|
|
|
- m_displayTimer = m_displayTimeout;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- if (m_displayTimer > 0.0f)
|
|
|
|
|
- {
|
|
|
|
|
- m_displayTimer -= Time.deltaTime;
|
|
|
|
|
-
|
|
|
|
|
- if (m_displayTimer <= 0.0f)
|
|
|
|
|
- {
|
|
|
|
|
- m_currentValueRecentlyChanged = false;
|
|
|
|
|
- m_displayTimer = 0.0f;
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- public void AppendToStringBuilder(ref StringBuilder sb)
|
|
|
|
|
- {
|
|
|
|
|
- sb.Append(m_name);
|
|
|
|
|
-
|
|
|
|
|
- if (m_currentValue && m_currentValueRecentlyChanged)
|
|
|
|
|
- sb.Append(": *True*\n");
|
|
|
|
|
- else if (m_currentValue)
|
|
|
|
|
- sb.Append(": True \n");
|
|
|
|
|
- else if (!m_currentValue && m_currentValueRecentlyChanged)
|
|
|
|
|
- sb.Append(": *False*\n");
|
|
|
|
|
- else if (!m_currentValue)
|
|
|
|
|
- sb.Append(": False \n");
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- public Text uiText;
|
|
|
|
|
- private List<BoolMonitor> monitors;
|
|
|
|
|
- private StringBuilder data;
|
|
|
|
|
-
|
|
|
|
|
- void Start()
|
|
|
|
|
- {
|
|
|
|
|
- if (uiText != null)
|
|
|
|
|
- {
|
|
|
|
|
- uiText.supportRichText = false;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- data = new StringBuilder(2048);
|
|
|
|
|
-
|
|
|
|
|
- monitors = new List<BoolMonitor>()
|
|
|
|
|
- {
|
|
|
|
|
|
|
+ public class BoolMonitor
|
|
|
|
|
+ {
|
|
|
|
|
+ public delegate bool BoolGenerator();
|
|
|
|
|
+
|
|
|
|
|
+ private string m_name = "";
|
|
|
|
|
+ private BoolGenerator m_generator;
|
|
|
|
|
+ private bool m_prevValue = false;
|
|
|
|
|
+ private bool m_currentValue = false;
|
|
|
|
|
+ private bool m_currentValueRecentlyChanged = false;
|
|
|
|
|
+ private float m_displayTimeout = 0.0f;
|
|
|
|
|
+ private float m_displayTimer = 0.0f;
|
|
|
|
|
+
|
|
|
|
|
+ public BoolMonitor(string name, BoolGenerator generator, float displayTimeout = 0.5f)
|
|
|
|
|
+ {
|
|
|
|
|
+ m_name = name;
|
|
|
|
|
+ m_generator = generator;
|
|
|
|
|
+ m_displayTimeout = displayTimeout;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public void Update()
|
|
|
|
|
+ {
|
|
|
|
|
+ m_prevValue = m_currentValue;
|
|
|
|
|
+ m_currentValue = m_generator();
|
|
|
|
|
+
|
|
|
|
|
+ if (m_currentValue != m_prevValue)
|
|
|
|
|
+ {
|
|
|
|
|
+ m_currentValueRecentlyChanged = true;
|
|
|
|
|
+ m_displayTimer = m_displayTimeout;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if (m_displayTimer > 0.0f)
|
|
|
|
|
+ {
|
|
|
|
|
+ m_displayTimer -= Time.deltaTime;
|
|
|
|
|
+
|
|
|
|
|
+ if (m_displayTimer <= 0.0f)
|
|
|
|
|
+ {
|
|
|
|
|
+ m_currentValueRecentlyChanged = false;
|
|
|
|
|
+ m_displayTimer = 0.0f;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public void AppendToStringBuilder(ref StringBuilder sb)
|
|
|
|
|
+ {
|
|
|
|
|
+ sb.Append(m_name);
|
|
|
|
|
+
|
|
|
|
|
+ if (m_currentValue && m_currentValueRecentlyChanged)
|
|
|
|
|
+ sb.Append(": *True*\n");
|
|
|
|
|
+ else if (m_currentValue)
|
|
|
|
|
+ sb.Append(": True \n");
|
|
|
|
|
+ else if (!m_currentValue && m_currentValueRecentlyChanged)
|
|
|
|
|
+ sb.Append(": *False*\n");
|
|
|
|
|
+ else if (!m_currentValue)
|
|
|
|
|
+ sb.Append(": False \n");
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public Text uiText;
|
|
|
|
|
+ private List<BoolMonitor> monitors;
|
|
|
|
|
+ private StringBuilder data;
|
|
|
|
|
+
|
|
|
|
|
+ void Start()
|
|
|
|
|
+ {
|
|
|
|
|
+ if (uiText != null)
|
|
|
|
|
+ {
|
|
|
|
|
+ uiText.supportRichText = false;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ data = new StringBuilder(2048);
|
|
|
|
|
+
|
|
|
|
|
+ monitors = new List<BoolMonitor>()
|
|
|
|
|
+ {
|
|
|
// virtual
|
|
// virtual
|
|
|
new BoolMonitor("WasRecentered", () => OVRInput.GetControllerWasRecentered()),
|
|
new BoolMonitor("WasRecentered", () => OVRInput.GetControllerWasRecentered()),
|
|
|
- new BoolMonitor("One", () => OVRInput.Get(OVRInput.Button.One)),
|
|
|
|
|
- new BoolMonitor("OneDown", () => OVRInput.GetDown(OVRInput.Button.One)),
|
|
|
|
|
- new BoolMonitor("OneUp", () => OVRInput.GetUp(OVRInput.Button.One)),
|
|
|
|
|
- new BoolMonitor("One (Touch)", () => OVRInput.Get(OVRInput.Touch.One)),
|
|
|
|
|
- new BoolMonitor("OneDown (Touch)", () => OVRInput.GetDown(OVRInput.Touch.One)),
|
|
|
|
|
- new BoolMonitor("OneUp (Touch)", () => OVRInput.GetUp(OVRInput.Touch.One)),
|
|
|
|
|
- new BoolMonitor("Two", () => OVRInput.Get(OVRInput.Button.Two)),
|
|
|
|
|
- new BoolMonitor("TwoDown", () => OVRInput.GetDown(OVRInput.Button.Two)),
|
|
|
|
|
- new BoolMonitor("TwoUp", () => OVRInput.GetUp(OVRInput.Button.Two)),
|
|
|
|
|
- new BoolMonitor("PrimaryIndexTrigger", () => OVRInput.Get(OVRInput.Button.PrimaryIndexTrigger)),
|
|
|
|
|
- new BoolMonitor("PrimaryIndexTriggerDown", () => OVRInput.GetDown(OVRInput.Button.PrimaryIndexTrigger)),
|
|
|
|
|
- new BoolMonitor("PrimaryIndexTriggerUp", () => OVRInput.GetUp(OVRInput.Button.PrimaryIndexTrigger)),
|
|
|
|
|
- new BoolMonitor("PrimaryIndexTrigger (Touch)", () => OVRInput.Get(OVRInput.Touch.PrimaryIndexTrigger)),
|
|
|
|
|
- new BoolMonitor("PrimaryIndexTriggerDown (Touch)", () => OVRInput.GetDown(OVRInput.Touch.PrimaryIndexTrigger)),
|
|
|
|
|
- new BoolMonitor("PrimaryIndexTriggerUp (Touch)", () => OVRInput.GetUp(OVRInput.Touch.PrimaryIndexTrigger)),
|
|
|
|
|
- new BoolMonitor("PrimaryHandTrigger", () => OVRInput.Get(OVRInput.Button.PrimaryHandTrigger)),
|
|
|
|
|
- new BoolMonitor("PrimaryHandTriggerDown", () => OVRInput.GetDown(OVRInput.Button.PrimaryHandTrigger)),
|
|
|
|
|
- new BoolMonitor("PrimaryHandTriggerUp", () => OVRInput.GetUp(OVRInput.Button.PrimaryHandTrigger)),
|
|
|
|
|
- new BoolMonitor("Up", () => OVRInput.Get(OVRInput.Button.Up)),
|
|
|
|
|
- new BoolMonitor("Down", () => OVRInput.Get(OVRInput.Button.Down)),
|
|
|
|
|
- new BoolMonitor("Left", () => OVRInput.Get(OVRInput.Button.Left)),
|
|
|
|
|
- new BoolMonitor("Right", () => OVRInput.Get(OVRInput.Button.Right)),
|
|
|
|
|
- new BoolMonitor("Touchpad (Click)", () => OVRInput.Get(OVRInput.Button.PrimaryTouchpad)),
|
|
|
|
|
- new BoolMonitor("TouchpadDown (Click)", () => OVRInput.GetDown(OVRInput.Button.PrimaryTouchpad)),
|
|
|
|
|
- new BoolMonitor("TouchpadUp (Click)", () => OVRInput.GetUp(OVRInput.Button.PrimaryTouchpad)),
|
|
|
|
|
- new BoolMonitor("Touchpad (Touch)", () => OVRInput.Get(OVRInput.Touch.PrimaryTouchpad)),
|
|
|
|
|
- new BoolMonitor("TouchpadDown (Touch)", () => OVRInput.GetDown(OVRInput.Touch.PrimaryTouchpad)),
|
|
|
|
|
- new BoolMonitor("TouchpadUp (Touch)", () => OVRInput.GetUp(OVRInput.Touch.PrimaryTouchpad)),
|
|
|
|
|
|
|
+ new BoolMonitor("One", () => OVRInput.Get(OVRInput.Button.One)),
|
|
|
|
|
+ new BoolMonitor("OneDown", () => OVRInput.GetDown(OVRInput.Button.One)),
|
|
|
|
|
+ new BoolMonitor("OneUp", () => OVRInput.GetUp(OVRInput.Button.One)),
|
|
|
|
|
+ new BoolMonitor("One (Touch)", () => OVRInput.Get(OVRInput.Touch.One)),
|
|
|
|
|
+ new BoolMonitor("OneDown (Touch)", () => OVRInput.GetDown(OVRInput.Touch.One)),
|
|
|
|
|
+ new BoolMonitor("OneUp (Touch)", () => OVRInput.GetUp(OVRInput.Touch.One)),
|
|
|
|
|
+ new BoolMonitor("Two", () => OVRInput.Get(OVRInput.Button.Two)),
|
|
|
|
|
+ new BoolMonitor("TwoDown", () => OVRInput.GetDown(OVRInput.Button.Two)),
|
|
|
|
|
+ new BoolMonitor("TwoUp", () => OVRInput.GetUp(OVRInput.Button.Two)),
|
|
|
|
|
+ new BoolMonitor("PrimaryIndexTrigger", () => OVRInput.Get(OVRInput.Button.PrimaryIndexTrigger)),
|
|
|
|
|
+ new BoolMonitor("PrimaryIndexTriggerDown", () => OVRInput.GetDown(OVRInput.Button.PrimaryIndexTrigger)),
|
|
|
|
|
+ new BoolMonitor("PrimaryIndexTriggerUp", () => OVRInput.GetUp(OVRInput.Button.PrimaryIndexTrigger)),
|
|
|
|
|
+ new BoolMonitor("PrimaryIndexTrigger (Touch)", () => OVRInput.Get(OVRInput.Touch.PrimaryIndexTrigger)),
|
|
|
|
|
+ new BoolMonitor("PrimaryIndexTriggerDown (Touch)", () => OVRInput.GetDown(OVRInput.Touch.PrimaryIndexTrigger)),
|
|
|
|
|
+ new BoolMonitor("PrimaryIndexTriggerUp (Touch)", () => OVRInput.GetUp(OVRInput.Touch.PrimaryIndexTrigger)),
|
|
|
|
|
+ new BoolMonitor("PrimaryHandTrigger", () => OVRInput.Get(OVRInput.Button.PrimaryHandTrigger)),
|
|
|
|
|
+ new BoolMonitor("PrimaryHandTriggerDown", () => OVRInput.GetDown(OVRInput.Button.PrimaryHandTrigger)),
|
|
|
|
|
+ new BoolMonitor("PrimaryHandTriggerUp", () => OVRInput.GetUp(OVRInput.Button.PrimaryHandTrigger)),
|
|
|
|
|
+ new BoolMonitor("Up", () => OVRInput.Get(OVRInput.Button.Up)),
|
|
|
|
|
+ new BoolMonitor("Down", () => OVRInput.Get(OVRInput.Button.Down)),
|
|
|
|
|
+ new BoolMonitor("Left", () => OVRInput.Get(OVRInput.Button.Left)),
|
|
|
|
|
+ new BoolMonitor("Right", () => OVRInput.Get(OVRInput.Button.Right)),
|
|
|
|
|
+ new BoolMonitor("Touchpad (Click)", () => OVRInput.Get(OVRInput.Button.PrimaryTouchpad)),
|
|
|
|
|
+ new BoolMonitor("TouchpadDown (Click)", () => OVRInput.GetDown(OVRInput.Button.PrimaryTouchpad)),
|
|
|
|
|
+ new BoolMonitor("TouchpadUp (Click)", () => OVRInput.GetUp(OVRInput.Button.PrimaryTouchpad)),
|
|
|
|
|
+ new BoolMonitor("Touchpad (Touch)", () => OVRInput.Get(OVRInput.Touch.PrimaryTouchpad)),
|
|
|
|
|
+ new BoolMonitor("TouchpadDown (Touch)", () => OVRInput.GetDown(OVRInput.Touch.PrimaryTouchpad)),
|
|
|
|
|
+ new BoolMonitor("TouchpadUp (Touch)", () => OVRInput.GetUp(OVRInput.Touch.PrimaryTouchpad)),
|
|
|
|
|
|
|
|
// raw
|
|
// raw
|
|
|
new BoolMonitor("Start", () => OVRInput.Get(OVRInput.RawButton.Start)),
|
|
new BoolMonitor("Start", () => OVRInput.Get(OVRInput.RawButton.Start)),
|
|
|
- new BoolMonitor("StartDown", () => OVRInput.GetDown(OVRInput.RawButton.Start)),
|
|
|
|
|
- new BoolMonitor("StartUp", () => OVRInput.GetUp(OVRInput.RawButton.Start)),
|
|
|
|
|
- new BoolMonitor("Back", () => OVRInput.Get(OVRInput.RawButton.Back)),
|
|
|
|
|
- new BoolMonitor("BackDown", () => OVRInput.GetDown(OVRInput.RawButton.Back)),
|
|
|
|
|
- new BoolMonitor("BackUp", () => OVRInput.GetUp(OVRInput.RawButton.Back)),
|
|
|
|
|
- new BoolMonitor("A", () => OVRInput.Get(OVRInput.RawButton.A)),
|
|
|
|
|
- new BoolMonitor("ADown", () => OVRInput.GetDown(OVRInput.RawButton.A)),
|
|
|
|
|
- new BoolMonitor("AUp", () => OVRInput.GetUp(OVRInput.RawButton.A)),
|
|
|
|
|
- };
|
|
|
|
|
- }
|
|
|
|
|
- static string prevConnected = "";
|
|
|
|
|
- static BoolMonitor controllers = new BoolMonitor("Controllers Changed", () => { return OVRInput.GetConnectedControllers().ToString() != prevConnected; });
|
|
|
|
|
-
|
|
|
|
|
- void Update()
|
|
|
|
|
- {
|
|
|
|
|
- OVRInput.Controller activeController = OVRInput.GetActiveController();
|
|
|
|
|
|
|
+ new BoolMonitor("StartDown", () => OVRInput.GetDown(OVRInput.RawButton.Start)),
|
|
|
|
|
+ new BoolMonitor("StartUp", () => OVRInput.GetUp(OVRInput.RawButton.Start)),
|
|
|
|
|
+ new BoolMonitor("Back", () => OVRInput.Get(OVRInput.RawButton.Back)),
|
|
|
|
|
+ new BoolMonitor("BackDown", () => OVRInput.GetDown(OVRInput.RawButton.Back)),
|
|
|
|
|
+ new BoolMonitor("BackUp", () => OVRInput.GetUp(OVRInput.RawButton.Back)),
|
|
|
|
|
+ new BoolMonitor("A", () => OVRInput.Get(OVRInput.RawButton.A)),
|
|
|
|
|
+ new BoolMonitor("ADown", () => OVRInput.GetDown(OVRInput.RawButton.A)),
|
|
|
|
|
+ new BoolMonitor("AUp", () => OVRInput.GetUp(OVRInput.RawButton.A)),
|
|
|
|
|
+ };
|
|
|
|
|
+ }
|
|
|
|
|
+ static string prevConnected = "";
|
|
|
|
|
+ static BoolMonitor controllers = new BoolMonitor("Controllers Changed", () => { return OVRInput.GetConnectedControllers().ToString() != prevConnected; });
|
|
|
|
|
|
|
|
- data.Length = 0;
|
|
|
|
|
- byte recenterCount = OVRInput.GetControllerRecenterCount();
|
|
|
|
|
- data.AppendFormat("RecenterCount: {0}\n", recenterCount);
|
|
|
|
|
|
|
+ void Update()
|
|
|
|
|
+ {
|
|
|
|
|
+ OVRInput.Controller activeController = OVRInput.GetActiveController();
|
|
|
|
|
|
|
|
- byte battery = OVRInput.GetControllerBatteryPercentRemaining();
|
|
|
|
|
- data.AppendFormat("Battery: {0}\n", battery);
|
|
|
|
|
|
|
+ data.Length = 0;
|
|
|
|
|
+ byte recenterCount = OVRInput.GetControllerRecenterCount();
|
|
|
|
|
+ data.AppendFormat("RecenterCount: {0}\n", recenterCount);
|
|
|
|
|
|
|
|
- float framerate = OVRPlugin.GetAppFramerate();
|
|
|
|
|
- data.AppendFormat("Framerate: {0:F2}\n", framerate);
|
|
|
|
|
|
|
+ byte battery = OVRInput.GetControllerBatteryPercentRemaining();
|
|
|
|
|
+ data.AppendFormat("Battery: {0}\n", battery);
|
|
|
|
|
|
|
|
- string activeControllerName = activeController.ToString();
|
|
|
|
|
- data.AppendFormat("Active: {0}\n", activeControllerName);
|
|
|
|
|
|
|
+ float framerate = OVRPlugin.GetAppFramerate();
|
|
|
|
|
+ data.AppendFormat("Framerate: {0:F2}\n", framerate);
|
|
|
|
|
|
|
|
- string connectedControllerNames = OVRInput.GetConnectedControllers().ToString();
|
|
|
|
|
- data.AppendFormat("Connected: {0}\n", connectedControllerNames);
|
|
|
|
|
|
|
+ string activeControllerName = activeController.ToString();
|
|
|
|
|
+ data.AppendFormat("Active: {0}\n", activeControllerName);
|
|
|
|
|
|
|
|
- data.AppendFormat("PrevConnected: {0}\n", prevConnected);
|
|
|
|
|
|
|
+ string connectedControllerNames = OVRInput.GetConnectedControllers().ToString();
|
|
|
|
|
+ data.AppendFormat("Connected: {0}\n", connectedControllerNames);
|
|
|
|
|
|
|
|
- controllers.Update();
|
|
|
|
|
- controllers.AppendToStringBuilder(ref data);
|
|
|
|
|
|
|
+ data.AppendFormat("PrevConnected: {0}\n", prevConnected);
|
|
|
|
|
|
|
|
- prevConnected = connectedControllerNames;
|
|
|
|
|
|
|
+ controllers.Update();
|
|
|
|
|
+ controllers.AppendToStringBuilder(ref data);
|
|
|
|
|
|
|
|
- Quaternion rot = OVRInput.GetLocalControllerRotation(activeController);
|
|
|
|
|
- data.AppendFormat("Orientation: ({0:F2}, {1:F2}, {2:F2}, {3:F2})\n", rot.x, rot.y, rot.z, rot.w);
|
|
|
|
|
|
|
+ prevConnected = connectedControllerNames;
|
|
|
|
|
|
|
|
- Vector3 angVel = OVRInput.GetLocalControllerAngularVelocity(activeController);
|
|
|
|
|
- data.AppendFormat("AngVel: ({0:F2}, {1:F2}, {2:F2})\n", angVel.x, angVel.y, angVel.z);
|
|
|
|
|
|
|
+ Quaternion rot = OVRInput.GetLocalControllerRotation(activeController);
|
|
|
|
|
+ data.AppendFormat("Orientation: ({0:F2}, {1:F2}, {2:F2}, {3:F2})\n", rot.x, rot.y, rot.z, rot.w);
|
|
|
|
|
|
|
|
- Vector3 angAcc = OVRInput.GetLocalControllerAngularAcceleration(activeController);
|
|
|
|
|
- data.AppendFormat("AngAcc: ({0:F2}, {1:F2}, {2:F2})\n", angAcc.x, angAcc.y, angAcc.z);
|
|
|
|
|
|
|
+ Vector3 angVel = OVRInput.GetLocalControllerAngularVelocity(activeController);
|
|
|
|
|
+ data.AppendFormat("AngVel: ({0:F2}, {1:F2}, {2:F2})\n", angVel.x, angVel.y, angVel.z);
|
|
|
|
|
|
|
|
- Vector3 pos = OVRInput.GetLocalControllerPosition(activeController);
|
|
|
|
|
- data.AppendFormat("Position: ({0:F2}, {1:F2}, {2:F2})\n", pos.x, pos.y, pos.z);
|
|
|
|
|
|
|
+ Vector3 angAcc = OVRInput.GetLocalControllerAngularAcceleration(activeController);
|
|
|
|
|
+ data.AppendFormat("AngAcc: ({0:F2}, {1:F2}, {2:F2})\n", angAcc.x, angAcc.y, angAcc.z);
|
|
|
|
|
|
|
|
- Vector3 vel = OVRInput.GetLocalControllerVelocity(activeController);
|
|
|
|
|
- data.AppendFormat("Vel: ({0:F2}, {1:F2}, {2:F2})\n", vel.x, vel.y, vel.z);
|
|
|
|
|
|
|
+ Vector3 pos = OVRInput.GetLocalControllerPosition(activeController);
|
|
|
|
|
+ data.AppendFormat("Position: ({0:F2}, {1:F2}, {2:F2})\n", pos.x, pos.y, pos.z);
|
|
|
|
|
|
|
|
- Vector3 acc = OVRInput.GetLocalControllerAcceleration(activeController);
|
|
|
|
|
- data.AppendFormat("Acc: ({0:F2}, {1:F2}, {2:F2})\n", acc.x, acc.y, acc.z);
|
|
|
|
|
|
|
+ Vector3 vel = OVRInput.GetLocalControllerVelocity(activeController);
|
|
|
|
|
+ data.AppendFormat("Vel: ({0:F2}, {1:F2}, {2:F2})\n", vel.x, vel.y, vel.z);
|
|
|
|
|
|
|
|
- Vector2 primaryTouchpad = OVRInput.Get(OVRInput.Axis2D.PrimaryTouchpad);
|
|
|
|
|
- data.AppendFormat("PrimaryTouchpad: ({0:F2}, {1:F2})\n", primaryTouchpad.x, primaryTouchpad.y);
|
|
|
|
|
|
|
+ Vector3 acc = OVRInput.GetLocalControllerAcceleration(activeController);
|
|
|
|
|
+ data.AppendFormat("Acc: ({0:F2}, {1:F2}, {2:F2})\n", acc.x, acc.y, acc.z);
|
|
|
|
|
|
|
|
- Vector2 secondaryTouchpad = OVRInput.Get(OVRInput.Axis2D.SecondaryTouchpad);
|
|
|
|
|
- data.AppendFormat("SecondaryTouchpad: ({0:F2}, {1:F2})\n", secondaryTouchpad.x, secondaryTouchpad.y);
|
|
|
|
|
|
|
+ Vector2 primaryTouchpad = OVRInput.Get(OVRInput.Axis2D.PrimaryTouchpad);
|
|
|
|
|
+ data.AppendFormat("PrimaryTouchpad: ({0:F2}, {1:F2})\n", primaryTouchpad.x, primaryTouchpad.y);
|
|
|
|
|
|
|
|
- float indexTrigger = OVRInput.Get(OVRInput.Axis1D.PrimaryIndexTrigger);
|
|
|
|
|
- data.AppendFormat("PrimaryIndexTriggerAxis1D: ({0:F2})\n", indexTrigger);
|
|
|
|
|
|
|
+ Vector2 secondaryTouchpad = OVRInput.Get(OVRInput.Axis2D.SecondaryTouchpad);
|
|
|
|
|
+ data.AppendFormat("SecondaryTouchpad: ({0:F2}, {1:F2})\n", secondaryTouchpad.x, secondaryTouchpad.y);
|
|
|
|
|
|
|
|
- float handTrigger = OVRInput.Get(OVRInput.Axis1D.PrimaryHandTrigger);
|
|
|
|
|
- data.AppendFormat("PrimaryHandTriggerAxis1D: ({0:F2})\n", handTrigger);
|
|
|
|
|
|
|
+ float indexTrigger = OVRInput.Get(OVRInput.Axis1D.PrimaryIndexTrigger);
|
|
|
|
|
+ data.AppendFormat("PrimaryIndexTriggerAxis1D: ({0:F2})\n", indexTrigger);
|
|
|
|
|
|
|
|
- for (int i = 0; i < monitors.Count; i++)
|
|
|
|
|
- {
|
|
|
|
|
- monitors[i].Update();
|
|
|
|
|
- monitors[i].AppendToStringBuilder(ref data);
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ float handTrigger = OVRInput.Get(OVRInput.Axis1D.PrimaryHandTrigger);
|
|
|
|
|
+ data.AppendFormat("PrimaryHandTriggerAxis1D: ({0:F2})\n", handTrigger);
|
|
|
|
|
|
|
|
- if (uiText != null)
|
|
|
|
|
- {
|
|
|
|
|
- uiText.text = data.ToString();
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ for (int i = 0; i < monitors.Count; i++)
|
|
|
|
|
+ {
|
|
|
|
|
+ monitors[i].Update();
|
|
|
|
|
+ monitors[i].AppendToStringBuilder(ref data);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ data.AppendLine("Tollololo");
|
|
|
|
|
+ data.AppendLine(OVRInput.Controller.Active.ToString());
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ if (uiText != null)
|
|
|
|
|
+ {
|
|
|
|
|
+ uiText.text = data.ToString();
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|