Examples of IntVector3


Examples of org.spout.api.math.IntVector3

    this.rotation = rotation;
    return this;
  }

  public PieceLayoutBuilder setRotationPoint(int x, int y, int z) {
    setRotationPoint(new IntVector3(x, y, z));
    return this;
  }
View Full Code Here

Examples of org.spout.api.math.IntVector3

    this.rotationPoint.set(position);
    return this;
  }

  public PieceLayoutBuilder offsetRotationPoint(int xOff, int yOff, int zOff) {
    offsetRotationPoint(new IntVector3(xOff, yOff, zOff));
    return this;
  }
View Full Code Here

Examples of org.spout.api.math.IntVector3

    return true;
  }

  private static void checkSurrounded(BlockMaterial[][][] materials) {
    for (BlockFace face : allFaces) {
      IntVector3 o = face.getIntOffset();
      if (materials[1 + o.getX()][1 + o.getY()][1 + o.getZ()] == null) {
        Spout.getLogger().info("Block is not surrounded");
        return;
      }
    }
  }
View Full Code Here

Examples of org.spout.api.math.IntVector3

    }
    return bestInward;
  }

  public static int checkFlowFrom(BlockFace face, BlockMaterial[][][] materials, int[][][] lightLevels) {
    IntVector3 o = face.getIntOffset();
    int ox = o.getX() + 1;
    int oy = o.getY() + 1;
    int oz = o.getZ() + 1;
    BlockMaterial neighbor = materials[ox][oy][oz];
    if (neighbor == null) {
      return 0;
    }
    ByteBitSet occulusion = neighbor.getOcclusion(neighbor.getData());
View Full Code Here

Examples of org.spout.api.math.IntVector3

  }

  private void link(Element element, int dx, int dz) {
    element.link(getElement(element.dX + dx, element.dZ + dz));
    for (int i = 0; i < 4; i++) {
      IntVector3 offset = new IntVector3(BlockFaces.NESW.get(i).getOpposite().getOffset());
      if (dx == offset.getX() && dz == offset.getZ()) {
        element.mainDirection.add(this.mainDirections[i]);
      }
    }
  }
View Full Code Here

