Examples of Physics


Examples of com.tankz.components.Physics

      input.setOffset(getStartX(), getStartY());
    }
  }

  private void updatePosition() {
    Physics physics = physicsMapper.get(player);
    lookAtX = physics.getX();
    lookAtY = physics.getY();
  }
View Full Code Here

Examples of com.tankz.components.Physics

  }

  @Override
  protected void process(Entity e) {
    Health health = healthMapper.get(e);
    Physics physics = physicsMapper.get(e);

    float xo = physics.getX()-25;
    float yo = physics.getY()-30;
    g.translate(xo,yo);
    {
      int healthIterations = Math.round(health.getHealthStatus()*10f);
      int i = 0;

View Full Code Here

Examples of com.tankz.components.Physics

    physicsWorld.step();
  }
 
  @Override
  protected void added(Entity e) {
    Physics collidable = e.getComponent(Physics.class);
    Body body = collidable.getBody();
    body.setUserData(e);
    physicsWorld.add(body);
  }
View Full Code Here

Examples of com.tankz.components.Physics

    physicsWorld.add(body);
  }

  @Override
  protected void removed(Entity e) {
    Physics collidable = e.getComponent(Physics.class);
    physicsWorld.remove(collidable.getBody());
  }
View Full Code Here

Examples of com.tankz.components.Physics

  }

  private void handleBulletHittingTarget(Entity bullet, Entity target) {
    addDamageToTarget(target);
   
    Physics bp = bullet.getComponent(Physics.class);
    EntityFactory.createExplosion(world, bp.getX(), bp.getY());

    world.deleteEntity(bullet);
  }
View Full Code Here

Examples of com.tankz.components.Physics

    // b.setDensity(100);
    // b.setFriction(1.1f);
    // b.setDamping(0.002f);
    // b.setRestitution(0);

    e.addComponent(new Physics(b));

    e.addToWorld();

    return e;
  }
View Full Code Here

Examples of com.tankz.components.Physics

    b.setPosition(x, y);
    b.setDamping(0.1f);
    b.setRestitution(0);
    b.setRotDamping(10f);
    b.setFriction(100);
    e.addComponent(new Physics(b));

    e.addToWorld();

    return e;
  }
View Full Code Here

Examples of com.tankz.components.Physics

    b.setDamping(0.1f);
    b.setRestitution(0);
    b.setRotDamping(10f);
    b.setFriction(100);
    b.setRotation(angleDeg);
    e.addComponent(new Physics(b));

    e.addToWorld();

    return e;
  }
View Full Code Here

Examples of com.tankz.components.Physics

    b.setPosition(x, y);
    b.setDamping(0.1f);
    b.setRestitution(0);
    b.setRotDamping(50f);
    b.setFriction(100);
    e.addComponent(new Physics(b));

    return e;
  }
View Full Code Here

Examples of org.terasology.physics.Physics

        Vector3f direction = characterComponent.getLookDirection();
        Vector3f originPos = location.getWorldPosition();
        originPos.y += characterComponent.eyeOffset;
        boolean ownedEntityUsage = usedOwnedEntity.exists();
        int activationId = nextActivationId++;
        Physics physics = CoreRegistry.get(Physics.class);
        HitResult result = physics.rayTrace(originPos, direction, characterComponent.interactionRange, filter);
        boolean eventWithTarget = result.isHit();
        if (eventWithTarget) {
            EntityRef activatedObject = usedOwnedEntity.exists() ? usedOwnedEntity : result.getEntity();
            activatedObject.send(new ActivationPredicted(character, result.getEntity(), originPos, direction,
                    result.getHitPoint(), result.getHitNormal(), activationId));
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.