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>Syntax</h2> 17<dl><dd><pre class="construction"> 18#include <revolution/pad.h> 19 20void PADClampCircle(<a href="PADStatus.html">PADStatus</a>* status); 21</pre></dd></dl> 22 23<h2>Arguments</h2> 24<TABLE class="arguments" border="1" > 25 <tr> 26<TH>status</TH> 27<TD>Array [<code>PAD_MAX_CONTROLLERS</code>] of <A href="PADStatus.html"><code>PADStatus</code></A> structures to be clamped. If the <SPAN class="argument">err</SPAN> members store <code>PAD_ERR_NONE</code>, the analog stick input value is clamped according to the algorithm below.</TD> 28 </tr> 29</TABLE> 30 31<h2>Return Values</h2> 32<P>None.</P> 33 34<h2>Description</h2> 35<P>Clamps the inputs of the controller analog stick inputs. The <code>PADClampCircle</code> function takes an array of <A href="PADStatus.html"><code>PADStatus</code></A>-type structures as an argument. The number of elements in this array is indicated by <code>PAD_MAX_CONTROLLERS</code>. <code>PADClampCircle</code> clamps all <A href="PADStatus.html"><code>PADStatus</code></A> once.</P> 36<P>A point of difference with the <A href="PADClamp.html"><code>PADClamp</code></A> function is that the analog stick is clamped within a circle rather than an octagon. Since clamping in a circle results in a consistent, maximum speed regardless of the stick direction, this fact may be important if a character's speed is being controlled using the stick value. Although clamping is performed in a narrower range than <A href="PADClamp.html"><code>PADClamp</code></A>, it represents a suitable compromise to achieve a fixed maximum value. An accurate comparison of the two types of clamping range for the controller stick is given below. (The same figure applies to the C Stick.)</P> 37<p><img src="images/padclampcompare.gif" alt="padclampcompare.gif (4793 bytes)" width="470" height="403"></p> 38<P><B>Clamping Algorithm</B> (analog sticks): <code>PADClampCircle</code> performs dead-zone and outer-circle clamping for analog sticks as illustrated below. This function first clamps the dead zone (±15) along both axes, and then clamps the outer circle having a radius of 56. This function first clamps the dead zone (±15) along both axes for the C stick, and then clamps the outer circle having a radius of 44.</P> 39<p><img src="images/padclampcircle.gif" alt="padclampcircle.gif (16747 bytes)" width="575" height="626"></p> 40<P><B>Clamping algorithm</B> (analog trigger): <code>PADClampCircle</code> clamps the dead zone (0 to 30) and outer zone (180 to 255) of the analog trigger buttons. The trigger return value is between 0 and 150.</P> 41 42<h2>See Also</h2> 43<p class="reference"> 44<a href="PADClamp.html">PADClamp</a>, 45<a href="PADInit.html">PADInit</a>, 46<a href="PADRead.html">PADRead</a>, 47<a href="PADStatus.html">PADStatus</a> 48</p> 49 50<H2>Revision History</H2> 51<P> 522006/03/01 Initial version.<br> 53</p> 54 55<hr><p>CONFIDENTIAL</p></body> 56</html>