Examples of Vector2


Examples of com.badlogic.gdx.math.Vector2

    renderer = new ShapeRenderer();

    // next we create a SpriteBatch and a font
    batch = new SpriteBatch();

    mLower = new Vector2();
    mUpper = new Vector2();

    // initialize vertices array
    for (int i = 0; i < vertices.length; i++)
      vertices[i] = new Vector2();

    mDrawBodies = drawBodies;
    mDrawJoints = drawJoints;
    mDrawAABBs = drawAABBs;
  }
View Full Code Here

Examples of com.badlogic.gdx.math.Vector2

  }

  private void drawSolidPolygon (Vector2[] vertices, int vertexCount, Color color) {
    renderer.setColor(color.r, color.g, color.b, color.a);
    for (int i = 0; i < vertexCount; i++) {
      Vector2 v = vertices[i];
      if (i == 0) {
        lv.set(v);
        f.set(v);
        continue;
      }
View Full Code Here

Examples of com.badlogic.gdx.math.Vector2

    Body bodyA = joint.getBodyA();
    Body bodyB = joint.getBodyB();
    Transform xf1 = bodyA.getTransform();
    Transform xf2 = bodyB.getTransform();

    Vector2 x1 = xf1.getPosition();
    Vector2 x2 = xf2.getPosition();
    Vector2 p1 = joint.getAnchorA();
    Vector2 p2 = joint.getAnchorB();

    if (joint.getType() == JointType.DistanceJoint) {
      drawSegment(p1, p2, JOINT_COLOR);
    } else if (joint.getType() == JointType.PulleyJoint) {
      PulleyJoint pulley = (PulleyJoint)joint;
      Vector2 s1 = pulley.getGroundAnchorA();
      Vector2 s2 = pulley.getGroundAnchorB();
      drawSegment(s1, p1, JOINT_COLOR);
      drawSegment(s2, p2, JOINT_COLOR);
      drawSegment(s1, s2, JOINT_COLOR);
    } else if (joint.getType() == JointType.MouseJoint) {
      drawSegment(joint.getAnchorA(), joint.getAnchorB(), JOINT_COLOR);
View Full Code Here

Examples of com.badlogic.gdx.math.Vector2

  }

  private void drawContact (Contact contact) {
    WorldManifold worldManifold = contact.getWorldManifold();
    if (worldManifold.getNumberOfContactPoints() == 0) return;
    Vector2 point = worldManifold.getPoints()[0];
    renderer.point(point.x, point.y, 0);
  }
View Full Code Here

Examples of com.badlogic.gdx.math.Vector2

    Vector3 orig = new Vector3(0, 0, 0);
    Vector3 vec = new Vector3(1, 0, 0);
    project(orig);
    project(vec);
    Vector2 d = new Vector2(vec.x - orig.x, -(vec.y - orig.y));
    return d.angle();
  }
View Full Code Here

Examples of com.badlogic.gdx.math.Vector2

    gameObject.AddComponent(sr);

    Utils.offsetCorrection(initialPosition);
    DragAndDropComponent dd = new DragAndDropComponent();
    gameObject.transform.getLocalPosition().set(new Vector2(initialPosition).sub(new Vector2(sr.spriteRegion.getRegionWidth()/2
        ,sr.spriteRegion.getRegionHeight()/2)));
    gameObject.AddComponent(dd);
    gameObject.AddComponent(new AudioComponent("data/sound/drag.wav"));
    gameObject.AddComponent(new MyHomeComponent());
   
View Full Code Here

Examples of com.badlogic.gdx.math.Vector2

  private static void addDinamicPhysicBySprite(GameObject gameObject) {
   
    PhysicsComponent p = new PhysicsComponent(1, BodyType.KinematicBody, false);
    gameObject.AddComponent(p);

    Vector2 offset = new Vector2(
        gameObject.spriteRenderer.spriteRegion.getRegionWidth()/2,
        gameObject.spriteRenderer.spriteRegion.getRegionHeight()/2);
   
    BoxCollider coll = new BoxCollider(
        new Vector2(gameObject.spriteRenderer.spriteRegion.getRegionWidth()/2, gameObject.spriteRenderer.spriteRegion.getRegionHeight()/2)
        , offset);
   
    gameObject.AddComponent(coll)
   
   
View Full Code Here

Examples of com.badlogic.gdx.math.Vector2

    float offSetWidth = 600;
    int offSetSide = 200;
   
    gameObject.transform.getLocalPosition().sub(offSetSide/2, offSetSide/2);
   
    addStaticPolignPhysic(gameObject, new Vector2(offSetWidth, offSetSide), new Vector2(offSetSide/20));
    addStaticPolignPhysic(gameObject, new Vector2(offSetWidth, offSetSide), Utils.offsetCorrection( new Vector2( offSetSide/2, offSetHeight + offSetSide/2 )));
    addStaticPolignPhysic(gameObject, new Vector2(offSetSide, offSetHeight), new Vector2( - offSetSide/2, offSetSide/2));
    addStaticPolignPhysic(gameObject, new Vector2(offSetSide, offSetHeight), new Vector2(offSetWidth + offSetSide/2, offSetSide/2));
   
    return gameObject;
  }
View Full Code Here

Examples of com.badlogic.gdx.math.Vector2

    PhysicsComponent p = new PhysicsComponent(1, false, false);
    side.AddComponent(p);
   
    side.transform.getLocalPosition().set(location);
    Vector2 offset = new Vector2(dimensions).mul(0.5f);
    BoxCollider coll = new BoxCollider(dimensions, offset);
    side.AddComponent(coll);
   
    go.addGameObject(side);
  }
View Full Code Here

Examples of com.badlogic.gdx.math.Vector2

   * Acompanhe o passo a passo abaixo.
   */
  @Override
  protected void init() {
    /** Load Configurations */
    DragAndDropComponent.snapPositions.add(new Vector2(31,1024 - 253));
    DragAndDropComponent.snapPositions.add(new Vector2(122,1024 - 263));
    DragAndDropComponent.snapPositions.add(new Vector2(72,1024 - 377));
    DragAndDropComponent.snapPositions.add(new Vector2(33,1024 - 480));
    DragAndDropComponent.snapPositions.add(new Vector2(110,1024 - 473));
    DragAndDropComponent.snapPositions.add(new Vector2(120,1024 - 545));
    DragAndDropComponent.snapPositions.add(new Vector2(285,1024 - 50));
    DragAndDropComponent.snapPositions.add(new Vector2(242,1024 - 377));
    DragAndDropComponent.snapPositions.add(new Vector2(330,1024 - 236));
    DragAndDropComponent.snapPositions.add(new Vector2(313,1024 - 370));
    DragAndDropComponent.snapPositions.add(new Vector2(422,1024 - 156));
    DragAndDropComponent.snapPositions.add(new Vector2(402,1024 - 450));
    DragAndDropComponent.snapPositions.add(new Vector2(485,1024 - 480));
    DragAndDropComponent.snapPositions.add(new Vector2(534,1024 - 229));
    Cactus2DApplication.jukeBox.volume = 1;
    Cactus2DApplication.sfxVolume = 1;
    Cactus2DApplication.jukeBox.addMusic("data/sound/music01.mp3");
    Cactus2DApplication.jukeBox.addMusic("data/sound/alert.wav");
    Cactus2DApplication.jukeBox.addMusic("data/sound/earthquake.wav");
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.