1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2<HTML>
3<HEAD>
4<META http-equiv="Content-Type" content="text/html; charset=windows-1252">
5<META name="GENERATOR" content="Microsoft FrontPage 5.0">
6<META http-equiv="Content-Style-Type" content="text/css">
7<LINK rel="stylesheet" type="text/css" href="../CSS/revolution.css">
8<TITLE>PADClamp</TITLE>
9</HEAD>
10<BODY>
11<H1>PADClamp</H1>
12<H2>C Specification</H2>
13<DL>
14  <DD>
15<PRE><CODE>#include &lt;revolution/pad.h&gt;</CODE></PRE>
16  <DD>
17<PRE><CODE>void PADClamp(<A href="PADStatus.html">PADStatus</A>* status);</CODE></PRE>
18</DL>
19<H2>Arguments</H2>
20<TABLE border="1" cellpadding="3" cellspacing="0.1">
21  <TBODY>
22    <TR>
23<TD width="120" bgcolor="#ffffe8"><CODE><STRONG><EM>status</EM></STRONG></CODE></TD>
24<TD width="520">Array [<code>PAD_MAX_CONTROLLERS</code>] of <a href="PADStatus.html"><code>PADStatus</code></a> to be clamped. <BR>If the <CODE>err</CODE> member holds <code>PAD_ERR_NONE</code>, the analog stick input value is clamped according to the algorithm below.</TD>
25    </TR>
26  </TBODY>
27</TABLE>
28<H2>Return Values</H2>
29<P>None.</P>
30<H2>Description</H2>
31<P>Clamps the input from the analog sticks. The <CODE>PADClamp</CODE> function takes an array of <a href="PADStatus.html"><code>PADStatus</code></a> type as an argument. The number of elements in this array is determined by <code>PAD_MAX_CONTROLLERS</code>. This function clamps all <a href="PADStatus.html"><code>PADStatus</code></a> objects at once.</P>
32<P><em><strong>Clamping Algorithm</strong> (analog sticks)</em>: <code>PADClamp</code> 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 (&plusmn;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 = &plusmn;y). For the C-Stick (substick), the function first clamps dead zones along both axes (&plusmn;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 = &plusmn;y).</P>
33<P><IMG src="images/padclamp.gif" alt="padclamp.gif (10904 bytes)" width="600" height="731"></P>
34<P><em><strong>Clamping Algorithm</strong> (analog trigger)</em>: <CODE>PADClamp</CODE> 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.</P>
35
36
37<H2>See Also</H2>
38<P><A href="toc.html" target="contents">Controller Functions</A>, <CODE><A href="PADInit.html">PADInit</A></CODE>, <A href="PADRead.html"><CODE>PADRead</CODE></A>, <CODE><A href="PADStatus.html">PADStatus</A></CODE></P>
39<H2>Revision History</H2>
40<P>2006/03/01 Initial version.</P>
41<hr>
42<P>CONFIDENTIAL</p>
43</BODY>
44</HTML>