Sophie

Sophie

distrib > Mageia > 5 > x86_64 > by-pkgid > 7281b619e6b612f5388cfad6b0e56530 > files > 418

sdl2-docs-2.0.3-4.mga5.noarch.rpm

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.8"/>
<title>My Project: SDL_HapticDirection Struct Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">My Project
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.8 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="classes.html"><span>Class&#160;Index</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Macros</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark">&#160;</span>Pages</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#pub-attribs">Public Attributes</a> &#124;
<a href="structSDL__HapticDirection-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">SDL_HapticDirection Struct Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>Structure that represents a haptic direction.  
 <a href="structSDL__HapticDirection.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="SDL__haptic_8h_source.html">SDL_haptic.h</a>&gt;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-attribs"></a>
Public Attributes</h2></td></tr>
<tr class="memitem:acd6830ad68c4ba2af16057fa418087cc"><td class="memItemLeft" align="right" valign="top"><a class="el" href="SDL__stdinc_8h.html#a2944638813a090aa23e62f4da842c3e2">Uint8</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structSDL__HapticDirection.html#acd6830ad68c4ba2af16057fa418087cc">type</a></td></tr>
<tr class="separator:acd6830ad68c4ba2af16057fa418087cc"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6cebd8118a3e61e36bd0c503ae020362"><td class="memItemLeft" align="right" valign="top"><a class="el" href="SDL__stdinc_8h.html#a7a90b941db9d4582e9ad7abb9940ff7e">Sint32</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structSDL__HapticDirection.html#a6cebd8118a3e61e36bd0c503ae020362">dir</a> [3]</td></tr>
<tr class="separator:a6cebd8118a3e61e36bd0c503ae020362"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Structure that represents a haptic direction. </p>
<p>Directions can be specified by:</p><ul>
<li><a class="el" href="SDL__haptic_8h.html#acdc35e97e5525472054a67b76e518f3b" title="Uses polar coordinates for the direction. ">SDL_HAPTIC_POLAR</a> : Specified by polar coordinates.</li>
<li><a class="el" href="SDL__haptic_8h.html#af8b2430a363a968de2a5b64c8f663d3b" title="Uses cartesian coordinates for the direction. ">SDL_HAPTIC_CARTESIAN</a> : Specified by cartesian coordinates.</li>
<li><a class="el" href="SDL__haptic_8h.html#a1fcf7cb0eaf3c39b16ba266054e25aff" title="Uses spherical coordinates for the direction. ">SDL_HAPTIC_SPHERICAL</a> : Specified by spherical coordinates.</li>
</ul>
<p>Cardinal directions of the haptic device are relative to the positioning of the device. North is considered to be away from the user.</p>
<p>The following diagram represents the cardinal directions: </p><pre class="fragment">             .--.
             |__| .-------.
             |=.| |.-----.|
             |--| ||     ||
             |  | |'-----'|
             |__|~')_____('
               [ COMPUTER ]


                 North (0,-1)
                     ^
                     |
                     |
(1,0)  West &lt;----[ HAPTIC ]----&gt; East (-1,0)
                     |
                     |
                     v
                  South (0,1)


                  [ USER ]
                    \|||/
                    (o o)
              ---ooO-(_)-Ooo---
