001package fr.aumgn.dac2.shape;
002
003import fr.aumgn.bukkitutils.geom.Vector;
004
005@ShapeName("ellipsoid")
006public class EllipsoidShape implements Shape {
007
008    private final Vector center;
009    private final Vector radius;
010
011    public EllipsoidShape(Vector center, Vector radius) {
012        this.center = center;
013        this.radius = radius.add(0.5);
014    }
015
016    @Override
017    public boolean contains(Vector pt) {
018        return pt.subtract(center).divide(radius).lengthSq() <= 1;
019    }
020
021    public Vector getCenter() {
022        return center;
023    }
024
025    public Vector getRadius() {
026        return radius.subtract(0.5);
027    }
028}