|
@@ -11,11 +11,26 @@
|
|
#include <AzCore/RTTI/BehaviorContext.h>
|
|
#include <AzCore/RTTI/BehaviorContext.h>
|
|
#include <AzFramework/Input/Utils/AdjustAnalogInputForDeadZone.h>
|
|
#include <AzFramework/Input/Utils/AdjustAnalogInputForDeadZone.h>
|
|
|
|
|
|
-////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
+// Debug Draw
|
|
|
|
+#include <AzCore/Console/IConsole.h>
|
|
|
|
+#include <Atom/RPI.Public/ViewportContext.h>
|
|
|
|
+#include <Atom/RPI.Public/ViewportContextBus.h>
|
|
|
|
+
|
|
|
|
+namespace OpenXRVk
|
|
|
|
+{
|
|
|
|
+ // Cvar to enable/disable debug drawing of xr controller data on screen.
|
|
|
|
+ // No "on change" function defined here, just read the state of the bool
|
|
|
|
+ // elsewhere in the draw function.
|
|
|
|
+ AZ_CVAR(bool, xr_DebugDrawInput, 0,
|
|
|
|
+ nullptr, AZ::ConsoleFunctorFlags::Null,
|
|
|
|
+ "Turn off/on debug drawing of XR Input state");
|
|
|
|
+
|
|
|
|
+} // namespace OpenXRVk
|
|
|
|
+
|
|
|
|
+
|
|
namespace AzFramework
|
|
namespace AzFramework
|
|
{
|
|
{
|
|
////////////////////////////////////////////////////////////////////////////////////////////////
|
|
////////////////////////////////////////////////////////////////////////////////////////////////
|
|
- // static
|
|
|
|
bool InputDeviceXRController::IsXRControllerDevice(const InputDeviceId& inputDeviceId)
|
|
bool InputDeviceXRController::IsXRControllerDevice(const InputDeviceId& inputDeviceId)
|
|
{
|
|
{
|
|
// Only need to check the name (crc) to check the device is an xr controller type.
|
|
// Only need to check the name (crc) to check the device is an xr controller type.
|
|
@@ -160,11 +175,17 @@ namespace AzFramework
|
|
|
|
|
|
// Connect to haptic feedback request bus
|
|
// Connect to haptic feedback request bus
|
|
InputHapticFeedbackRequestBus::Handler::BusConnect(GetInputDeviceId());
|
|
InputHapticFeedbackRequestBus::Handler::BusConnect(GetInputDeviceId());
|
|
|
|
+
|
|
|
|
+ // Debug Draw
|
|
|
|
+ DebugDisplayEventBus::Handler::BusConnect();
|
|
}
|
|
}
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////////
|
|
////////////////////////////////////////////////////////////////////////////////////////////////
|
|
InputDeviceXRController::~InputDeviceXRController()
|
|
InputDeviceXRController::~InputDeviceXRController()
|
|
{
|
|
{
|
|
|
|
+ // Debug Draw
|
|
|
|
+ DebugDisplayEventBus::Handler::BusDisconnect();
|
|
|
|
+
|
|
// Disconnect from haptic feedback request bus
|
|
// Disconnect from haptic feedback request bus
|
|
InputHapticFeedbackRequestBus::Handler::BusDisconnect(GetInputDeviceId());
|
|
InputHapticFeedbackRequestBus::Handler::BusDisconnect(GetInputDeviceId());
|
|
|
|
|
|
@@ -235,6 +256,7 @@ namespace AzFramework
|
|
return m_impl.get();
|
|
return m_impl.get();
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+
|
|
////////////////////////////////////////////////////////////////////////////////////////////////
|
|
////////////////////////////////////////////////////////////////////////////////////////////////
|
|
//! InputDeviceXRController::Implementation
|
|
//! InputDeviceXRController::Implementation
|
|
////////////////////////////////////////////////////////////////////////////////////////////////
|
|
////////////////////////////////////////////////////////////////////////////////////////////////
|
|
@@ -289,6 +311,16 @@ namespace AzFramework
|
|
m_rightOrientationState = AZ::Quaternion::CreateIdentity();
|
|
m_rightOrientationState = AZ::Quaternion::CreateIdentity();
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ ////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
+ bool InputDeviceXRController::Implementation::RawXRControllerState::GetDigitalButtonState(const InputChannelId& channelId) const
|
|
|
|
+ {
|
|
|
|
+ if (auto it = m_buttonIdsToBitMasks.find(channelId); it != m_buttonIdsToBitMasks.end())
|
|
|
|
+ {
|
|
|
|
+ return (m_digitalButtonStates & it->second) != 0;
|
|
|
|
+ }
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+
|
|
////////////////////////////////////////////////////////////////////////////////////////////////
|
|
////////////////////////////////////////////////////////////////////////////////////////////////
|
|
float InputDeviceXRController::Implementation::RawXRControllerState::GetLeftTriggerAdjustedForDeadZoneAndNormalized() const
|
|
float InputDeviceXRController::Implementation::RawXRControllerState::GetLeftTriggerAdjustedForDeadZoneAndNormalized() const
|
|
{
|
|
{
|
|
@@ -398,8 +430,6 @@ namespace AzFramework
|
|
m_inputDevice.m_controllerPositionChannelsById[xrc::ControllerPosePosition::RPos]
|
|
m_inputDevice.m_controllerPositionChannelsById[xrc::ControllerPosePosition::RPos]
|
|
->ProcessRawInputEvent(rawControllerState.m_rightPositionState);
|
|
->ProcessRawInputEvent(rawControllerState.m_rightPositionState);
|
|
|
|
|
|
- // TBD: Process Velocity and Acceleration...
|
|
|
|
-
|
|
|
|
// Orientation update...
|
|
// Orientation update...
|
|
m_inputDevice.m_controllerOrientationChannelsById[xrc::ControllerPoseOrientation::LOrient]
|
|
m_inputDevice.m_controllerOrientationChannelsById[xrc::ControllerPoseOrientation::LOrient]
|
|
->ProcessRawInputEvent(rawControllerState.m_leftOrientationState);
|
|
->ProcessRawInputEvent(rawControllerState.m_leftOrientationState);
|
|
@@ -419,4 +449,311 @@ namespace AzFramework
|
|
return m_inputDevice.GetInputDeviceId().GetIndex();
|
|
return m_inputDevice.GetInputDeviceId().GetIndex();
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ ////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
+ // Debug Draw Related Functions
|
|
|
|
+ ////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
+
|
|
|
|
+#if !defined(AZ_RELEASE_BUILD)
|
|
|
|
+
|
|
|
|
+ static AZ::Transform GetCameraTransformFromCurrentView()
|
|
|
|
+ {
|
|
|
|
+ if (const auto viewportContextMgr = AZ::Interface<AZ::RPI::ViewportContextRequestsInterface>::Get();
|
|
|
|
+ viewportContextMgr != nullptr)
|
|
|
|
+ {
|
|
|
|
+ if (const AZ::RPI::ViewportContextPtr viewportContext = viewportContextMgr->GetDefaultViewportContext();
|
|
|
|
+ viewportContext != nullptr)
|
|
|
|
+ {
|
|
|
|
+ if (const AZ::RPI::ViewPtr view = viewportContext->GetDefaultView();
|
|
|
|
+ view != nullptr)
|
|
|
|
+ {
|
|
|
|
+ return view->GetCameraTransform();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return AZ::Transform::CreateIdentity();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ static void DrawControllerAxes(DebugDisplayRequests& debugDisplay, const AZ::Vector3& position, const AZ::Quaternion& orientation)
|
|
|
|
+ {
|
|
|
|
+ static const AZ::Color axisColorX(1.f, 0.f, 0.f, 0.9f);
|
|
|
|
+ static const AZ::Color axisColorY(0.f, 1.f, 0.f, 0.9f);
|
|
|
|
+ static const AZ::Color axisColorZ(0.f, 0.f, 1.f, 0.9f);
|
|
|
|
+
|
|
|
|
+ const auto cameraTransform = GetCameraTransformFromCurrentView();
|
|
|
|
+ const AZ::Vector3& cameraPosition = cameraTransform.GetTranslation();
|
|
|
|
+ const AZ::Vector3 controllerPosition = cameraPosition + position;
|
|
|
|
+
|
|
|
|
+ const AZ::Transform controllerTransform = AZ::Transform::CreateFromQuaternionAndTranslation(orientation, controllerPosition);
|
|
|
|
+ debugDisplay.SetColor(axisColorX);
|
|
|
|
+ debugDisplay.DrawLine(controllerPosition, controllerPosition + controllerTransform.GetBasisX());
|
|
|
|
+ debugDisplay.SetColor(axisColorY);
|
|
|
|
+ debugDisplay.DrawLine(controllerPosition, controllerPosition + controllerTransform.GetBasisY());
|
|
|
|
+ debugDisplay.SetColor(axisColorZ);
|
|
|
|
+ debugDisplay.DrawLine(controllerPosition, controllerPosition + controllerTransform.GetBasisZ());
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+#endif // !AZ_RELEASE_BUILD
|
|
|
|
+
|
|
|
|
+ ////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
+ void InputDeviceXRController::CheckDebugDrawCheat() const
|
|
|
|
+ {
|
|
|
|
+#if !defined(AZ_RELEASE_BUILD)
|
|
|
|
+ // This looks for specific controller input and will toggle the debug draw cvar.
|
|
|
|
+ const auto& rawControllerData = m_impl->GetRawState();
|
|
|
|
+ using xrc = InputDeviceXRController;
|
|
|
|
+ static bool cheatWasPressed = false;
|
|
|
|
+
|
|
|
|
+ // Menu button + Left Trigger pulled past 0.9 will toggle.
|
|
|
|
+ // To avoid button bounce, block re-toggle until the menu button is released.
|
|
|
|
+ const bool menuPressed = rawControllerData.GetDigitalButtonState(xrc::Button::Menu);
|
|
|
|
+ const float leftTrigger = rawControllerData.GetLeftTriggerAdjustedForDeadZoneAndNormalized();
|
|
|
|
+ if (menuPressed)
|
|
|
|
+ {
|
|
|
|
+ if (!cheatWasPressed && leftTrigger > 0.9f)
|
|
|
|
+ {
|
|
|
|
+ cheatWasPressed = true;
|
|
|
|
+ OpenXRVk::xr_DebugDrawInput = !OpenXRVk::xr_DebugDrawInput;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ cheatWasPressed = false;
|
|
|
|
+ }
|
|
|
|
+#endif // !AZ_RELEASE_BUILD
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ ////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
+ void InputDeviceXRController::DrawGlobalDebugInfo()
|
|
|
|
+ {
|
|
|
|
+#if !defined(AZ_RELEASE_BUILD)
|
|
|
|
+ CheckDebugDrawCheat();
|
|
|
|
+
|
|
|
|
+ if (!OpenXRVk::xr_DebugDrawInput)
|
|
|
|
+ {
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ DebugDisplayRequestBus::BusPtr debugDisplayBus;
|
|
|
|
+ DebugDisplayRequestBus::Bind(debugDisplayBus, g_defaultSceneEntityDebugDisplayId);
|
|
|
|
+ DebugDisplayRequests* debugDisplay{ DebugDisplayRequestBus::FindFirstHandler(debugDisplayBus) };
|
|
|
|
+ if (!debugDisplay || !IsSupported())
|
|
|
|
+ {
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ // Save previous draw state
|
|
|
|
+ const AZ::u32 oldDrawState{ debugDisplay->GetState() };
|
|
|
|
+
|
|
|
|
+ // ... draw data to the screen ...
|
|
|
|
+ const auto& rawControllerData = m_impl->GetRawState();
|
|
|
|
+ DrawControllerAxes(*debugDisplay, rawControllerData.m_leftPositionState, rawControllerData.m_leftOrientationState);
|
|
|
|
+ DrawControllerAxes(*debugDisplay, rawControllerData.m_rightPositionState, rawControllerData.m_rightOrientationState);
|
|
|
|
+
|
|
|
|
+ float drawX = 20.f; // current draw X
|
|
|
|
+ float drawY = 20.f; // current draw Y
|
|
|
|
+ constexpr float textSize = 0.8f;
|
|
|
|
+ constexpr float lineHeight = 15.f;
|
|
|
|
+
|
|
|
|
+ const AZ::Color whiteColor{ 1.f, 1.f, 1.f, 1.f };
|
|
|
|
+ const AZ::Color pressedColor{ 0.f, 1.f, 0.2f, 1.f };
|
|
|
|
+ const AZ::Color touchedColor{ 0.7f, 0.5f, 0.2f, 1.f };
|
|
|
|
+ const AZ::Color defaultColor{ 0.2f, 0.2f, 0.2f, 0.8f };
|
|
|
|
+
|
|
|
|
+ auto printButtonWithTouchState = [&](const InputChannelId& buttonChannel,
|
|
|
|
+ const InputChannelId& touchedButtonChannel, const char* buttonText)
|
|
|
|
+ {
|
|
|
|
+ AZStd::string text{ buttonText };
|
|
|
|
+ if (rawControllerData.GetDigitalButtonState(buttonChannel))
|
|
|
|
+ {
|
|
|
|
+ text.append(" Pressed");
|
|
|
|
+ debugDisplay->SetColor(pressedColor);
|
|
|
|
+ }
|
|
|
|
+ else if (rawControllerData.GetDigitalButtonState(touchedButtonChannel))
|
|
|
|
+ {
|
|
|
|
+ text.append(" Touched");
|
|
|
|
+ debugDisplay->SetColor(touchedColor);
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ debugDisplay->SetColor(defaultColor);
|
|
|
|
+ }
|
|
|
|
+ debugDisplay->Draw2dTextLabel(drawX, drawY, textSize, text.c_str());
|
|
|
|
+
|
|
|
|
+ drawY += lineHeight;
|
|
|
|
+ };
|
|
|
|
+
|
|
|
|
+ auto printButtonState = [&](const InputChannelId& buttonChannel, const char* buttonText)
|
|
|
|
+ {
|
|
|
|
+ AZStd::string text{ buttonText };
|
|
|
|
+ if (rawControllerData.GetDigitalButtonState(buttonChannel))
|
|
|
|
+ {
|
|
|
|
+ text.append(" Pressed");
|
|
|
|
+ debugDisplay->SetColor(pressedColor);
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ debugDisplay->SetColor(defaultColor);
|
|
|
|
+ }
|
|
|
|
+ debugDisplay->Draw2dTextLabel(drawX, drawY, textSize, text.c_str());
|
|
|
|
+
|
|
|
|
+ drawY += lineHeight;
|
|
|
|
+ };
|
|
|
|
+
|
|
|
|
+ auto printButtonTouchOnlyState = [&](const InputChannelId& touchChannel, const char* buttonText)
|
|
|
|
+ {
|
|
|
|
+ AZStd::string text{ buttonText };
|
|
|
|
+ if (rawControllerData.GetDigitalButtonState(touchChannel))
|
|
|
|
+ {
|
|
|
|
+ text.append(" Touched");
|
|
|
|
+ debugDisplay->SetColor(touchedColor);
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ debugDisplay->SetColor(defaultColor);
|
|
|
|
+ }
|
|
|
|
+ debugDisplay->Draw2dTextLabel(drawX, drawY, textSize, text.c_str());
|
|
|
|
+
|
|
|
|
+ drawY += lineHeight;
|
|
|
|
+ };
|
|
|
|
+
|
|
|
|
+ auto printAnalogWithTouchState = [&](const InputChannelId& touchedChannel, const char* analogText, float value)
|
|
|
|
+ {
|
|
|
|
+ AZStd::string text{ analogText };
|
|
|
|
+ if (!AZ::IsClose(value, 0.f))
|
|
|
|
+ {
|
|
|
|
+ text.append(AZStd::string::format(" Pressed: %.2f", value));
|
|
|
|
+ debugDisplay->SetColor(pressedColor);
|
|
|
|
+ }
|
|
|
|
+ else if (rawControllerData.GetDigitalButtonState(touchedChannel))
|
|
|
|
+ {
|
|
|
|
+ text.append(" Touched");
|
|
|
|
+ debugDisplay->SetColor(touchedColor);
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ debugDisplay->SetColor(defaultColor);
|
|
|
|
+ }
|
|
|
|
+ debugDisplay->Draw2dTextLabel(drawX, drawY, textSize, text.c_str());
|
|
|
|
+
|
|
|
|
+ drawY += lineHeight;
|
|
|
|
+ };
|
|
|
|
+
|
|
|
|
+ auto printAnalogState = [&](const char* analogText, float value)
|
|
|
|
+ {
|
|
|
|
+ AZStd::string text{ analogText };
|
|
|
|
+ if (!AZ::IsClose(value, 0.f))
|
|
|
|
+ {
|
|
|
|
+ text.append(AZStd::string::format(" = %.2f", value));
|
|
|
|
+ debugDisplay->SetColor(pressedColor);
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ debugDisplay->SetColor(defaultColor);
|
|
|
|
+ }
|
|
|
|
+ debugDisplay->Draw2dTextLabel(drawX, drawY, textSize, text.c_str());
|
|
|
|
+
|
|
|
|
+ drawY += lineHeight;
|
|
|
|
+ };
|
|
|
|
+
|
|
|
|
+ auto print2DThumbStickWithTouchState = [&](const InputChannelId& touchedChannel, const char* thumbStickText, float xvalue, float yvalue)
|
|
|
|
+ {
|
|
|
|
+ AZStd::string text{ thumbStickText };
|
|
|
|
+ if (!AZ::IsClose(xvalue, 0.f) || !AZ::IsClose(yvalue, 0.f))
|
|
|
|
+ {
|
|
|
|
+ text.append(AZStd::string::format(" Pressed: (%.2f, %.2f)", xvalue, yvalue));
|
|
|
|
+ debugDisplay->SetColor(pressedColor);
|
|
|
|
+ }
|
|
|
|
+ else if (rawControllerData.GetDigitalButtonState(touchedChannel))
|
|
|
|
+ {
|
|
|
|
+ text.append(" Touched");
|
|
|
|
+ debugDisplay->SetColor(touchedColor);
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ debugDisplay->SetColor(defaultColor);
|
|
|
|
+ }
|
|
|
|
+ debugDisplay->Draw2dTextLabel(drawX, drawY, textSize, text.c_str());
|
|
|
|
+
|
|
|
|
+ drawY += lineHeight;
|
|
|
|
+ };
|
|
|
|
+
|
|
|
|
+ auto printVector3 = [&](const AZ::Vector3& vec, const char* vectorText)
|
|
|
|
+ {
|
|
|
|
+ AZStd::string str{ AZStd::string::format("%s = (%.2f, %.2f, %.2f)", vectorText, vec.GetX(), vec.GetY(), vec.GetZ()) };
|
|
|
|
+ debugDisplay->SetColor(whiteColor);
|
|
|
|
+ debugDisplay->Draw2dTextLabel(drawX, drawY, textSize, str.c_str());
|
|
|
|
+
|
|
|
|
+ drawY += lineHeight;
|
|
|
|
+ };
|
|
|
|
+
|
|
|
|
+ auto printMatrix3x4 = [&](const AZ::Matrix3x4& matx, const char* matrixText)
|
|
|
|
+ {
|
|
|
|
+ debugDisplay->SetColor(whiteColor);
|
|
|
|
+ AZStd::string str{ AZStd::string::format("%s:", matrixText) };
|
|
|
|
+ debugDisplay->Draw2dTextLabel(drawX, drawY, textSize, str.c_str());
|
|
|
|
+ drawY += lineHeight;
|
|
|
|
+
|
|
|
|
+ AZ::Vector3 col0, col1, col2, col3;
|
|
|
|
+ matx.GetColumns(&col0, &col1, &col2, &col3);
|
|
|
|
+ str = AZStd::string::format(" | %.2f %.2f %.2f %.2f |", col0.GetX(), col1.GetX(), col2.GetX(), col3.GetX());
|
|
|
|
+ debugDisplay->Draw2dTextLabel(drawX, drawY, textSize, str.c_str());
|
|
|
|
+ drawY += lineHeight;
|
|
|
|
+ str = AZStd::string::format(" | %.2f %.2f %.2f %.2f |", col0.GetY(), col1.GetY(), col2.GetY(), col3.GetY());
|
|
|
|
+ debugDisplay->Draw2dTextLabel(drawX, drawY, textSize, str.c_str());
|
|
|
|
+ drawY += lineHeight;
|
|
|
|
+ str = AZStd::string::format(" | %.2f %.2f %.2f %.2f |", col0.GetZ(), col1.GetZ(), col2.GetZ(), col3.GetZ());
|
|
|
|
+ debugDisplay->Draw2dTextLabel(drawX, drawY, textSize, str.c_str());
|
|
|
|
+ drawY += lineHeight;
|
|
|
|
+ };
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ using xrc = InputDeviceXRController;
|
|
|
|
+
|
|
|
|
+ // Left controller...
|
|
|
|
+ debugDisplay->SetColor(whiteColor);
|
|
|
|
+ debugDisplay->Draw2dTextLabel(drawX, drawY, textSize, "Left XR Controller");
|
|
|
|
+ drawY += lineHeight;
|
|
|
|
+
|
|
|
|
+ printButtonWithTouchState(xrc::Button::X, xrc::Button::TX, "X");
|
|
|
|
+ printButtonWithTouchState(xrc::Button::Y, xrc::Button::TY, "Y");
|
|
|
|
+ printButtonState(xrc::Button::L3, "L3");
|
|
|
|
+ printButtonState(xrc::Button::Menu, "Menu");
|
|
|
|
+ printButtonTouchOnlyState(xrc::Button::TLRest, "L ThumbRest");
|
|
|
|
+ printAnalogWithTouchState(xrc::Button::TLTrig, "L Trigger", rawControllerData.m_leftTriggerState);
|
|
|
|
+ printAnalogState("L Grip", rawControllerData.m_leftGripState);
|
|
|
|
+ print2DThumbStickWithTouchState(xrc::Button::TLStick, "L Thumb-Stick",
|
|
|
|
+ rawControllerData.m_leftThumbStickXState, rawControllerData.m_leftThumbStickYState);
|
|
|
|
+
|
|
|
|
+ drawY += (2.f * lineHeight);
|
|
|
|
+
|
|
|
|
+ // Right controller...
|
|
|
|
+ debugDisplay->SetColor(whiteColor);
|
|
|
|
+ debugDisplay->Draw2dTextLabel(drawX, drawY, textSize, "Right XR Controller");
|
|
|
|
+ drawY += lineHeight;
|
|
|
|
+
|
|
|
|
+ printButtonWithTouchState(xrc::Button::A, xrc::Button::TA, "A");
|
|
|
|
+ printButtonWithTouchState(xrc::Button::B, xrc::Button::TB, "B");
|
|
|
|
+ printButtonState(xrc::Button::R3, "R3");
|
|
|
|
+ printButtonState(xrc::Button::Home, "Home");
|
|
|
|
+ printButtonTouchOnlyState(xrc::Button::TRRest, "R ThumbRest");
|
|
|
|
+ printAnalogWithTouchState(xrc::Button::TLTrig, "R Trigger", rawControllerData.m_rightTriggerState);
|
|
|
|
+ printAnalogState("R Grip", rawControllerData.m_rightGripState);
|
|
|
|
+ print2DThumbStickWithTouchState(xrc::Button::TRStick, "R Thumb-Stick",
|
|
|
|
+ rawControllerData.m_rightThumbStickXState, rawControllerData.m_rightThumbStickYState);
|
|
|
|
+
|
|
|
|
+ drawY += (2.f * lineHeight);
|
|
|
|
+
|
|
|
|
+ // Positions and Orientation
|
|
|
|
+ printVector3(rawControllerData.m_leftPositionState, "Left Controller Position");
|
|
|
|
+ printMatrix3x4(AZ::Matrix3x4::CreateFromQuaternion(rawControllerData.m_leftOrientationState), "Left Controller Orientation");
|
|
|
|
+ printVector3(rawControllerData.m_rightPositionState, "Right Controller Position");
|
|
|
|
+ printMatrix3x4(AZ::Matrix3x4::CreateFromQuaternion(rawControllerData.m_rightOrientationState), "Right Controller Orientation");
|
|
|
|
+
|
|
|
|
+ // Restore previous state
|
|
|
|
+ debugDisplay->SetState(oldDrawState);
|
|
|
|
+#endif // !AZ_RELEASE_BUILD
|
|
|
|
+ }
|
|
|
|
+
|
|
} // namespace AzFramework
|
|
} // namespace AzFramework
|