nn::hid::CTR::PadReader::StickClampMode Enumerated Type

Syntax

enum StickClampMode;

Values

Value Description
STICK_CLAMP_MODE_CIRCLE Circular clamping. For more details, see the explanation further down on this page.
STICK_CLAMP_MODE_CROSS Cross-shaped clamping. For more details, see the explanation further down on this page.

Description

Enumerated type that indicates the analog stick clamp modes that are set by SetStickClampMode.

STICK_CLAMP_MODE_CIRCLE (Circular Clamping)

Clamps the inner and outer edges in a circle.
Given min and max as the minimum and maximum clamping values set by SetStickClamp:
The clamped coordinates (x', y') are obtained as follows, according to the distance d from the origin to the analog stick's input coordinates (x, y).
If d <= min, (x', y') is equal to (0, 0).
If min < d < max, (x', y') is equal to (d - min) / d * (x, y).
If d >= max, (x', y') is equal to (max - min) / d * (x, y).

STICK_CLAMP_MODE_CROSS (Cross-Shaped Clamping)

Clamps the inner edge in a cross and the outer edge in a circle.
First, x and y from the analog stick's input coordinates (x, y) are clamped independently as follows.
If x < 0, x' is equal to x + min (always less than zero).
If x >= 0, x' is equal to x - min (always greater than zero).
If the distance d from the origin to the coordinates (x', y') is greater than max - min, the clamped coordinates (x', y') are obtained as follows. (x', y') = (max - min) / d * (x,' y')

Revision History

2010/01/07
Initial version.

CONFIDENTIAL