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>PADClamp2</TITLE>
9</HEAD>
10<BODY>
11<H1>PADClamp2</H1>
12
13<H2>Syntax</H2>
14<dl><dd><pre class="construction">
15#include &lt;revolution/pad.h&gt;
16
17#define PAD_STICK_CLAMP_OCTA_WITH_MARGE         0
18#define PAD_STICK_CLAMP_OCTA_WITHOUT_MARGE      1
19
20void PADClamp2(<A href="PADStatus.html">PADStatus</A>* status, u32 type );
21</pre></dd></dl>
22
23<H2>Arguments</H2>
24<TABLE class="arguments" border="1" >
25  <TBODY>
26    <TR>
27<TH>status</TH>
28<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>
29    </TR>
30    <TR>
31<TH>type</TH>
32<TD>One of <code>PAD_STICK_CLAMP_OCTA_*</code></TD>
33    </TR>
34  </TBODY>
35</TABLE>
36
37<H2>Return Values</H2>
38<P>None.</P>
39
40<H2>Description</H2>
41<P>This function allows the value of analog stick input to be obtained in a broader range than is possible with the <CODE>PADClamp</CODE> function used with the Dolphin SDK. The <code>PADClamp2</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 indicated by <CODE>PAD_MAX_CONTROLLERS</CODE>. This function clamps all the <A href="PADStatus.html"><CODE>PADStatus</CODE></A> data at once.
42</P>
43<p>Unlike the <CODE>PADClamp</CODE> function, this function does not clamp analog trigger input.</p>
44<p>
45<B>Clamp algorithm</B> (Analog stick): Specifications can be made using <SPAN class="argument">type</SPAN> as shown in the figure below. <BR>If <code>PAD_STICK_CLAMP_OCTA_WITH_MARGE</code> is specified, the dead zone of the analog stick is clamped and the outside of an octagonal or circular shape is clamped. This function allows the value of analog stick input to be obtained in a broader range than is possible with the <CODE>PADClamp</CODE> function used with the Dolphin SDK. If <code>PAD_STICK_CLAMP_OCTA_WITHOUT_MARGE</code> has been specified, only the outside of the octagonal or circular shape is clamped without clamping the deadzone. More accurate movement in the diagonal direction that straddles each axis can be gotten when the dead zone is not clamped.
46</p>
47
48<P><IMG src="images/padclampM1.gif" alt="padclampM1.gif" width="585" height="390"></P>
49<P><IMG src="images/padclampM2.gif" alt="padclampM2.gif" width="585" height="390"></P>
50<P><IMG src="images/padclampC1.gif" alt="padclampC1.gif" width="585" height="390"></P>
51<P><IMG src="images/padclampC2.gif" alt="padclampC2.gif" width="585" height="390"></P>
52
53
54<H2>See Also</H2>
55<P class="reference">
56<A href="PADClamp.html">PADClamp</A>,
57<A href="PADInit.html">PADInit</A>,
58<A href="PADRead.html">PADRead</A>,
59<A href="PADStatus.html">PADStatus</A>
60</P>
61
62<H2>Revision History</H2>
63<P>
642006/09/07 Initial version.<br>
65</P>
66
67<hr><p>CONFIDENTIAL</p></body>
68</HTML>