PADClamp

Syntax

#include <cafe/pad.h>

void PADClamp(PADStatus* status);

Parameters

status Array [PAD_MAX_CONTROLLERS] of PADStatus to be clamped.
If the err member holds PAD_ERR_NONE, the analog stick input value is clamped according to the algorithm below.

Return Values

None.

Description

Clamps the input from the analog sticks. The PADClamp function takes an array of PADStatus type as an argument. The number of elements in this array is determined by PAD_MAX_CONTROLLERS. This function clamps all PADStatus objects at once.

Clamping Algorithm (analog sticks): PADClamp performs dead-zone and outer-octagon clamping for analog sticks as illustrated below. For the Control Stick, the function first clamps dead zones along both axes (±15), and then it clamps the outside of the octagon whose lengths from the center to its vertices are 72 (x = 0 or y = 0) and 56.6 (x = ±y). For the C-Stick (substick), the function first clamps dead zones along both axes (±15), and then it clamps along the outside of the octagon whose lengths from the center to its vertices are 59 (x = 0 or y = 0) and 43.8 (x = ±y).

padclamp.gif (10904 bytes)

Clamping Algorithm (analog trigger): PADClamp clamps the dead zone and outer zone of the analog trigger. The dead zone from 0 to 30 and the external zone from 180-255 are clamped. The trigger return value is between 0 and 150.

Do Not Call From

Background Do not call this function from the background.
Production code Do not call this function in production code. It is available only for debugging purposes.

See Also

PADRead
PADStatus

Revision History

2013-05-08 Automated cleanup pass.
2012-08-21 Cleanup Pass
2011-02-03 Initial version.


CONFIDENTIAL