You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

346 lines
22 KiB

  1. <!DOCTYPE HTML>
  2. <html lang="de">
  3. <head>
  4. <!-- Generated by javadoc (17) on Fri Jun 03 11:30:18 CEST 2022 -->
  5. <title>Collider</title>
  6. <meta name="viewport" content="width=device-width, initial-scale=1">
  7. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  8. <meta name="dc.created" content="2022-06-03">
  9. <meta name="description" content="declaration: package: collider, class: Collider">
  10. <meta name="generator" content="javadoc/ClassWriterImpl">
  11. <link rel="stylesheet" type="text/css" href="../stylesheet.css" title="Style">
  12. <link rel="stylesheet" type="text/css" href="../script-dir/jquery-ui.min.css" title="Style">
  13. <link rel="stylesheet" type="text/css" href="../jquery-ui.overrides.css" title="Style">
  14. <script type="text/javascript" src="../script.js"></script>
  15. <script type="text/javascript" src="../script-dir/jquery-3.5.1.min.js"></script>
  16. <script type="text/javascript" src="../script-dir/jquery-ui.min.js"></script>
  17. </head>
  18. <body class="class-declaration-page">
  19. <script type="text/javascript">var evenRowColor = "even-row-color";
  20. var oddRowColor = "odd-row-color";
  21. var tableTab = "table-tab";
  22. var activeTableTab = "active-table-tab";
  23. var pathtoroot = "../";
  24. loadScripts(document, 'script');</script>
  25. <noscript>
  26. <div>JavaScript is disabled on your browser.</div>
  27. </noscript>
  28. <div class="flex-box">
  29. <header role="banner" class="flex-header">
  30. <nav role="navigation">
  31. <!-- ========= START OF TOP NAVBAR ======= -->
  32. <div class="top-nav" id="navbar-top">
  33. <div class="skip-nav"><a href="#skip-navbar-top" title="Skip navigation links">Skip navigation links</a></div>
  34. <ul id="navbar-top-firstrow" class="nav-list" title="Navigation">
  35. <li><a href="../index.html">Overview</a></li>
  36. <li><a href="package-summary.html">Package</a></li>
  37. <li class="nav-bar-cell1-rev">Class</li>
  38. <li><a href="class-use/Collider.html">Use</a></li>
  39. <li><a href="package-tree.html">Tree</a></li>
  40. <li><a href="../index-files/index-1.html">Index</a></li>
  41. <li><a href="../help-doc.html#class">Help</a></li>
  42. </ul>
  43. </div>
  44. <div class="sub-nav">
  45. <div>
  46. <ul class="sub-nav-list">
  47. <li>Summary:&nbsp;</li>
  48. <li>Nested&nbsp;|&nbsp;</li>
  49. <li><a href="#field-summary">Field</a>&nbsp;|&nbsp;</li>
  50. <li><a href="#constructor-summary">Constr</a>&nbsp;|&nbsp;</li>
  51. <li><a href="#method-summary">Method</a></li>
  52. </ul>
  53. <ul class="sub-nav-list">
  54. <li>Detail:&nbsp;</li>
  55. <li><a href="#field-detail">Field</a>&nbsp;|&nbsp;</li>
  56. <li><a href="#constructor-detail">Constr</a>&nbsp;|&nbsp;</li>
  57. <li><a href="#method-detail">Method</a></li>
  58. </ul>
  59. </div>
  60. <div class="nav-list-search"><label for="search-input">SEARCH:</label>
  61. <input type="text" id="search-input" value="search" disabled="disabled">
  62. <input type="reset" id="reset-button" value="reset" disabled="disabled">
  63. </div>
  64. </div>
  65. <!-- ========= END OF TOP NAVBAR ========= -->
  66. <span class="skip-nav" id="skip-navbar-top"></span></nav>
  67. </header>
  68. <div class="flex-content">
  69. <main role="main">
  70. <!-- ======== START OF CLASS DATA ======== -->
  71. <div class="header">
  72. <div class="sub-title"><span class="package-label-in-type">Package</span>&nbsp;<a href="package-summary.html">collider</a></div>
  73. <h1 title="Class Collider" class="title">Class Collider</h1>
  74. </div>
  75. <div class="inheritance" title="Inheritance Tree"><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html" title="class or interface in java.lang" class="external-link">java.lang.Object</a>
  76. <div class="inheritance">collider.Collider</div>
  77. </div>
  78. <section class="class-description" id="class-description">
  79. <dl class="notes">
  80. <dt>Direct Known Subclasses:</dt>
  81. <dd><code><a href="CircleCollider.html" title="class in collider">CircleCollider</a></code>, <code><a href="RectCollider.html" title="class in collider">RectCollider</a></code></dd>
  82. </dl>
  83. <hr>
  84. <div class="type-signature"><span class="modifiers">public abstract class </span><span class="element-name type-name-label">Collider</span>
  85. <span class="extends-implements">extends <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a></span></div>
  86. <div class="block">abstract base class for all Colliders to detect collisions between GameObjects</div>
  87. </section>
  88. <section class="summary">
  89. <ul class="summary-list">
  90. <!-- =========== FIELD SUMMARY =========== -->
  91. <li>
  92. <section class="field-summary" id="field-summary">
  93. <h2>Field Summary</h2>
  94. <div class="caption"><span>Fields</span></div>
  95. <div class="summary-table three-column-summary">
  96. <div class="table-header col-first">Modifier and Type</div>
  97. <div class="table-header col-second">Field</div>
  98. <div class="table-header col-last">Description</div>
  99. <div class="col-first even-row-color"><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a></code></div>
  100. <div class="col-second even-row-color"><code><a href="#id" class="member-name-link">id</a></code></div>
  101. <div class="col-last even-row-color">
  102. <div class="block">unique internal name for Collider</div>
  103. </div>
  104. </div>
  105. </section>
  106. </li>
  107. <!-- ======== CONSTRUCTOR SUMMARY ======== -->
  108. <li>
  109. <section class="constructor-summary" id="constructor-summary">
  110. <h2>Constructor Summary</h2>
  111. <div class="caption"><span>Constructors</span></div>
  112. <div class="summary-table two-column-summary">
  113. <div class="table-header col-first">Constructor</div>
  114. <div class="table-header col-last">Description</div>
  115. <div class="col-constructor-name even-row-color"><code><a href="#%3Cinit%3E(java.lang.String,gameobjects.GameObject)" class="member-name-link">Collider</a><wbr>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;id,
  116. <a href="../gameobjects/GameObject.html" title="class in gameobjects">GameObject</a>&nbsp;o)</code></div>
  117. <div class="col-last even-row-color">&nbsp;</div>
  118. </div>
  119. </section>
  120. </li>
  121. <!-- ========== METHOD SUMMARY =========== -->
  122. <li>
  123. <section class="method-summary" id="method-summary">
  124. <h2>Method Summary</h2>
  125. <div id="method-summary-table">
  126. <div class="table-tabs" role="tablist" aria-orientation="horizontal"><button id="method-summary-table-tab0" role="tab" aria-selected="true" aria-controls="method-summary-table.tabpanel" tabindex="0" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table', 3)" class="active-table-tab">All Methods</button><button id="method-summary-table-tab2" role="tab" aria-selected="false" aria-controls="method-summary-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table-tab2', 3)" class="table-tab">Instance Methods</button><button id="method-summary-table-tab3" role="tab" aria-selected="false" aria-controls="method-summary-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table-tab3', 3)" class="table-tab">Abstract Methods</button><button id="method-summary-table-tab4" role="tab" aria-selected="false" aria-controls="method-summary-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table-tab4', 3)" class="table-tab">Concrete Methods</button></div>
  127. <div id="method-summary-table.tabpanel" role="tabpanel">
  128. <div class="summary-table three-column-summary" aria-labelledby="method-summary-table-tab0">
  129. <div class="table-header col-first">Modifier and Type</div>
  130. <div class="table-header col-second">Method</div>
  131. <div class="table-header col-last">Description</div>
  132. <div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code>abstract boolean</code></div>
  133. <div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><a href="#collidesWith(collider.Collider)" class="member-name-link">collidesWith</a><wbr>(<a href="Collider.html" title="class in collider">Collider</a>&nbsp;other)</code></div>
  134. <div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3">
  135. <div class="block">checks the collission with another collider instance.</div>
  136. </div>
  137. <div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a></code></div>
  138. <div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getId()" class="member-name-link">getId</a>()</code></div>
  139. <div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
  140. <div class="block">returns the internal unique name</div>
  141. </div>
  142. <div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>double</code></div>
  143. <div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getX()" class="member-name-link">getX</a>()</code></div>
  144. <div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
  145. <div class="block">returns the corresponding game objects X coordinate (center) plus this colliders offset in X
  146. (probably zero).</div>
  147. </div>
  148. <div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>double</code></div>
  149. <div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getY()" class="member-name-link">getY</a>()</code></div>
  150. <div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
  151. <div class="block">returns the corresponding game objects Y coordinate (center) plus this colliders offset in Y
  152. (probably zero).</div>
  153. </div>
  154. <div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>void</code></div>
  155. <div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#setController(controller.ObjectController)" class="member-name-link">setController</a><wbr>(<a href="../controller/ObjectController.html" title="class in controller">ObjectController</a>&nbsp;controller)</code></div>
  156. <div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
  157. <div class="block">setter for GameController</div>
  158. </div>
  159. <div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>void</code></div>
  160. <div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#setObject(gameobjects.GameObject)" class="member-name-link">setObject</a><wbr>(<a href="../gameobjects/GameObject.html" title="class in gameobjects">GameObject</a>&nbsp;gameObject)</code></div>
  161. <div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
  162. <div class="block">setter for corresponding GameObject</div>
  163. </div>
  164. <div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="Collider.html" title="class in collider">Collider</a></code></div>
  165. <div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#setOffsets(double,double)" class="member-name-link">setOffsets</a><wbr>(double&nbsp;dx,
  166. double&nbsp;dy)</code></div>
  167. <div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
  168. <div class="block">setter for offset values to be used relative to GameObject center. default is zero.</div>
  169. </div>
  170. <div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>void</code></div>
  171. <div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#setPlayground(playground.Playground)" class="member-name-link">setPlayground</a><wbr>(<a href="../playground/Playground.html" title="class in playground">Playground</a>&nbsp;playground)</code></div>
  172. <div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
  173. <div class="block">setter for Playground instance this collider belongs to</div>
  174. </div>
  175. <div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a></code></div>
  176. <div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#toString()" class="member-name-link">toString</a>()</code></div>
  177. <div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">&nbsp;</div>
  178. </div>
  179. </div>
  180. </div>
  181. <div class="inherited-list">
  182. <h3 id="methods-inherited-from-class-java.lang.Object">Methods inherited from class&nbsp;java.lang.<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a></h3>
  183. <code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals(java.lang.Object)" title="class or interface in java.lang" class="external-link">equals</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass()" title="class or interface in java.lang" class="external-link">getClass</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode()" title="class or interface in java.lang" class="external-link">hashCode</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify()" title="class or interface in java.lang" class="external-link">notify</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll()" title="class or interface in java.lang" class="external-link">notifyAll</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait()" title="class or interface in java.lang" class="external-link">wait</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long)" title="class or interface in java.lang" class="external-link">wait</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait(long,int)" title="class or interface in java.lang" class="external-link">wait</a></code></div>
  184. </section>
  185. </li>
  186. </ul>
  187. </section>
  188. <section class="details">
  189. <ul class="details-list">
  190. <!-- ============ FIELD DETAIL =========== -->
  191. <li>
  192. <section class="field-details" id="field-detail">
  193. <h2>Field Details</h2>
  194. <ul class="member-list">
  195. <li>
  196. <section class="detail" id="id">
  197. <h3>id</h3>
  198. <div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a></span>&nbsp;<span class="element-name">id</span></div>
  199. <div class="block">unique internal name for Collider</div>
  200. </section>
  201. </li>
  202. </ul>
  203. </section>
  204. </li>
  205. <!-- ========= CONSTRUCTOR DETAIL ======== -->
  206. <li>
  207. <section class="constructor-details" id="constructor-detail">
  208. <h2>Constructor Details</h2>
  209. <ul class="member-list">
  210. <li>
  211. <section class="detail" id="&lt;init&gt;(java.lang.String,gameobjects.GameObject)">
  212. <h3>Collider</h3>
  213. <div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="element-name">Collider</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;id,
  214. <a href="../gameobjects/GameObject.html" title="class in gameobjects">GameObject</a>&nbsp;o)</span></div>
  215. <dl class="notes">
  216. <dt>Parameters:</dt>
  217. <dd><code>id</code> - unique name for Collider (internally)</dd>
  218. <dd><code>o</code> - GameObject instance it belongs to</dd>
  219. </dl>
  220. </section>
  221. </li>
  222. </ul>
  223. </section>
  224. </li>
  225. <!-- ============ METHOD DETAIL ========== -->
  226. <li>
  227. <section class="method-details" id="method-detail">
  228. <h2>Method Details</h2>
  229. <ul class="member-list">
  230. <li>
  231. <section class="detail" id="setOffsets(double,double)">
  232. <h3>setOffsets</h3>
  233. <div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="Collider.html" title="class in collider">Collider</a></span>&nbsp;<span class="element-name">setOffsets</span><wbr><span class="parameters">(double&nbsp;dx,
  234. double&nbsp;dy)</span></div>
  235. <div class="block">setter for offset values to be used relative to GameObject center. default is zero.</div>
  236. <dl class="notes">
  237. <dt>Parameters:</dt>
  238. <dd><code>dx</code> - offset in X direction (default 0)</dd>
  239. <dd><code>dy</code> - offset in Y direction (default 0)</dd>
  240. <dt>Returns:</dt>
  241. <dd>this instance of Collider</dd>
  242. </dl>
  243. </section>
  244. </li>
  245. <li>
  246. <section class="detail" id="toString()">
  247. <h3>toString</h3>
  248. <div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a></span>&nbsp;<span class="element-name">toString</span>()</div>
  249. <dl class="notes">
  250. <dt>Overrides:</dt>
  251. <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString()" title="class or interface in java.lang" class="external-link">toString</a></code>&nbsp;in class&nbsp;<code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a></code></dd>
  252. </dl>
  253. </section>
  254. </li>
  255. <li>
  256. <section class="detail" id="getX()">
  257. <h3>getX</h3>
  258. <div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">double</span>&nbsp;<span class="element-name">getX</span>()</div>
  259. <div class="block">returns the corresponding game objects X coordinate (center) plus this colliders offset in X
  260. (probably zero).</div>
  261. <dl class="notes">
  262. <dt>Returns:</dt>
  263. <dd>X value</dd>
  264. </dl>
  265. </section>
  266. </li>
  267. <li>
  268. <section class="detail" id="getY()">
  269. <h3>getY</h3>
  270. <div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">double</span>&nbsp;<span class="element-name">getY</span>()</div>
  271. <div class="block">returns the corresponding game objects Y coordinate (center) plus this colliders offset in Y
  272. (probably zero).</div>
  273. <dl class="notes">
  274. <dt>Returns:</dt>
  275. <dd>Y value</dd>
  276. </dl>
  277. </section>
  278. </li>
  279. <li>
  280. <section class="detail" id="getId()">
  281. <h3>getId</h3>
  282. <div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a></span>&nbsp;<span class="element-name">getId</span>()</div>
  283. <div class="block">returns the internal unique name</div>
  284. <dl class="notes">
  285. <dt>Returns:</dt>
  286. <dd>the String with the name</dd>
  287. </dl>
  288. </section>
  289. </li>
  290. <li>
  291. <section class="detail" id="setObject(gameobjects.GameObject)">
  292. <h3>setObject</h3>
  293. <div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">void</span>&nbsp;<span class="element-name">setObject</span><wbr><span class="parameters">(<a href="../gameobjects/GameObject.html" title="class in gameobjects">GameObject</a>&nbsp;gameObject)</span></div>
  294. <div class="block">setter for corresponding GameObject</div>
  295. <dl class="notes">
  296. <dt>Parameters:</dt>
  297. <dd><code>gameObject</code> - to be saved in attribute</dd>
  298. </dl>
  299. </section>
  300. </li>
  301. <li>
  302. <section class="detail" id="setController(controller.ObjectController)">
  303. <h3>setController</h3>
  304. <div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">void</span>&nbsp;<span class="element-name">setController</span><wbr><span class="parameters">(<a href="../controller/ObjectController.html" title="class in controller">ObjectController</a>&nbsp;controller)</span></div>
  305. <div class="block">setter for GameController</div>
  306. <dl class="notes">
  307. <dt>Parameters:</dt>
  308. <dd><code>controller</code> - to be saved in attribute</dd>
  309. </dl>
  310. </section>
  311. </li>
  312. <li>
  313. <section class="detail" id="setPlayground(playground.Playground)">
  314. <h3>setPlayground</h3>
  315. <div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">void</span>&nbsp;<span class="element-name">setPlayground</span><wbr><span class="parameters">(<a href="../playground/Playground.html" title="class in playground">Playground</a>&nbsp;playground)</span></div>
  316. <div class="block">setter for Playground instance this collider belongs to</div>
  317. <dl class="notes">
  318. <dt>Parameters:</dt>
  319. <dd><code>playground</code> - instance to be stored in attribute</dd>
  320. </dl>
  321. </section>
  322. </li>
  323. <li>
  324. <section class="detail" id="collidesWith(collider.Collider)">
  325. <h3>collidesWith</h3>
  326. <div class="member-signature"><span class="modifiers">public abstract</span>&nbsp;<span class="return-type">boolean</span>&nbsp;<span class="element-name">collidesWith</span><wbr><span class="parameters">(<a href="Collider.html" title="class in collider">Collider</a>&nbsp;other)</span></div>
  327. <div class="block">checks the collission with another collider instance.</div>
  328. <dl class="notes">
  329. <dt>Parameters:</dt>
  330. <dd><code>other</code> - the instance to compare to</dd>
  331. <dt>Returns:</dt>
  332. <dd>true if the colliders collide (touch or overlap)</dd>
  333. </dl>
  334. </section>
  335. </li>
  336. </ul>
  337. </section>
  338. </li>
  339. </ul>
  340. </section>
  341. <!-- ========= END OF CLASS DATA ========= -->
  342. </main>
  343. </div>
  344. </div>
  345. </body>
  346. </html>