#include <revolution/pad.h>
void PADClampCircle(PADStatus* status);
status |
Array [PAD_MAX_CONTROLLERS] of PADStatus objects to be clamped. If the err member is PAD_ERR_NONE, the analog stick input value is clamped according to the algorithm below. |
None.
This function clamps the analog stick inputs. This function takes an array of PADStatus types as an argument. The number of elements in this array is determined by PAD_MAX_CONTROLLERS. PADClampCircle clamps all PADStatus at the same time.
This differs from PADClamp in that the analog stick is clamped within a circle rather than an octagon. Since clamping to a circle results in a consistent, maximum speed regardless of the stick direction, this may be important if the stick value is used for controlling a character's speed. Although this makes the range narrower than that from PADClamp, that compromise allows for a fixed maximum value to be achieved. An accurate comparison of the two clamping range types for the controller stick is given below. (The same figure applies to the C Stick.)

Clamping Algorithm (analog sticks): PADClampCircle performs dead-zone and outer-circle clamping for analog sticks as illustrated below. For the Control Stick, this function first clamps the deadzone (±15) along both axes, and then clamps an outer circle having a radius of 56. For the C Stick, this function first clamps the deadzone (±15) along both axes, and then clamps an outer circle having a radius of 44.

Clamping Algorithm (analog trigger): PADClampCircle clamps the dead zone (0 to 30) and outer zone (180 to 255) of the analog trigger. The trigger return value is between 0 and 150.
Controller Functions, PADClamp, PADInit, PADRead, PADStatus
2006/03/01 Initial version.
CONFIDENTIAL