1 package de.lathanda.eos.game.geom;
3 import de.lathanda.eos.base.Picture;
4 import de.lathanda.eos.base.math.Matrix;
5 import de.lathanda.eos.base.math.Point;
6 import de.lathanda.eos.base.math.Vector;
7 import java.util.ArrayList;
25 private ArrayList<Shape> list;
29 private Point previousLocation;
33 private double previousAngle;
40 previousLocation =
new Point(0, 0);
43 list =
new ArrayList<>();
77 for (
Shape o : list) {
78 if (o.contains(x, y)) {
87 double diff = Double.POSITIVE_INFINITY;
88 for (
Shape o : list) {
89 diff = Math.min(o.getDistance(x, y), diff);
105 previousLocation.
move(diff);
106 for (
Shape o : list) {
117 previousAngle =
angle;
129 for (
Shape o : list) {
135 o.setAngle(o.getAngle() + diff);
141 left = Double.POSITIVE_INFINITY;
143 for (
Shape o : list) {
144 actLeft = o.getLeft();
145 if (
left > actLeft) {
154 right = Double.NEGATIVE_INFINITY;
156 for (
Shape o : list) {
157 actRight = o.getRight();
158 if (
right < actRight) {
167 bottom = Double.POSITIVE_INFINITY;
169 for (
Shape o : list) {
170 actBottom = o.getBottom();
180 top = Double.NEGATIVE_INFINITY;
182 for (
Shape o : list) {
193 for (
Shape o : list) {
void drawShape(Shape shape)
Vector transform(Vector v)
void move(double dX, double dY)
double getDistance(double x, double y)
void draw(Picture picture)
ArrayList< Shape > getOutlines()
boolean contains(double x, double y)
double bottom
Untere Grenze.
double right
Rechte Grenze.