</pre><p>If type is <a class="el" href="SDL__haptic_8h.html#acdc35e97e5525472054a67b76e518f3b" title="Uses polar coordinates for the direction. ">SDL_HAPTIC_POLAR</a>, direction is encoded by hundredths of a degree starting north and turning clockwise. <a class="el" href="SDL__haptic_8h.html#acdc35e97e5525472054a67b76e518f3b" title="Uses polar coordinates for the direction. ">SDL_HAPTIC_POLAR</a> only uses the first <code>dir</code> parameter. The cardinal directions would be:</p><ul>
<li>North: 0 (0 degrees)</li>
<li>East: 9000 (90 degrees)</li>
<li>South: 18000 (180 degrees)</li>
<li>West: 27000 (270 degrees)</li>
</ul>
<p>If type is <a class="el" href="SDL__haptic_8h.html#af8b2430a363a968de2a5b64c8f663d3b" title="Uses cartesian coordinates for the direction. ">SDL_HAPTIC_CARTESIAN</a>, direction is encoded by three positions (X axis, Y axis and Z axis (with 3 axes)). <a class="el" href="SDL__haptic_8h.html#af8b2430a363a968de2a5b64c8f663d3b" title="Uses cartesian coordinates for the direction. ">SDL_HAPTIC_CARTESIAN</a> uses the first three <code>dir</code> parameters. The cardinal directions would be:</p><ul>
<li>North: 0,-1, 0</li>
<li>East: -1, 0, 0</li>
<li>South: 0, 1, 0</li>
<li>West: 1, 0, 0</li>
</ul>
<p>The Z axis represents the height of the effect if supported, otherwise it's unused. In cartesian encoding (1, 2) would be the same as (2, 4), you can use any multiple you want, only the direction matters.</p>
<p>If type is <a class="el" href="SDL__haptic_8h.html#a1fcf7cb0eaf3c39b16ba266054e25aff" title="Uses spherical coordinates for the direction. ">SDL_HAPTIC_SPHERICAL</a>, direction is encoded by two rotations. The first two <code>dir</code> parameters are used. The <code>dir</code> parameters are as follows (all values are in hundredths of degrees):</p><ul>
<li>Degrees from (1, 0) rotated towards (0, 1).</li>
<li>Degrees towards (0, 0, 1) (device needs at least 3 axes).</li>
</ul>
<p>Example of force coming from the south with all encodings (force coming from the south means the user will have to pull the stick to counteract): </p><div class="fragment"><div class="line"><a class="code" href="structSDL__HapticDirection.html">SDL_HapticDirection</a> direction;</div>
<div class="line"></div>
<div class="line"><span class="comment">// Cartesian directions</span></div>
<div class="line">direction.<a class="code" href="structSDL__HapticDirection.html#acd6830ad68c4ba2af16057fa418087cc">type</a> = <a class="code" href="SDL__haptic_8h.html#af8b2430a363a968de2a5b64c8f663d3b">SDL_HAPTIC_CARTESIAN</a>; <span class="comment">// Using cartesian direction encoding.</span></div>
<div class="line">direction.<a class="code" href="structSDL__HapticDirection.html#a6cebd8118a3e61e36bd0c503ae020362">dir</a>[0] = 0; <span class="comment">// X position</span></div>
<div class="line">direction.<a class="code" href="structSDL__HapticDirection.html#a6cebd8118a3e61e36bd0c503ae020362">dir</a>[1] = 1; <span class="comment">// Y position</span></div>
<div class="line"><span class="comment">// Assuming the device has 2 axes, we don&#39;t need to specify third parameter.</span></div>
<div class="line"></div>
<div class="line"><span class="comment">// Polar directions</span></div>
<div class="line">direction.<a class="code" href="structSDL__HapticDirection.html#acd6830ad68c4ba2af16057fa418087cc">type</a> = <a class="code" href="SDL__haptic_8h.html#acdc35e97e5525472054a67b76e518f3b">SDL_HAPTIC_POLAR</a>; <span class="comment">// We&#39;ll be using polar direction encoding.</span></div>
<div class="line">direction.<a class="code" href="structSDL__HapticDirection.html#a6cebd8118a3e61e36bd0c503ae020362">dir</a>[0] = 18000; <span class="comment">// Polar only uses first parameter</span></div>
<div class="line"></div>
<div class="line"><span class="comment">// Spherical coordinates</span></div>
<div class="line">direction.<a class="code" href="structSDL__HapticDirection.html#acd6830ad68c4ba2af16057fa418087cc">type</a> = <a class="code" href="SDL__haptic_8h.html#a1fcf7cb0eaf3c39b16ba266054e25aff">SDL_HAPTIC_SPHERICAL</a>; <span class="comment">// Spherical encoding</span></div>
<div class="line">direction.<a class="code" href="structSDL__HapticDirection.html#a6cebd8118a3e61e36bd0c503ae020362">dir</a>[0] = 9000; <span class="comment">// Since we only have two axes we don&#39;t need more parameters.</span></div>
</div><!-- fragment --><dl class="section see"><dt>See also</dt><dd><a class="el" href="SDL__haptic_8h.html#acdc35e97e5525472054a67b76e518f3b" title="Uses polar coordinates for the direction. ">SDL_HAPTIC_POLAR</a> </dd>
<dd>
<a class="el" href="SDL__haptic_8h.html#af8b2430a363a968de2a5b64c8f663d3b" title="Uses cartesian coordinates for the direction. ">SDL_HAPTIC_CARTESIAN</a> </dd>
<dd>
<a class="el" href="SDL__haptic_8h.html#a1fcf7cb0eaf3c39b16ba266054e25aff" title="Uses spherical coordinates for the direction. ">SDL_HAPTIC_SPHERICAL</a> </dd>
<dd>
<a class="el" href="unionSDL__HapticEffect.html" title="The generic template for any haptic effect. ">SDL_HapticEffect</a> </dd>
<dd>
<a class="el" href="SDL__haptic_8h.html#ad6705645197f6df4eeeea32392462483" title="Gets the number of haptic axes the device has. ">SDL_HapticNumAxes</a> </dd></dl>
</div><h2 class="groupheader">Member Data Documentation</h2>
<a class="anchor" id="a6cebd8118a3e61e36bd0c503ae020362"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="SDL__stdinc_8h.html#a7a90b941db9d4582e9ad7abb9940ff7e">Sint32</a> SDL_HapticDirection::dir[3]</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>The encoded direction. </p>

</div>
</div>
<a class="anchor" id="acd6830ad68c4ba2af16057fa418087cc"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="SDL__stdinc_8h.html#a2944638813a090aa23e62f4da842c3e2">Uint8</a> SDL_HapticDirection::type</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>The type of encoding. </p>

</div>
</div>
<hr/>The documentation for this struct was generated from the following file:<ul>
<li><a class="el" href="SDL__haptic_8h_source.html">SDL_haptic.h</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Thu Oct 16 2014 16:33:09 for My Project by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.8
</small></address>
</body>
</html>