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.

260 lines
16 KiB

  1. <!DOCTYPE HTML>
  2. <html lang="de">
  3. <head>
  4. <!-- Generated by javadoc (17) on Fri May 13 10:01:19 CEST 2022 -->
  5. <title>RectCollider</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-13">
  9. <meta name="description" content="declaration: package: collider, class: RectCollider">
  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/RectCollider.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 RectCollider" class="title">Class RectCollider</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"><a href="Collider.html" title="class in collider">collider.Collider</a>
  77. <div class="inheritance">collider.RectCollider</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">RectCollider</span>
  83. <span class="extends-implements">extends <a href="Collider.html" title="class in collider">Collider</a></span></div>
  84. <div class="block">a <a href="Collider.html" title="class in collider"><code>Collider</code></a> for Rectangles, usually used for <a href="../gameobjects/RectObject.html" title="class in gameobjects"><code>RectObject</code></a> instances.</div>
  85. <dl class="notes">
  86. <dt>See Also:</dt>
  87. <dd>
  88. <ul class="see-list">
  89. <li><a href="../gameobjects/RectObject.html#generateColliders()"><code>RectObject.generateColliders()</code></a></li>
  90. </ul>
  91. </dd>
  92. </dl>
  93. </section>
  94. <section class="summary">
  95. <ul class="summary-list">
  96. <!-- =========== FIELD SUMMARY =========== -->
  97. <li>
  98. <section class="field-summary" id="field-summary">
  99. <h2>Field Summary</h2>
  100. <div class="inherited-list">
  101. <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>
  102. <code><a href="Collider.html#id">id</a></code></div>
  103. </section>
  104. </li>
  105. <!-- ======== CONSTRUCTOR SUMMARY ======== -->
  106. <li>
  107. <section class="constructor-summary" id="constructor-summary">
  108. <h2>Constructor Summary</h2>
  109. <div class="caption"><span>Constructors</span></div>
  110. <div class="summary-table two-column-summary">
  111. <div class="table-header col-first">Constructor</div>
  112. <div class="table-header col-last">Description</div>
  113. <div class="col-constructor-name even-row-color"><code><a href="#%3Cinit%3E(java.lang.String,gameobjects.GameObject,double,double)" class="member-name-link">RectCollider</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,
  114. <a href="../gameobjects/GameObject.html" title="class in gameobjects">GameObject</a>&nbsp;o,
  115. double&nbsp;w,
  116. double&nbsp;h)</code></div>
  117. <div class="col-last even-row-color">
  118. <div class="block">initializes this RectCollider.</div>
  119. </div>
  120. </div>
  121. </section>
  122. </li>
  123. <!-- ========== METHOD SUMMARY =========== -->
  124. <li>
  125. <section class="method-summary" id="method-summary">
  126. <h2>Method Summary</h2>
  127. <div id="method-summary-table">
  128. <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>
  129. <div id="method-summary-table.tabpanel" role="tabpanel">
  130. <div class="summary-table three-column-summary" aria-labelledby="method-summary-table-tab0">
  131. <div class="table-header col-first">Modifier and Type</div>
  132. <div class="table-header col-second">Method</div>
  133. <div class="table-header col-last">Description</div>
  134. <div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>boolean</code></div>
  135. <div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#checkCollisionRectCirc(collider.Collider)" class="member-name-link">checkCollisionRectCirc</a><wbr>(<a href="Collider.html" title="class in collider">Collider</a>&nbsp;other)</code></div>
  136. <div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
  137. <div class="block">checks collision with other Collider, which needs to be a CircleCollider</div>
  138. </div>
  139. <div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>boolean</code></div>
  140. <div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#checkCollisionRectRect(collider.Collider)" class="member-name-link">checkCollisionRectRect</a><wbr>(<a href="Collider.html" title="class in collider">Collider</a>&nbsp;other)</code></div>
  141. <div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
  142. <div class="block">checks collision with other Collider, which needs to be a RectCollider, too.</div>
  143. </div>
  144. <div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>boolean</code></div>
  145. <div class="col-second even-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>
  146. <div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
  147. <div class="block">checks the collission with another collider instance.</div>
  148. </div>
  149. <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>
  150. <div class="col-second odd-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>
  151. <div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">&nbsp;</div>
  152. </div>
  153. </div>
  154. </div>
  155. <div class="inherited-list">
  156. <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>
  157. <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>
  158. <div class="inherited-list">
  159. <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>
  160. <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>
  161. </section>
  162. </li>
  163. </ul>
  164. </section>
  165. <section class="details">
  166. <ul class="details-list">
  167. <!-- ========= CONSTRUCTOR DETAIL ======== -->
  168. <li>
  169. <section class="constructor-details" id="constructor-detail">
  170. <h2>Constructor Details</h2>
  171. <ul class="member-list">
  172. <li>
  173. <section class="detail" id="&lt;init&gt;(java.lang.String,gameobjects.GameObject,double,double)">
  174. <h3>RectCollider</h3>
  175. <div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="element-name">RectCollider</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,
  176. <a href="../gameobjects/GameObject.html" title="class in gameobjects">GameObject</a>&nbsp;o,
  177. double&nbsp;w,
  178. double&nbsp;h)</span></div>
  179. <div class="block">initializes this RectCollider.
  180. calls superclass constructor of <a href="Collider.html#%3Cinit%3E(java.lang.String,gameobjects.GameObject)"><code>Collider(String, GameObject)</code></a> with params String id and GameObject o.</div>
  181. <dl class="notes">
  182. <dt>Parameters:</dt>
  183. <dd><code>id</code> - String unique name for this RectCollider</dd>
  184. <dd><code>o</code> - GameObject instance this RectCollider belongs to (cannot be null)</dd>
  185. <dd><code>w</code> - width in pixels for the collider dimensions (> 0)</dd>
  186. <dd><code>h</code> - height in pixels for the collider dimensions (>0)</dd>
  187. </dl>
  188. </section>
  189. </li>
  190. </ul>
  191. </section>
  192. </li>
  193. <!-- ============ METHOD DETAIL ========== -->
  194. <li>
  195. <section class="method-details" id="method-detail">
  196. <h2>Method Details</h2>
  197. <ul class="member-list">
  198. <li>
  199. <section class="detail" id="toString()">
  200. <h3>toString</h3>
  201. <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>
  202. <dl class="notes">
  203. <dt>Overrides:</dt>
  204. <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>
  205. </dl>
  206. </section>
  207. </li>
  208. <li>
  209. <section class="detail" id="checkCollisionRectRect(collider.Collider)">
  210. <h3>checkCollisionRectRect</h3>
  211. <div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">boolean</span>&nbsp;<span class="element-name">checkCollisionRectRect</span><wbr><span class="parameters">(<a href="Collider.html" title="class in collider">Collider</a>&nbsp;other)</span></div>
  212. <div class="block">checks collision with other Collider, which needs to be a RectCollider, too.</div>
  213. <dl class="notes">
  214. <dt>Parameters:</dt>
  215. <dd><code>other</code> - RectCollider (is casted) to calculate collision with</dd>
  216. <dt>Returns:</dt>
  217. <dd>true if collission is detected</dd>
  218. </dl>
  219. </section>
  220. </li>
  221. <li>
  222. <section class="detail" id="checkCollisionRectCirc(collider.Collider)">
  223. <h3>checkCollisionRectCirc</h3>
  224. <div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">boolean</span>&nbsp;<span class="element-name">checkCollisionRectCirc</span><wbr><span class="parameters">(<a href="Collider.html" title="class in collider">Collider</a>&nbsp;other)</span></div>
  225. <div class="block">checks collision with other Collider, which needs to be a CircleCollider</div>
  226. <dl class="notes">
  227. <dt>Parameters:</dt>
  228. <dd><code>other</code> - CircleCollider (is casted) to calculate collision with</dd>
  229. <dt>Returns:</dt>
  230. <dd>true if collission is detected</dd>
  231. </dl>
  232. </section>
  233. </li>
  234. <li>
  235. <section class="detail" id="collidesWith(collider.Collider)">
  236. <h3>collidesWith</h3>
  237. <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>
  238. <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>
  239. <div class="block">checks the collission with another collider instance.</div>
  240. <dl class="notes">
  241. <dt>Specified by:</dt>
  242. <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>
  243. <dt>Parameters:</dt>
  244. <dd><code>other</code> - the instance to compare to</dd>
  245. <dt>Returns:</dt>
  246. <dd>true if the colliders collide (touch or overlap)</dd>
  247. </dl>
  248. </section>
  249. </li>
  250. </ul>
  251. </section>
  252. </li>
  253. </ul>
  254. </section>
  255. <!-- ========= END OF CLASS DATA ========= -->
  256. </main>
  257. </div>
  258. </div>
  259. </body>
  260. </html>