Examples of Vector2


Examples of com.badlogic.gdx.math.Vector2

        for (y = tileSet.margin; y < image.getHeight() - tileSet.margin; y += tileSet.tileHeight + tileSet.spacing) {
            for (x = tileSet.margin; x < image.getWidth() - tileSet.margin; x += tileSet.tileWidth + tileSet.spacing) {
                if (y == tileSet.margin) {
                    numCols++;
                }
                imageTilePositions.put(tile, new Vector2(x, y));
                tile++;
            }
            numRows++;
        }
View Full Code Here

Examples of com.badlogic.gdx.math.Vector2

   * @param first True if this the first tank. False if this the second tank.
   */
  public Tank(TextureRegion tex, TextureRegion cannon, TextureRegion[] weaponsTex, boolean first, int x, int y, Map map){
    this.tex = tex;
    this.cannon = cannon;
    this.position = new Vector2(x,y);
    this.bounds = new Rectangle(x,y,32,16);
    this.slope = map.getAngle(x);
    this.map = map;
    if(!first){
      state = RECEIVING;
View Full Code Here

Examples of com.badlogic.gdx.math.Vector2

 
  /**
   * Shoot the weapon
   */
  public void shoot(){
    velocity = new Vector2(shooter.getPower()* MathUtils.cosDeg(shooter.getAngle()) * POWER_FACTOR , shooter.getPower() * MathUtils.sinDeg(shooter.getAngle()) * POWER_FACTOR);
    position = new Vector2(shooter.getPosition());
    bounds = new Rectangle(position.x,position.y,1,1);
  }
View Full Code Here

Examples of com.badlogic.gdx.math.Vector2

    int numContactPoints = jniGetWorldManifold(addr, tmp);

    worldManifold.numContactPoints = numContactPoints;
    worldManifold.normal.set(tmp[0], tmp[1]);
    for (int i = 0; i < numContactPoints; i++) {
      Vector2 point = worldManifold.points[i];
      point.x = tmp[2 + i * 2];
      point.y = tmp[2 + i * 2 + 1];
    }
    worldManifold.separations[0] = tmp[6];
    worldManifold.separations[1] = tmp[7];
View Full Code Here

Examples of com.badlogic.gdx.math.Vector2

      throw new GdxRuntimeException("Must call begin(ShapeType.Filled) or begin(ShapeType.Line)");

    checkDirty();
    checkFlush(8);

    Vector2 t = tmp.set(y2 - y1, x1 - x2).nor();
    width *= 0.5f;
    float tx = t.x * width;
    float ty = t.y * width;
    if (currType == ShapeType.Line) {
      renderer.color(color);
View Full Code Here

Examples of com.badlogic.gdx.math.Vector2

      return this.elementSize;
    }
  }

  public FxaaFilter (int viewportWidth, int viewportHeight) {
    this(new Vector2(viewportWidth, viewportHeight), 1f / 128f, 1f / 8f, 8f);
  }
View Full Code Here

Examples of com.badlogic.gdx.math.Vector2

  public FxaaFilter (int viewportWidth, int viewportHeight) {
    this(new Vector2(viewportWidth, viewportHeight), 1f / 128f, 1f / 8f, 8f);
  }

  public FxaaFilter (int viewportWidth, int viewportHeight, float fxaa_reduce_min, float fxaa_reduce_mul, float fxaa_span_max) {
    this(new Vector2(viewportWidth, viewportHeight), fxaa_reduce_min, fxaa_reduce_mul, fxaa_span_max);
  }
View Full Code Here

Examples of com.badlogic.gdx.math.Vector2

    dodistortion = barrelDistortion;

    vtint = new Vector3();
    tint = new Color();
    chromaticDispersion = new Vector2();

    setTime(0f);
    setTint(1.0f, 1.0f, 0.85f);
    setDistortion(0.3f);
    setZoom(1f);
View Full Code Here

Examples of com.badlogic.gdx.math.Vector2

    public boolean justOut;
    private Vector2 mouse;
    Rectangle rectHotZone;

    public HotZone( Rectangle hotZone ) {
      mouse = new Vector2();
      rectHotZone = new Rectangle();
      setHotZone( hotZone );
      reset();
    }
View Full Code Here

Examples of com.badlogic.gdx.math.Vector2

  @Override
  public void update (int screenWidth, int screenHeight, boolean centerCamera) {
    // Fit min size to the screen.
    float worldWidth = minWorldWidth;
    float worldHeight = minWorldHeight;
    Vector2 scaled = Scaling.fit.apply(worldWidth, worldHeight, screenWidth, screenHeight);

    // Extend in the short direction.
    int viewportWidth = Math.round(scaled.x);
    int viewportHeight = Math.round(scaled.y);
    if (viewportWidth < screenWidth) {
View Full Code Here
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.