Package com.badlogic.gdx.math

Examples of com.badlogic.gdx.math.Vector2


                for (Fixture fixture : body.getFixtureList()) {

                    if (fixture != null && fixture.getType() == Type.Polygon) {
                        PolygonShape shape = (PolygonShape) fixture.getShape();
                        for (int i = 0; i < shape.getVertexCount(); i++) {
                            Vector2 vec = new Vector2();
                            shape.getVertex(i, vec);
                            vertices.add(body.getTransform().mul(vec));
                        }

                        for (int i = 0; i < vertices.size(); i++) {
View Full Code Here


    private static Vector2D toVector2D(Vector2 v) {
        return new Vector2D(v.x, v.y);
    }

    private static Vector2 toVector2(Vector2D v) {
        return new Vector2(v.x, v.y);
    }
View Full Code Here

        }
    }

    private void packTileSet(TileSet set, FileHandle inputDirHandle, File outputDir, Settings settings) throws IOException {
        BufferedImage tile;
        Vector2 tileLocation;
        TileSetLayout packerTileSet;
        Graphics g;

        packer = new TexturePacker(settings);
View Full Code Here

        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

   * @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

 
  /**
   * 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

    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

      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

      return this.elementSize;
    }
  }

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

  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

TOP

Related Classes of com.badlogic.gdx.math.Vector2

Copyright © 2018 www.massapicom. 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.