package projectzombie.model; import gl_engine.texture.TextureRef3D; import gl_engine.vec.Vec2d; public class ModelGui extends Model { private int animationSize; private int animationSpeed; private double width, height; private TextureRef3D ref; private Vec2d size; public ModelGui(TextureRef3D ref, Vec2d size, int animationSize, int animationSpeed) { this.ref = ref; this.size = size; this.animationSize = animationSize; this.animationSpeed = animationSpeed; } public ModelGui(TextureRef3D tex, int animationSize, int animationSpeed) { this(tex, new Vec2d(1, 1), animationSize, animationSpeed); } public ModelGui(TextureRef3D tex, Vec2d size) { this(tex, size, 1, 1); } public ModelGui(TextureRef3D tex) { this(tex, new Vec2d(1, 1), 1, 1); } @Override public int getSize() { return 6; } @Override public float[] getVerticies() { float x = (float)size.x; float y = (float)size.y; int asi = animationSize; int asp = animationSpeed; width = x; height = y; return new float[] { 0, 0, 0, 0, 0, 0, ref.sy, ref.ey, 0, 0, 0, asi, asp, 0x10, x, 0, 0, 1, 0, 0, ref.sy, ref.ey, 0, 0, 0, asi, asp, 0x10, x, y, 0, 1, 1, 0, ref.sy, ref.ey, 0, 0, 0, asi, asp, 0x10, x, y, 0, 1, 1, 0, ref.sy, ref.ey, 0, 0, 0, asi, asp, 0x10, 0, y, 0, 0, 1, 0, ref.sy, ref.ey, 0, 0, 0, asi, asp, 0x10, 0, 0, 0, 0, 0, 0, ref.sy, ref.ey, 0, 0, 0, asi, asp, 0x10, }; } @Override public TextureRef3D[] getTextures() { return new TextureRef3D[] { ref, ref }; } @Override public double getHeight() { generate(); return height; } public double getWidth() { generate(); return width; } }