Open 3D Engine AzFramework API Reference 23.10.0
O3DE is an open-source, fully-featured, high-fidelity, modular 3D engine for building games and simulations, available to every industry.
AzFramework::InputChannel::PositionData2D Struct Reference

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.
 

Detailed Description

Custom data struct for input channels associated with a 2D position.

Member Function Documentation

◆ ConvertToScreenSpaceCoordinates()

AZ::Vector2 AzFramework::InputChannel::PositionData2D::ConvertToScreenSpaceCoordinates ( float  screenWidth,
float  screenHeight 
) const

Convenience function to convert the normalized position to screen space coordinates

Parameters
[in]screenWidthThe width of the screen to use in the conversion
[in]screenHeightThe height of the screen to use in the conversion
Returns
The position in screen space coordinates

◆ UpdateNormalizedPositionAndDelta()

void AzFramework::InputChannel::PositionData2D::UpdateNormalizedPositionAndDelta ( const AZ::Vector2 &  newNormalizedPosition)

Update both m_normalizedPosition and m_normalizedPositionDelta given a new position

Parameters
[in]newNormalizedPositionThe new normalized position

Member Data Documentation

◆ m_normalizedPosition

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)


The documentation for this struct was generated from the following file: