Package wecui.render.region

Source Code of wecui.render.region.EllipsoidRegion

package wecui.render.region;

import wecui.WorldEditCUI;
import wecui.render.LineColor;
import wecui.render.shapes.RenderEllipsoid;
import wecui.render.points.PointCube;
import wecui.util.Vector3;

/**
* Main controller for a ellipsoid-type region
*
* @author yetanotherx
* @author lahwran
*/
public class EllipsoidRegion extends BaseRegion {

    protected PointCube center;
    protected Vector3 radii;
   
    public EllipsoidRegion(WorldEditCUI controller) {
        super(controller);
    }

    @Override
    public void render() {
        if( center != null && radii != null ) {
            center.render();
           
            new RenderEllipsoid(LineColor.ELLIPSOIDGRID, center, radii).render();
           
        }
        else if( center != null ) {
            center.render();
        }
    }

    @Override
    public void setEllipsoidCenter(int x, int y, int z) {
        center = new PointCube(x, y, z);
        center.setColor(LineColor.ELLIPSOIDCENTER);
    }

    @Override
    public void setEllipsoidRadii(double x, double y, double z) {
        radii = new Vector3(x, y, z);
    }

    @Override
    public RegionType getType() {
        return RegionType.ELLIPSOID;
    }
   
}
TOP

Related Classes of wecui.render.region.EllipsoidRegion

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.