Package Hexel.math

Examples of Hexel.math.Vector2i


    int left = p.x;
    int bottom = p.y;
    int right = left+1;
    int top = bottom+1;

    Vector2i tmp = new Vector2i();
    Util.midpointDisplacement(new Random(Util.hash(seed, p.x, p.y)),
        new Random(Util.hash(seed, left)),
        new Random(Util.hash(seed, bottom)),
        new Random(Util.hash(seed, right)),
        new Random(Util.hash(seed, top)),
View Full Code Here


  }

  public void step(double fps) {
    Vector3i tmp = Resources.vector3iResourcePool.aquire();
    Vector3d tmp3d = Resources.vector3dResourcePool.aquire();
    Vector2i tmp2 = Resources.vector2iResourcePool.aquire();
    synchronized (this.things){
      thingsToRemove.clear();
      for (Thing t : this.thingsToAdd){
        this.things.add(t);
        if (t instanceof Player)
View Full Code Here

    axis[5] = null;


    Vector3d up = tmps.up;
    for (int i = 0; i < points.length; i++) {
      Vector2i v = points[i];
      Vector2i u = points[(i + 1) % points.length];
      Vector2d vd = tmps.vd;
      Vector2d ud = tmps.ud;
      HexGeometry.hexToCartesian(v.x, v.y, vd);
      HexGeometry.hexToCartesian(u.x, u.y, ud);
View Full Code Here

    if (chunk.nextSimStep != -1 && chunk.nextSimStep > step) {
      return;
    }
    chunk.nextSimStep = Integer.MAX_VALUE;

    Vector2i tmp2 = new Vector2i();

    for (int x = 0; x < 32; x++) {
      for (int y = 0; y < 16; y++) {
        for (int z = 0; z < 32; z++) {
          Block b = chunk.get(x, y, z);
View Full Code Here

    draw(new Canvas() {
      @Override
      public void paint(Graphics page) {
        page.setColor(Color.white);
        page.fillRect(0, 0, this.getWidth(), this.getHeight());
        Vector2i tmp = new Vector2i();
        int s = 1;
        for (int x = 0; x < this.getWidth()/s; x++) {
          for (int y = 0; y < this.getHeight()/s; y++) {
            if (cmg.isLand(x-this.getWidth()/s/2+xshift, y-this.getHeight()/s/2+yshift)){
              page.setColor(new Color(0, 150, 0));
View Full Code Here

    draw(new Canvas() {
      @Override
      public void paint(Graphics page) {
        page.setColor(Color.white);
        page.fillRect(0, 0, this.getWidth(), this.getHeight());
        Vector2i tmp = new Vector2i();
        int s = 1;
        long t0 = System.currentTimeMillis();
        for (int x = 0; x < this.getWidth()/s; x++) {
          for (int y = 0; y < this.getHeight()/s; y++) {
            int h = tmg.getHeight(x, y, tmp);
View Full Code Here

    draw(new Canvas() {
      @Override
      public void paint(Graphics page) {
        page.setColor(Color.white);
        page.fillRect(0, 0, this.getWidth(), this.getHeight());
        Vector2i tmp = new Vector2i();
        int s = 1;
        long t0 = System.currentTimeMillis();
        HeightMap hm = null;
        int cx = this.getWidth()/2;
        int cy = this.getHeight()/2;
View Full Code Here

    try {
      CirclePoint[][] map = this.mountainCache.getIfPresent(p);
      if (map != null)
        return map;
      else
        return this.mountainCache.get(new Vector2i(p));
    } catch (Exception e) {
      System.out.println("Caught Exception retrieving height map from cache!");
      e.printStackTrace();
      System.exit(1);
      return null;
View Full Code Here

    try {
      EllipsePoint[][] map = this.cache.getIfPresent(p);
      if (map != null)
        return map;
      else
        return this.cache.get(new Vector2i(p));
    } catch (Exception e) {
      System.out.println("Caught Exception retrieving height map from cache!");
      e.printStackTrace();
      System.exit(1);
      return null;
View Full Code Here

  }

  public Chunk genChunk(int cx, int cy, int cz) {
    Chunk chunk = new Chunk(cx, cy, cz);

    Vector2i tmp = new Vector2i();

    for (int x = 0; x < 32; x++) {
      for (int y = 0; y < 16; y++) {
        for (int z = 0; z < 32; z++) {
          int gx = cx * 32 + x;
View Full Code Here

TOP

Related Classes of Hexel.math.Vector2i

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.