api:documentation:math:start
Unterschiede
Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
Beide Seiten der vorigen RevisionVorhergehende ÜberarbeitungNächste Überarbeitung | Vorhergehende ÜberarbeitungLetzte ÜberarbeitungBeide Seiten der Revision | ||
api:documentation:math:start [2021/01/28 20:30] – [Die Klasse String] Martin Pabst | api:documentation:math:start [2021/12/29 11:29] – Externe Bearbeitung 127.0.0.1 | ||
---|---|---|---|
Zeile 14: | Zeile 14: | ||
Variablen des Datentyps '' | Variablen des Datentyps '' | ||
</ | </ | ||
+ | |||
+ | ====== Die Klasse MathTools ====== | ||
+ | Die Klasse '' | ||
+ | |||
+ | ==== MathTools.intersectCircleWithPolygon ==== | ||
+ | < | ||
+ | |||
+ | <div class=" | ||
+ | |||
+ | <script type=" | ||
+ | println(" | ||
+ | |||
+ | Circle c = new Kreis1(400, 300, 100); | ||
+ | |||
+ | class Kreis1 extends Circle { | ||
+ | | ||
+ | Group intersectionPoints = new Group(); | ||
+ | | ||
+ | super(mx, my, radius); | ||
+ | p = new Polygon(false, | ||
+ | intersectionPoints.bringToFront(); | ||
+ | calculateIntersections(); | ||
+ | } | ||
+ | |||
+ | void calculateIntersections() { | ||
+ | |||
+ | Vector2[] points = MathTools.intersectCircleWithPolygon(getCenterX(), | ||
+ | intersectionPoints.destroyAllChildren(); | ||
+ | for(Vector2 point : points) { | ||
+ | | ||
+ | | ||
+ | | ||
+ | } | ||
+ | |||
+ | } | ||
+ | |||
+ | | ||
+ | boolean calc = false; | ||
+ | if(isKeyDown(Key.ArrowRight)) { | ||
+ | | ||
+ | calc = true; | ||
+ | } | ||
+ | if(isKeyDown(Key.ArrowLeft)) { | ||
+ | | ||
+ | calc = true; | ||
+ | } | ||
+ | if(isKeyDown(Key.ArrowUp)) { | ||
+ | | ||
+ | calc = true; | ||
+ | } | ||
+ | if(isKeyDown(Key.ArrowDown)) { | ||
+ | | ||
+ | calc = true; | ||
+ | } | ||
+ | if(calc) { | ||
+ | | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | </ | ||
+ | |||
+ | </ | ||
api/documentation/math/start.txt · Zuletzt geändert: 2022/01/10 07:25 von Martin Pabst