Custom data struct for input channels associated with a 2D position. More...
#include <InputChannel.h>
Inherits AzFramework::InputChannel::CustomData.
Public Member Functions | |
AZ_CLASS_ALLOCATOR (PositionData2D, AZ::SystemAllocator) | |
AZ_RTTI (PositionData2D, "{354437EC-6BFD-41D4-A0F2-7740018D3589}", CustomData) | |
AZ::Vector2 | ConvertToScreenSpaceCoordinates (float screenWidth, float screenHeight) const |
void | UpdateNormalizedPositionAndDelta (const AZ::Vector2 &newNormalizedPosition) |
Public Member Functions inherited from AzFramework::InputChannel::CustomData | |
AZ_CLASS_ALLOCATOR (CustomData, AZ::SystemAllocator) | |
AZ_RTTI (CustomData, "{887E38BB-64AF-4F4E-A1AE-C1B02371F9EC}") | |
Public Attributes | |
AZ::Vector2 | m_normalizedPosition = AZ::Vector2(0.5f, 0.5f) |
AZ::Vector2 | m_normalizedPositionDelta = AZ::Vector2::CreateZero() |
The delta between the current normalized position and the last one. | |
Custom data struct for input channels associated with a 2D position.
AZ::Vector2 AzFramework::InputChannel::PositionData2D::ConvertToScreenSpaceCoordinates | ( | float | screenWidth, |
float | screenHeight | ||
) | const |
Convenience function to convert the normalized position to screen space coordinates
[in] | screenWidth | The width of the screen to use in the conversion |
[in] | screenHeight | The height of the screen to use in the conversion |
void AzFramework::InputChannel::PositionData2D::UpdateNormalizedPositionAndDelta | ( | const AZ::Vector2 & | newNormalizedPosition | ) |
Update both m_normalizedPosition and m_normalizedPositionDelta given a new position
[in] | newNormalizedPosition | The new normalized position |
AZ::Vector2 AzFramework::InputChannel::PositionData2D::m_normalizedPosition = AZ::Vector2(0.5f, 0.5f) |
Normalized screen coordinates, where the top-left of the screen is at (0.0, 0.0) and the bottom-right is at (1.0, 1.0)