Examples of org.spout.api.math.IntVector3

  public void processHigher(Iterable<IntVector3> coords, IntVector4ExpandableFIFO fifo, ChunkCuboidLightBufferWrapper<VanillaCuboidLightBuffer> light, ImmutableCuboidBlockMaterialBuffer material, ImmutableHeightMapBuffer height, boolean init) {

    Iterator<IntVector3> itr = coords.iterator();

    while (itr.hasNext()) {
      IntVector3 v = itr.next();

      int lightLevel = getLightLevel(light, v.getX(), v.getY(), v.getZ());

      log("(Higher) Root light level", v, lightLevel);

      if (lightLevel < 15) {
        int newLight = this.computeLightLevel(light, material, height, v.getX(), v.getY(), v.getZ());
        log("(Higher) Computed light level", v, newLight);
        if (newLight > lightLevel) {
          setLightLevel(light, v.getX(), v.getY(), v.getZ(), newLight);
          fifo.write(newLight, v.getX(), v.getY(), v.getZ());
          log("(Higher) Set and added to FIFO for ", v, newLight);
          continue;
        }
      }
    }

    Vector3f base = material.getBase();
    int baseX = base.getFloorX();
    int baseY = base.getFloorY();
    int baseZ = base.getFloorZ();

    Vector3f top = material.getTop();
    int topX = top.getFloorX();
    int topY = top.getFloorY();
    int topZ = top.getFloorZ();

    IntVector4 v;
    while ((v = fifo.read()) != null) {
      int center = getLightLevel(light, v.getX(), v.getY(), v.getZ());

      log("(Higher) checking center (W = " + v.getW() + ")", v, center);

      if (center <= 1 || v.getW() != center) {
        continue;
      }

      BlockMaterial m = material.get(v.getX(), v.getY(), v.getZ());

      if (m == BlockMaterial.UNGENERATED) {
        continue;
      }

      final boolean boundary = v.getX() == baseX || v.getX() == (topX - 1) || v.getY() == baseY || v.getY() == topY - 1 || v.getZ() == baseZ || v.getZ() == topZ - 1;

      for (BlockFace face : allFaces) {
        IntVector3 off = face.getIntOffset();
        int nx = v.getX() + off.getX();
        int ny = v.getY() + off.getY();
        int nz = v.getZ() + off.getZ();
        if (boundary && (nx < baseX || nx >= topX || ny <= baseY || ny >= topY || nz < baseZ || nz >= topZ)) {
          continue;
        }

        BlockMaterial other = material.get(nx, ny, nz);
View Full Code Here

Examples of org.spout.api.math.IntVector3

  public void processLower(Iterable<IntVector3> coords, IntVector4ExpandableFIFO fifo, IntVector4ExpandableFIFO regen, ChunkCuboidLightBufferWrapper<VanillaCuboidLightBuffer> light, ImmutableCuboidBlockMaterialBuffer material, ImmutableHeightMapBuffer height) {
    Iterator<IntVector3> itr = coords.iterator();

    while (itr.hasNext()) {
      IntVector3 v = itr.next();
      int lightLevel = getLightLevel(light, v.getX(), v.getY(), v.getZ());

      log("(Lower) Root light level", v, lightLevel);

      if (lightLevel == 0) {
        continue;
      }
      int newLight = this.computeLightLevel(light, material, height, v.getX(), v.getY(), v.getZ());

      log("(Lower) New light level", v, newLight);

      if (newLight < lightLevel) {
        setLightLevel(light, v.getX(), v.getY(), v.getZ(), 0);
        fifo.write(lightLevel, v.getX(), v.getY(), v.getZ());
        log("(Lower) Set (0) and added to FIFO for ", v, lightLevel);
      }
    }

    Vector3f base = material.getBase();
    int baseX = base.getFloorX();
    int baseY = base.getFloorY();
    int baseZ = base.getFloorZ();

    Vector3f top = material.getTop();
    int topX = top.getFloorX();
    int topY = top.getFloorY();
    int topZ = top.getFloorZ();

    IntVector4 v;
    while ((v = fifo.read()) != null) {
      int center = v.getW();

      log("(Lower) checking center (W = " + v.getW() + ")", v, center);

      BlockMaterial m = material.get(v.getX(), v.getY(), v.getZ());

      if (m == BlockMaterial.UNGENERATED) {
        continue;
      }

      final boolean boundary = v.getX() == baseX || v.getX() == (topX - 1) || v.getY() == baseY || v.getY() == topY - 1 || v.getZ() == baseZ || v.getZ() == topZ - 1;

      for (BlockFace face : allFaces) {

        IntVector3 off = face.getIntOffset();
        int nx = v.getX() + off.getX();
        int ny = v.getY() + off.getY();
        int nz = v.getZ() + off.getZ();
        if (boundary && (nx < baseX || nx >= topX || ny <= baseY || ny >= topY || nz < baseZ || nz >= topZ)) {
          continue;
        }
        BlockMaterial other = material.get(nx, ny, nz);
View Full Code Here

Examples of org.spout.api.math.IntVector3

  public int getIncomingLight(ChunkCuboidLightBufferWrapper<VanillaCuboidLightBuffer> light, ImmutableCuboidBlockMaterialBuffer material, int x, int y, int z, ByteBitSet occlusionSet, BlockFace face) {
    if (occlusionSet.get(face)) {
      return 0;
    }
    IntVector3 nOffset = face.getIntOffset();
    int nx = x + nOffset.getX();
    int ny = y + nOffset.getY();
    int nz = z + nOffset.getZ();
    short id = material.getId(nx, ny, nz);
    if (id == BlockMaterial.UNGENERATED.getId()) {
      return 0;
    }
    short data = material.getData(nx, ny, nz);
View Full Code Here

Examples of org.spout.api.math.IntVector3

            }

            int wY = (baseY + y) << Chunk.BLOCKS.BITS;
            for (BlockFace face : allFaces) {

              IntVector3 off = face.getIntOffset();
              int nx = x + off.getX();
              int ny = y + off.getY();
              int nz = z + off.getZ();

              if (nx >= 0 && nx < sizeX && ny >= 0 && ny < sizeY && nz >= 0 && nz < sizeZ && cuboid[nx][y][z] != null) {
                continue;
              }

              int startX = off.getX() <= 0 ? 0 : (size - 1);
              int endX = off.getX() >= 0 ? (size - 1) : 0;

              int startY = off.getY() <= 0 ? 0 : (size - 1);
              int endY = off.getY() >= 0 ? (size - 1) : 0;

              int startZ = off.getZ() <= 0 ? 0 : (size - 1);
              int endZ = off.getZ() >= 0 ? (size - 1) : 0;

              startX += wX;
              endX += wX;

              startY += wY;
View Full Code Here

Examples of org.spout.api.math.IntVector3

          }
        }
      }
    }

    IntVector3 v;

    while ((v = fifo.read()) != null) {

      int x = v.getX();
      int y = v.getY();
      int z = v.getZ();

      BlockMaterial m = buffer.get(x + baseX - 1, y + baseY - 1, z + baseZ - 1);

      ByteBitSet occulusion = m.getOcclusion(m.getData());

      int center = newLight[x][y][z];

      for (BlockFace face : allFaces) {
        if (occulusion.get(face)) {
          continue;
        }
        IntVector3 off = face.getIntOffset();
        int nx = x + off.getX();
        int ny = y + off.getY();
        int nz = z + off.getZ();
        if (nx <= 0 || nx > sizeX || ny <= 0 || ny > sizeY || nz <= 0 || nz > sizeZ) {
          continue;
        }
        BlockMaterial other = buffer.get(nx + baseX - 1, ny + baseY - 1, nz + baseZ - 1);
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.