1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2<html>
3
4<head>
5<META http-equiv="Content-Type" content="text/html; charset=windows-1252">
6<META name="GENERATOR" content="Microsoft FrontPage 5.0">
7<META http-equiv="Content-Style-Type" content="text/css">
8<LINK rel="stylesheet" type="text/css" href="../CSS/revolution.css">
9<title>PADClampCircle</title>
10</head>
11
12<body>
13
14<h1>PADClampCircle</h1>
15
16<h2>C Specification</h2>
17
18<dl>
19  <dd><pre><code>#include &lt;revolution/pad.h&gt;</code></pre>
20  </dd>
21  <dd><pre><CODE>void PADClampCircle(<a href="PADStatus.html">PADStatus</a>* status);</CODE></pre>
22  </dd>
23</dl>
24<h2>Arguments</h2>
25<TABLE border="1" cellpadding="3" cellspacing="0.1">
26
27    <tr>
28<TD width="120" bgcolor="#ffffe8"><code><strong><em>status</em></strong></code></TD>
29<TD width="520">Array [<code>PAD_MAX_CONTROLLERS</code>] of <a href="PADStatus.html"><code>PADStatus</code></a> objects to be clamped. <BR>If the <CODE>err</CODE> member is <code>PAD_ERR_NONE</code>, the analog stick input value is clamped according to the algorithm below.</TD>
30    </tr>
31
32</TABLE>
33<h2>Return Values</h2>
34<P>None.</P>
35<h2>Description</h2>
36<P>This function clamps the analog stick inputs. This function takes an array of <a href="PADStatus.html"><code>PADStatus</code></a> types as an argument. The number of elements in this array is determined by <code>PAD_MAX_CONTROLLERS</code>. <code>PADClampCircle</code> clamps all <A href="PADStatus.html"><code>PADStatus</code></A> at the same time.</P>
37<P>This differs from <A href="PADClamp.html"><code>PADClamp</code></A> 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 <A href="PADClamp.html"><code>PADClamp</code></A>, 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.)</P>
38<p><img src="images/padclampcompare.gif" alt="padclampcompare.gif (4793 bytes)" width="470" height="403"></p>
39<P><em><strong>Clamping Algorithm</strong> (analog sticks)</em>: <code>PADClampCircle</code> performs dead-zone and outer-circle clamping for analog sticks as illustrated below. For the Control Stick, this function first clamps the deadzone (&plusmn;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 (&plusmn;15) along both axes, and then clamps an outer circle having a radius of 44. </P>
40<p><img src="images/padclampcircle.gif" alt="padclampcircle.gif (16747 bytes)" width="575" height="626"></p>
41<P><em><strong>Clamping Algorithm</strong> (analog trigger)</em>: <CODE>PADClampCircle</CODE> 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.</P>
42
43
44<h2>See Also</h2>
45
46<p><a href="toc.html" target="contents">Controller Functions</a>, <code><a href="PADClamp.html">PADClamp</a></code>, <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>
47<H2>Revision History</H2>
48<P>2006/03/01 Initial version.</p>
49<hr>
50<P>CONFIDENTIAL</p>
51</BODY>
52</HTML>