Sophie

Sophie

distrib > Mageia > 7 > armv7hl > media > core-updates > by-pkgid > bf9e3bc1aec7873c087fb2ccd927873f > files > 422

sdl2-docs-2.0.10-1.mga7.noarch.rpm

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://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.15"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<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/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></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 id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">My Project
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.15 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</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">Uint8&#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">Sint32&#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>This is the direction where the force comes from, instead of the direction in which the force is exerted.</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 id="a6cebd8118a3e61e36bd0c503ae020362"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a6cebd8118a3e61e36bd0c503ae020362">&#9670;&nbsp;</a></span>dir</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">Sint32 SDL_HapticDirection::dir[3]</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>The encoded direction. </p>

</div>
</div>
<a id="acd6830ad68c4ba2af16057fa418087cc"></a>
<h2 class="memtitle"><span class="permalink"><a href="#acd6830ad68c4ba2af16057fa418087cc">&#9670;&nbsp;</a></span>type</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">Uint8 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 by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.15
</small></address>
</body>
</html>