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.

237 lines
15 KiB

  1. <!DOCTYPE HTML>
  2. <html lang="de">
  3. <head>
  4. <!-- Generated by javadoc (17) on Thu May 12 09:13:23 CEST 2022 -->
  5. <title>CircleCollider</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-05-12">
  9. <meta name="description" content="declaration: package: collider, class: CircleCollider">
  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/CircleCollider.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>Field&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 CircleCollider" class="title">Class CircleCollider</h1>
  74. </div>
  75. <div class="inheritance" title="Inheritance Tree"><a href="https://docs.oracle.com/en/java/javase/12/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">java.lang.Object</a>
  76. <div class="inheritance"><a href="Collider.html" title="class in collider">collider.Collider</a>
  77. <div class="inheritance">collider.CircleCollider</div>
  78. </div>
  79. </div>
  80. <section class="class-description" id="class-description">
  81. <hr>
  82. <div class="type-signature"><span class="modifiers">public class </span><span class="element-name type-name-label">CircleCollider</span>
  83. <span class="extends-implements">extends <a href="Collider.html" title="class in collider">Collider</a></span></div>
  84. <div class="block">Collider for round objects</div>
  85. </section>
  86. <section class="summary">
  87. <ul class="summary-list">
  88. <!-- =========== FIELD SUMMARY =========== -->
  89. <li>
  90. <section class="field-summary" id="field-summary">
  91. <h2>Field Summary</h2>
  92. <div class="inherited-list">
  93. <h3 id="fields-inherited-from-class-collider.Collider">Fields inherited from class&nbsp;collider.<a href="Collider.html" title="class in collider">Collider</a></h3>
  94. <code><a href="Collider.html#id">id</a></code></div>
  95. </section>
  96. </li>
  97. <!-- ======== CONSTRUCTOR SUMMARY ======== -->
  98. <li>
  99. <section class="constructor-summary" id="constructor-summary">
  100. <h2>Constructor Summary</h2>
  101. <div class="caption"><span>Constructors</span></div>
  102. <div class="summary-table two-column-summary">
  103. <div class="table-header col-first">Constructor</div>
  104. <div class="table-header col-last">Description</div>
  105. <div class="col-constructor-name even-row-color"><code><a href="#%3Cinit%3E(java.lang.String,gameobjects.GameObject,double)" class="member-name-link">CircleCollider</a><wbr>(<a href="https://docs.oracle.com/en/java/javase/12/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;id,
  106. <a href="../gameobjects/GameObject.html" title="class in gameobjects">GameObject</a>&nbsp;o,
  107. double&nbsp;radius)</code></div>
  108. <div class="col-last even-row-color">
  109. <div class="block">Constructor which sets the radius to be respected for collisions.</div>
  110. </div>
  111. </div>
  112. </section>
  113. </li>
  114. <!-- ========== METHOD SUMMARY =========== -->
  115. <li>
  116. <section class="method-summary" id="method-summary">
  117. <h2>Method Summary</h2>
  118. <div id="method-summary-table">
  119. <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-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>
  120. <div id="method-summary-table.tabpanel" role="tabpanel">
  121. <div class="summary-table three-column-summary" aria-labelledby="method-summary-table-tab0">
  122. <div class="table-header col-first">Modifier and Type</div>
  123. <div class="table-header col-second">Method</div>
  124. <div class="table-header col-last">Description</div>
  125. <div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>boolean</code></div>
  126. <div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#checkCollisionCircCirc(collider.Collider)" class="member-name-link">checkCollisionCircCirc</a><wbr>(<a href="Collider.html" title="class in collider">Collider</a>&nbsp;_c2)</code></div>
  127. <div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
  128. <div class="block">calculates the collission of this with other collider</div>
  129. </div>
  130. <div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>boolean</code></div>
  131. <div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><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>
  132. <div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
  133. <div class="block">checks the collission with another collider instance.</div>
  134. </div>
  135. <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/en/java/javase/12/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a></code></div>
  136. <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>
  137. <div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
  138. <div class="block">simple concatenation of all attributes (x,y,r)</div>
  139. </div>
  140. </div>
  141. </div>
  142. </div>
  143. <div class="inherited-list">
  144. <h3 id="methods-inherited-from-class-collider.Collider">Methods inherited from class&nbsp;collider.<a href="Collider.html" title="class in collider">Collider</a></h3>
  145. <code><a href="Collider.html#getId()">getId</a>, <a href="Collider.html#getX()">getX</a>, <a href="Collider.html#getY()">getY</a>, <a href="Collider.html#setController(controller.ObjectController)">setController</a>, <a href="Collider.html#setObject(gameobjects.GameObject)">setObject</a>, <a href="Collider.html#setOffsets(double,double)">setOffsets</a>, <a href="Collider.html#setPlayground(playground.Playground)">setPlayground</a></code></div>
  146. <div class="inherited-list">
  147. <h3 id="methods-inherited-from-class-java.lang.Object">Methods inherited from class&nbsp;java.lang.<a href="https://docs.oracle.com/en/java/javase/12/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a></h3>
  148. <code><a href="https://docs.oracle.com/en/java/javase/12/docs/api/java.base/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/en/java/javase/12/docs/api/java.base/java/lang/Object.html#getClass()" title="class or interface in java.lang" class="external-link">getClass</a>, <a href="https://docs.oracle.com/en/java/javase/12/docs/api/java.base/java/lang/Object.html#hashCode()" title="class or interface in java.lang" class="external-link">hashCode</a>, <a href="https://docs.oracle.com/en/java/javase/12/docs/api/java.base/java/lang/Object.html#notify()" title="class or interface in java.lang" class="external-link">notify</a>, <a href="https://docs.oracle.com/en/java/javase/12/docs/api/java.base/java/lang/Object.html#notifyAll()" title="class or interface in java.lang" class="external-link">notifyAll</a>, <a href="https://docs.oracle.com/en/java/javase/12/docs/api/java.base/java/lang/Object.html#wait()" title="class or interface in java.lang" class="external-link">wait</a>, <a href="https://docs.oracle.com/en/java/javase/12/docs/api/java.base/java/lang/Object.html#wait(long)" title="class or interface in java.lang" class="external-link">wait</a>, <a href="https://docs.oracle.com/en/java/javase/12/docs/api/java.base/java/lang/Object.html#wait(long,int)" title="class or interface in java.lang" class="external-link">wait</a></code></div>
  149. </section>
  150. </li>
  151. </ul>
  152. </section>
  153. <section class="details">
  154. <ul class="details-list">
  155. <!-- ========= CONSTRUCTOR DETAIL ======== -->
  156. <li>
  157. <section class="constructor-details" id="constructor-detail">
  158. <h2>Constructor Details</h2>
  159. <ul class="member-list">
  160. <li>
  161. <section class="detail" id="&lt;init&gt;(java.lang.String,gameobjects.GameObject,double)">
  162. <h3>CircleCollider</h3>
  163. <div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="element-name">CircleCollider</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/en/java/javase/12/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;id,
  164. <a href="../gameobjects/GameObject.html" title="class in gameobjects">GameObject</a>&nbsp;o,
  165. double&nbsp;radius)</span></div>
  166. <div class="block">Constructor which sets the radius to be respected for collisions.</div>
  167. <dl class="notes">
  168. <dt>Parameters:</dt>
  169. <dd><code>id</code> - String unique name for the collider instance</dd>
  170. <dd><code>o</code> - GameObject it belongs to</dd>
  171. <dd><code>radius</code> - radius in pixels to use as a size</dd>
  172. </dl>
  173. </section>
  174. </li>
  175. </ul>
  176. </section>
  177. </li>
  178. <!-- ============ METHOD DETAIL ========== -->
  179. <li>
  180. <section class="method-details" id="method-detail">
  181. <h2>Method Details</h2>
  182. <ul class="member-list">
  183. <li>
  184. <section class="detail" id="toString()">
  185. <h3>toString</h3>
  186. <div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="https://docs.oracle.com/en/java/javase/12/docs/api/java.base/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>
  187. <div class="block">simple concatenation of all attributes (x,y,r)</div>
  188. <dl class="notes">
  189. <dt>Overrides:</dt>
  190. <dd><code><a href="Collider.html#toString()">toString</a></code>&nbsp;in class&nbsp;<code><a href="Collider.html" title="class in collider">Collider</a></code></dd>
  191. </dl>
  192. </section>
  193. </li>
  194. <li>
  195. <section class="detail" id="checkCollisionCircCirc(collider.Collider)">
  196. <h3>checkCollisionCircCirc</h3>
  197. <div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">boolean</span>&nbsp;<span class="element-name">checkCollisionCircCirc</span><wbr><span class="parameters">(<a href="Collider.html" title="class in collider">Collider</a>&nbsp;_c2)</span>
  198. throws <span class="exceptions"><a href="https://docs.oracle.com/en/java/javase/12/docs/api/java.base/java/lang/Exception.html" title="class or interface in java.lang" class="external-link">Exception</a></span></div>
  199. <div class="block">calculates the collission of this with other collider</div>
  200. <dl class="notes">
  201. <dt>Parameters:</dt>
  202. <dd><code>_c2</code> - the other collider</dd>
  203. <dt>Returns:</dt>
  204. <dd>true if a collision was detected</dd>
  205. <dt>Throws:</dt>
  206. <dd><code><a href="https://docs.oracle.com/en/java/javase/12/docs/api/java.base/java/lang/Exception.html" title="class or interface in java.lang" class="external-link">Exception</a></code> - in case the math operations are invalid (due to illegal values of x y or
  207. radius)</dd>
  208. </dl>
  209. </section>
  210. </li>
  211. <li>
  212. <section class="detail" id="collidesWith(collider.Collider)">
  213. <h3>collidesWith</h3>
  214. <div class="member-signature"><span class="modifiers">public</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>
  215. <div class="block"><span class="descfrm-type-label">Description copied from class:&nbsp;<code><a href="Collider.html#collidesWith(collider.Collider)">Collider</a></code></span></div>
  216. <div class="block">checks the collission with another collider instance.</div>
  217. <dl class="notes">
  218. <dt>Specified by:</dt>
  219. <dd><code><a href="Collider.html#collidesWith(collider.Collider)">collidesWith</a></code>&nbsp;in class&nbsp;<code><a href="Collider.html" title="class in collider">Collider</a></code></dd>
  220. <dt>Parameters:</dt>
  221. <dd><code>other</code> - the instance to compare to</dd>
  222. <dt>Returns:</dt>
  223. <dd>true if the colliders collide (touch or overlap)</dd>
  224. </dl>
  225. </section>
  226. </li>
  227. </ul>
  228. </section>
  229. </li>
  230. </ul>
  231. </section>
  232. <!-- ========= END OF CLASS DATA ========= -->
  233. </main>
  234. </div>
  235. </div>
  236. </body>
  237. </html>