Package org.spout.physics.collision.shape

Examples of org.spout.physics.collision.shape.SphereShape


  public void onInteract(Entity entity, Action type, float mass) {
    super.onInteract(entity, type);
    if (type == Action.RIGHT_CLICK) {
      Substance item = this.spawnEntity(entity, new Vector3f(0, 1.6f, 0));
      PhysicsComponent physics = item.getOwner().getPhysics();
      physics.activate(mass, new SphereShape(1f), false, true);
      if (item instanceof Projectile) {
        ((Projectile) item).setShooter(entity);
      }
      physics.force(entity.getPhysics().getRotation().getDirection().mul(getLaunchForce()));
      this.onThrown(item, entity);
View Full Code Here


    if (this.isSplash()) {
      Potion item = entity.getWorld().createEntity(entity.getPhysics().getPosition().add(0, 1.6f, 0)).add(Potion.class);
      item.setShooter(entity);
      item.setPotion(this);
      PhysicsComponent physics = item.getOwner().getPhysics();
      physics.activate(1f, new SphereShape(0.3f), false, true);
      entity.getWorld().spawnEntity(item.getOwner());
      physics.impulse(entity.getPhysics().getRotation().getDirection().mul(55)); //TODO: Need real parameters
    }
  }
View Full Code Here

TOP

Related Classes of org.spout.physics.collision.shape.SphereShape

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.