Examples of collideWith()


Examples of com.jme3.bounding.BoundingVolume.collideWith()

    }

    public int collideWith(Collidable other, CollisionResults results) {
        if (other instanceof BoundingVolume) {
            BoundingVolume bv = (BoundingVolume) other;
            return bv.collideWith(this, results);
        } else if (other instanceof AbstractTriangle) {
            AbstractTriangle tri = (AbstractTriangle) other;
            float d = intersects(tri.get1(), tri.get2(), tri.get3());
            if (Float.isInfinite(d) || Float.isNaN(d)) {
                return 0;
View Full Code Here

Examples of com.jme3.scene.Geometry.collideWith()

                true); // rotate the offset by a random angle

        ax = x + grassPatchRandomOffset.x;
        az = z + grassPatchRandomOffset.y;
        ray.setOrigin(new Vector3f(ax, centre.y + terrainWidth, az));
        terrain.collideWith(ray, results);

        if (results.size() <= 0)
          continue;

        try {
View Full Code Here

Examples of oop13.space.model.AlienShot.collideWith()

    Assert.assertTrue(wallKicked.getLives() == 0);
    Assert.assertTrue(wallKicked.isDead());
   
    //Testing collisions Shot -> Alien Shot
    model.getList().add(shipShot);
    alienShot.collideWith(model.getList());
    Assert.assertTrue(shipShot.isDead());
    Assert.assertTrue(alienShot.isDead());
   
    //Testing score when aliens die
    model.resetStatistics();
View Full Code Here

Examples of oop13.space.model.Ship.collideWith()

    //Testing collisions AlienShot -> Ship and Shot -> Alien
    model.getList().add(new AlienShot(spaceShip.getPositionX(), spaceShip.getPositionY()));
    ShipShot shot = new ShipShot(10, 50);
    model.getList().add(shot);
    shot.collideWith(model.getList());
    spaceShip.collideWith(model.getList());
    Assert.assertTrue(spaceShip.isDead());
    Assert.assertTrue(shot.isDead());
    int individualsKilled = 0;
    for (Individual ind : model.getList()) {
      if (ind.isDead()) {
View Full Code Here

Examples of oop13.space.model.ShipShot.collideWith()

   
    //Testing collisions AlienShot -> Ship and Shot -> Alien
    model.getList().add(new AlienShot(spaceShip.getPositionX(), spaceShip.getPositionY()));
    ShipShot shot = new ShipShot(10, 50);
    model.getList().add(shot);
    shot.collideWith(model.getList());
    spaceShip.collideWith(model.getList());
    Assert.assertTrue(spaceShip.isDead());
    Assert.assertTrue(shot.isDead());
    int individualsKilled = 0;
    for (Individual ind : model.getList()) {
View Full Code Here

Examples of oop13.space.model.Wall.collideWith()

    }
    Assert.assertTrue(wallKicked.getLives() == 1);
    model.getList().remove(shipShot);
    AlienShot alienShot = new AlienShot(35, 450);
    model.getList().add(alienShot);
    wallKicked.collideWith(model.getList());
    Assert.assertTrue(wallKicked.getLives() == 0);
    Assert.assertTrue(wallKicked.isDead());
   
    //Testing collisions Shot -> Alien Shot
    model.getList().add(shipShot);
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.