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 13<H2>Syntax</H2> 14<dl><dd><pre class="construction"> 15#include <revolution/pad.h> 16 17void PADClamp(<A href="PADStatus.html">PADStatus</A>* status); 18</pre></dd></dl> 19 20<H2>Arguments</H2> 21<TABLE class="arguments" border="1" > 22 <TBODY> 23 <TR> 24<TH>status</TH> 25<TD>Array [<CODE>PAD_MAX_CONTROLLERS</CODE>] of <A href="PADStatus.html"><CODE>PADStatus</CODE></A> to be clamped. If the <SPAN class="argument">err</SPAN> member stores <CODE>PAD_ERR_NONE</CODE>, the analog stick input value is clamped according to the algorithm below.</TD> 26 </TR> 27 </TBODY> 28</TABLE> 29 30<H2>Return Values</H2> 31<P>None.</P> 32 33<H2>Description</H2> 34<P>Clamps the inputs of the controller analog stick inputs. The <code>PADClamp</code> function takes an array of <a href="PADStatus.html"><code>PADStatus</code></a> as an argument. The number of elements in this array is indicated by <CODE>PAD_MAX_CONTROLLERS</CODE>. This function clamps all the <A href="PADStatus.html"><CODE>PADStatus</CODE></A> data at once.</P> 35<P>Clamping Algorithm (analog sticks): <CODE>PADClamp</CODE> performs dead-zone and outer-octagon clamping for analog sticks as illustrated below. For the Control Stick, this function first clamps dead zones along both axes (±15), and then it clamps along the outer octagon whose length from the center to 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).</P> 36<P><IMG src="images/padclamp.gif" alt="padclamp.gif (10904 bytes)" width="600" height="731"></P> 37<P>Clamp algorithm (analog trigger): <CODE>PADClamp</CODE> clamps the dead zone and outer zone of the analog trigger. The dead zone is clamped from 0 to 30 and the external zone is clamped from 180 to 255. The trigger return value is between 0 and 150.</P> 38 39<H2>See Also</H2> 40<P class="reference"> 41<A href="PADInit.html">PADInit</A>, 42<A href="PADRead.html">PADRead</A>, 43<A href="PADStatus.html">PADStatus</A> 44</P> 45 46<H2>Revision History</H2> 47<P> 482006/03/01 Initial version.<br> 49</P> 50 51<hr><p>CONFIDENTIAL</p></body> 52</HTML>