Examples of Vector3i


Examples of Hexel.math.Vector3i

  public void render(GL2 gl) {

    Vector3d dir = getDirectionLooking();
    dir.times(10);

    Vector3i closestBlock = this.thingBridge
        .getClosestNonEmptyBlockOnVector(
            new Vector3d(getCameraX(), getCameraY(), getCameraZ()), dir);

    Vector3i closestEmptyBlock = this.thingBridge
        .getClosestEmptyBlockOnVector(new Vector3d(getCameraX(),
            getCameraY(), getCameraZ()), dir);

    if (closestBlock != null) {
      Face f = HighlightBlockFace.getBetweenFace(closestBlock,
View Full Code Here

Examples of colonies.lunatrius.client.lunatrius.schematica.util.Vector3i

    this.lineColorBuffer.clear();
    this.lineVertecBuffer.clear();

    this.profiler.startSection("dataPrep");
    if (this.settings.isRenderingSchematic) {
      drawCuboidOutline(Vector3i.ZERO, new Vector3i(this.settings.schematic.width(), this.settings.schematic.height(), this.settings.schematic.length()), 0.75f, 0.0f, 0.75f, 0.25f);
    }

    if (this.settings.isRenderingGuide) {
      Vector3i start = null;
      Vector3i end = null;

      start = this.settings.pointMin.clone().sub(this.settings.offset);
      end = this.settings.pointMax.clone().sub(this.settings.offset).add(1);
      drawCuboidOutline(start, end, 0.0f, 0.75f, 0.0f, 0.25f);
View Full Code Here

Examples of colonies.lunatrius.client.lunatrius.schematica.util.Vector3i

    int x, y, z;
    int blockId = 0, mcBlockId = 0;
    int sides = 0;
    Block block = null;
    String lastTexture = "";
    Vector3i tmp;

    boolean ambientOcclusion = this.settings.minecraft.gameSettings.ambientOcclusion;
    this.settings.minecraft.gameSettings.ambientOcclusion = false;

    Tessellator.instance.startDrawingQuads();

    for (y = minY; y < maxY; y++) {
      for (z = minZ; z < maxZ; z++) {
        for (x = minX; x < maxX; x++) {
          try {
            blockId = this.schematic.getBlockId(x, y, z);
            block = Block.blocksList[blockId];

            mcBlockId = mcWorld.getBlockId(x + this.settings.offset.x, y + this.settings.offset.y, z + this.settings.offset.z);

            sides = 0;
            if (block != null) {
              if (block.shouldSideBeRendered(this.schematic, x, y - 1, z, 0)) {
                sides |= 0x01;
              }

              if (block.shouldSideBeRendered(this.schematic, x, y + 1, z, 1)) {
                sides |= 0x02;
              }

              if (block.shouldSideBeRendered(this.schematic, x, y, z - 1, 2)) {
                sides |= 0x04;
              }

              if (block.shouldSideBeRendered(this.schematic, x, y, z + 1, 3)) {
                sides |= 0x08;
              }

              if (block.shouldSideBeRendered(this.schematic, x - 1, y, z, 4)) {
                sides |= 0x10;
              }

              if (block.shouldSideBeRendered(this.schematic, x + 1, y, z, 5)) {
                sides |= 0x20;
              }
            }

            if (mcBlockId != 0) {
              if (this.settings.highlight && renderPass == 2) {
                if (blockId == 0 && this.settings.highlightAir) {
                  tmp = new Vector3i(x, y, z);
                  drawCuboidSurface(tmp, tmp.clone().add(1), 0x3F, 0.75f, 0.0f, 0.75f, 0.25f);
                  drawCuboidOutline(tmp, tmp.clone().add(1), 0x3F, 0.75f, 0.0f, 0.75f, 0.25f);
                } else if (blockId != mcBlockId) {
                  tmp = new Vector3i(x, y, z);
                  drawCuboidSurface(tmp, tmp.clone().add(1), sides, 1.0f, 0.0f, 0.0f, 0.25f);
                  drawCuboidOutline(tmp, tmp.clone().add(1), sides, 1.0f, 0.0f, 0.0f, 0.25f);
                } else if (this.schematic.getBlockMetadata(x, y, z) != mcWorld.getBlockMetadata(x + this.settings.offset.x, y + this.settings.offset.y, z + this.settings.offset.z)) {
                  tmp = new Vector3i(x, y, z);
                  drawCuboidSurface(tmp, tmp.clone().add(1), sides, 0.75f, 0.35f, 0.0f, 0.25f);
                  drawCuboidOutline(tmp, tmp.clone().add(1), sides, 0.75f, 0.35f, 0.0f, 0.25f);
                }
              }
            } else if (mcBlockId == 0 && blockId > 0 && blockId < 0x1000) {
              if (this.settings.highlight && renderPass == 2) {
                tmp = new Vector3i(x, y, z);
                drawCuboidSurface(tmp, tmp.clone().add(1), sides, 0.0f, 0.75f, 1.0f, 0.25f);
                drawCuboidOutline(tmp, tmp.clone().add(1), sides, 0.0f, 0.75f, 1.0f, 0.25f);
              }

              if (block != null) {
                if (!lastTexture.equals(block.getTextureFile())) {
                  ForgeHooksClient.bindTexture(getTextureName(block.getTextureFile()), 0);
View Full Code Here

Examples of com.flansmod.common.vector.Vector3i

        //MovingObjectPosition hit = ((EntityLivingBase)seats[0].riddenByEntity).rayTrace(reach, 1F);
        if(hit != null && hit.typeOfHit == MovingObjectType.BLOCK)
        {
          if(breakingBlock == null || breakingBlock.x != hit.blockX || breakingBlock.y != hit.blockY || breakingBlock.z != hit.blockZ)
            breakingProgress = 0F;
          breakingBlock = new Vector3i(hit.blockX, hit.blockY, hit.blockZ);
        }
      }
     
      else if(heldItem instanceof ItemGun)
      {
View Full Code Here

Examples of com.flansmod.common.vector.Vector3i

                case 2 : z--; break;
                case 3 : z++; break;
                case 4 : x--; break;
                case 5 : x++; break;
                }
                blockLightOverrides.add(new Vector3i(x, y, z));
                mc.theWorld.setLightValue(EnumSkyBlock.Block, x, y, z, 12);
                mc.theWorld.updateLightByType(EnumSkyBlock.Block, x, y + 1, z);
                mc.theWorld.updateLightByType(EnumSkyBlock.Block, x, y - 1, z);
                mc.theWorld.updateLightByType(EnumSkyBlock.Block, x + 1, y, z);
                mc.theWorld.updateLightByType(EnumSkyBlock.Block, x - 1, y, z);
                mc.theWorld.updateLightByType(EnumSkyBlock.Block, x, y, z + 1);
                mc.theWorld.updateLightByType(EnumSkyBlock.Block, x, y, z - 1);
              }
            }
          }
        }
      }
     
      for(Object obj : mc.theWorld.loadedEntityList)
      {
        if(obj instanceof EntityBullet)
        {
          EntityBullet bullet = (EntityBullet)obj;
          if(!bullet.isDead && bullet.type.hasLight)
          {
            int x = MathHelper.floor_double(bullet.posX);
            int y = MathHelper.floor_double(bullet.posY);
            int z = MathHelper.floor_double(bullet.posZ);
            blockLightOverrides.add(new Vector3i(x, y, z));
            mc.theWorld.setLightValue(EnumSkyBlock.Block, x, y, z, 15);
            mc.theWorld.updateLightByType(EnumSkyBlock.Block, x, y + 1, z);
            mc.theWorld.updateLightByType(EnumSkyBlock.Block, x, y - 1, z);
            mc.theWorld.updateLightByType(EnumSkyBlock.Block, x + 1, y, z);
            mc.theWorld.updateLightByType(EnumSkyBlock.Block, x - 1, y, z);
            mc.theWorld.updateLightByType(EnumSkyBlock.Block, x, y, z + 1);
            mc.theWorld.updateLightByType(EnumSkyBlock.Block, x, y, z - 1);
          }
        }
        else if(obj instanceof EntityMecha)
        {
          EntityMecha mecha = (EntityMecha)obj;
          int x = MathHelper.floor_double(mecha.posX);
          int y = MathHelper.floor_double(mecha.posY);
          int z = MathHelper.floor_double(mecha.posZ);
          if(mecha.lightLevel() > 0)
          {
            blockLightOverrides.add(new Vector3i(x, y, z));
            mc.theWorld.setLightValue(EnumSkyBlock.Block, x, y, z, Math.max(mc.theWorld.getBlockLightValue(x, y, z), mecha.lightLevel()));
            mc.theWorld.updateLightByType(EnumSkyBlock.Block, x + 1, y, z);
            mc.theWorld.updateLightByType(EnumSkyBlock.Block, x - 1, y + 1, z);
            mc.theWorld.updateLightByType(EnumSkyBlock.Block, x, y + 1, z);
            mc.theWorld.updateLightByType(EnumSkyBlock.Block, x, y - 1, z);
            mc.theWorld.updateLightByType(EnumSkyBlock.Block, x, y, z + 1);
            mc.theWorld.updateLightByType(EnumSkyBlock.Block, x, y, z - 1);
          }
          if(mecha.forceDark())
          {
            for(int i = -3; i <= 3; i++)
            {
              for(int j = -3; j <= 3; j++)
              {
                for(int k = -3; k <= 3; k++)
                {
                  int xd = i + x;
                  int yd = j + y;
                  int zd = k + z;
                  blockLightOverrides.add(new Vector3i(xd, yd, zd));
                  mc.theWorld.setLightValue(EnumSkyBlock.Sky, xd, yd, zd, Math.abs(i) + Math.abs(j) + Math.abs(k));
                }
              }
            }
          }
View Full Code Here

Examples of org.terasology.math.Vector3i

    }


    @Override
    public Chunk getChunk(int x, int y, int z) {
        return getChunk(new Vector3i(x, y, z));
    }
View Full Code Here

Examples of org.terasology.math.Vector3i

    }

    @Override
    public ChunkViewCore getSubviewAroundBlock(Vector3i blockPos, int extent) {
        Region3i region = TeraMath.getChunkRegionAroundWorldPos(blockPos, extent);
        return createWorldView(region, new Vector3i(-region.min().x, -region.min().y, -region.min().z));
    }
View Full Code Here

Examples of org.terasology.math.Vector3i

    @Override
    public ChunkViewCore getSubviewAroundChunk(Vector3i chunkPos) {
        Region3i region = Region3i.createFromCenterExtents(chunkPos, ChunkConstants.LOCAL_REGION_EXTENTS);
        if (getChunk(chunkPos) != null) {
            return createWorldView(region, new Vector3i(-region.min().x, -region.min().y, -region.min().z));
        }
        return null;
    }
View Full Code Here

Examples of org.terasology.math.Vector3i

        public int compare(ChunkTask o1, ChunkTask o2) {
            return score(o1.getPosition()) - score(o2.getPosition());
        }

        private int score(Vector3i chunk) {
            Vector3i playerChunk = TeraMath.calcChunkPos(new Vector3i(localPlayer.getPosition(), 0.5f));
            return playerChunk.distanceSquared(chunk);
        }
View Full Code Here

Examples of org.terasology.math.Vector3i

        if (blockSelectionComponent.currentSelection == null) {
            if (blockSelectionComponent.startPosition != null) {
                selectionRenderer.renderMark(blockSelectionComponent.startPosition);
            }
        } else {
            Vector3i size = blockSelectionComponent.currentSelection.size();
            Vector3i block = new Vector3i();
            for (int z = 0; z < size.z; z++) {
                for (int y = 0; y < size.y; y++) {
                    for (int x = 0; x < size.x; x++) {
                        block.set(x, y, z);
                        block.add(blockSelectionComponent.currentSelection.min());
                        selectionRenderer.renderMark(block);
                    }
                }
            }
        }
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.