#include <cafe/pad.h> void PADClampCircle(PADStatus* status);
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
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.
|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.|
2013-05-08 Automated cleanup pass.
2011-02-03 Initial version.