libultraship
Reimplementations of libultra (N64 SDK) functions for modern hardware
Loading...
Searching...
No Matches
Ship::WheelHandler Class Reference

Tracks mouse scroll-wheel state and converts it into axis-like values consumable by the input mapping system. More...

#include <WheelHandler.h>

Public Member Functions

 WheelHandler (std::shared_ptr< Window > window)
 Constructs a WheelHandler with default (zero) state.
 
 ~WheelHandler ()
 Destructor.
 
void Update ()
 Samples the latest wheel data from the window back-end.
 
CoordsF GetCoords ()
 Returns the raw scroll-wheel coordinates for the current frame.
 
WheelDirections GetDirections ()
 Returns the current horizontal and vertical scroll directions.
 
float GetDirectionValue (WheelDirection direction)
 Returns the instantaneous direction value for the given wheel direction.
 
float GetBufferedDirectionValue (WheelDirection direction)
 Returns the buffered (smoothed) direction value for the given wheel direction.
 

Detailed Description

Tracks mouse scroll-wheel state and converts it into axis-like values consumable by the input mapping system.

Call Update() once per frame to sample the latest wheel data from the window back-end. The resulting direction values and buffered values can then be queried by MouseWheelToAxisDirectionMapping and related classes.

Constructor & Destructor Documentation

◆ WheelHandler()

Ship::WheelHandler::WheelHandler ( std::shared_ptr< Window window)

Constructs a WheelHandler with default (zero) state.

◆ ~WheelHandler()

Ship::WheelHandler::~WheelHandler ( )

Destructor.

Member Function Documentation

◆ GetBufferedDirectionValue()

float Ship::WheelHandler::GetBufferedDirectionValue ( WheelDirection  direction)

Returns the buffered (smoothed) direction value for the given wheel direction.

Parameters
directionThe wheel direction to query.
Returns
The buffered direction magnitude as a float.

◆ GetCoords()

CoordsF Ship::WheelHandler::GetCoords ( )

Returns the raw scroll-wheel coordinates for the current frame.

Returns
A CoordsF with x (horizontal) and y (vertical) scroll amounts.

◆ GetDirections()

WheelDirections Ship::WheelHandler::GetDirections ( )

Returns the current horizontal and vertical scroll directions.

Returns
A WheelDirections struct.

◆ GetDirectionValue()

float Ship::WheelHandler::GetDirectionValue ( WheelDirection  direction)

Returns the instantaneous direction value for the given wheel direction.

Parameters
directionThe wheel direction to query.
Returns
The direction magnitude as a float.

◆ Update()

void Ship::WheelHandler::Update ( )

Samples the latest wheel data from the window back-end.


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