Package colonies.src

Examples of colonies.src.Point.plus()


      // if destination not yet established, search for shelter
      if(destination == null){
        Point candidate = new Point();
        for(int i = 0; i < 10; ++i){
          candidate.polarTranslation(Utility.rng.nextRadian(), Math.PI/2, Utility.rng.nextInt(20));
          candidate.plus(citizen.posX, citizen.posY, citizen.posZ);
          Utility.terrainAdjustment(citizen.worldObj, candidate);
          if(!citizen.worldObj.canBlockSeeTheSky((int)candidate.x, (int)candidate.y, (int)candidate.z)){
            destination = candidate;
            citizen.getNavigator().tryMoveToXYZ(destination.x, destination.y, destination.z, 0.35f);
          } // else try another spot
View Full Code Here


     
      Point p = new Point();
      for(int angle = 0; angle < 32; ++angle){
        p.set(0, 0, 0);
        p.polarTranslation((float)angle/32.0 * 2*Math.PI, Math.PI/2, 14d);
        p.plus(x, y, z);
        this.terrainAdjustment(world, p);
        world.spawnParticle("reddust", p.x, p.y+0.5, p.z, -0.5,0.5,0.8);
      }
    }
  public Point terrainAdjustment(World world, Point p){
View Full Code Here

      Point candidate = new Point();
      int blockID = 0;
      for(int i = 0; i < 10; ++i){
        // choose a spot 5-10m away from citizen in a random direction
        candidate.polarTranslation(Utility.rng.nextRadian(), Math.PI/2, 5 + Utility.rng.nextInt(5));
        candidate.plus(citizen.posX, citizen.posY, citizen.posZ);
       
        // move destination away from logging camp if necessary
        if(candidate.getDistance(citizen.homeTown.xCoord, citizen.homeTown.yCoord, citizen.homeTown.zCoord) < 10){
          double theta = Math.atan2(candidate.y - citizen.homeTown.yCoord, candidate.x - citizen.homeTown.xCoord);
          candidate.polarTranslation(theta, Math.PI/2, 10);
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.