Package crazypants.vecmath

Examples of crazypants.vecmath.Vector3d


    if(Mouse.getEventButton() == 1 && !Mouse.getEventButtonState() && camera.isValid() && elapsed > 10) {

      int x = Mouse.getEventX();
      int y = Mouse.getEventY();
      Vector3d start = new Vector3d();
      Vector3d end = new Vector3d();
      if(camera.getRayForPixel(x, y, start, end)) {
        end.scale(distance * 2);
        end.add(start);
        doSelection(start, end);
      }

    }

View Full Code Here


        RenderHelper.disableStandardItemLighting();
        mc.entityRenderer.enableLightmap(0);
        RenderUtil.bindBlockTexture();

        Vector3d trans = new Vector3d((-origin.x) + eye.x, (-origin.y) + eye.y, (-origin.z) + eye.z);
        for (int pass = 0; pass < 2; pass++) {

          ForgeHooksClient.setRenderPass(pass);
          setGlStateForPass(pass);

          Tessellator.instance.startDrawingQuads();
          Tessellator.instance.setTranslation(trans.x, trans.y, trans.z);

          for (ViewableBlocks ug : blocks) {
            if(ug.block.canRenderInPass(pass)) {
              RB.setRenderBounds(0, 0, 0, 1, 1, 1);
              RB.renderBlockByRenderType(ug.block, ug.bc.x, ug.bc.y, ug.bc.z);
            }
          }
          Tessellator.instance.draw();
          Tessellator.instance.setTranslation(0, 0, 0);
        }

        RenderHelper.enableStandardItemLighting();

        TileEntityRendererDispatcher.instance.field_147558_l = origin.x - eye.x;
        TileEntityRendererDispatcher.instance.field_147560_j = origin.y - eye.y;
        TileEntityRendererDispatcher.instance.field_147561_k = origin.z - eye.z;

        TileEntityRendererDispatcher.staticPlayerX = origin.x - eye.x;
        TileEntityRendererDispatcher.staticPlayerY = origin.y - eye.y;
        TileEntityRendererDispatcher.staticPlayerZ = origin.z - eye.z;

        for (int pass = 0; pass < 2; pass++) {

          ForgeHooksClient.setRenderPass(pass);
          setGlStateForPass(pass);

          for (ViewableBlocks ug : blocks) {
            TileEntity tile = world.getTileEntity(ug.bc.x, ug.bc.y, ug.bc.z);
            if(tile != null) {
              Vector3d at = new Vector3d(eye.x - 0.5, eye.y - 0.5, eye.z - 0.5);
              at.x += ug.bc.x - ioX;
              at.y += ug.bc.y - ioY;
              at.z += ug.bc.z - ioZ;
              TileEntityRendererDispatcher.instance.renderTileEntityAt(tile, at.x, at.y, at.z, 0);
            }
View Full Code Here

    TileCapacitorBank tr = (TileCapacitorBank) te;
    if(!tr.isMultiblock()) {
      return super.getSelectedBoundingBoxFromPool(world, x, y, z);
    }

    Vector3d min = new Vector3d(Double.MAX_VALUE, Double.MAX_VALUE, Double.MAX_VALUE);
    Vector3d max = new Vector3d(-Double.MAX_VALUE, -Double.MAX_VALUE, -Double.MAX_VALUE);
    for (BlockCoord bc : tr.multiblock) {
      min.x = Math.min(min.x, bc.x);
      max.x = Math.max(max.x, bc.x + 1);
      min.y = Math.min(min.y, bc.y);
      max.y = Math.max(max.y, bc.y + 1);
View Full Code Here

   
    return res;
  }
 
  public static void sendXPUpdate(EntityPlayer player, World world, int x, int y, int z, boolean swing) {
    Vector3d look = Util.getLookVecEio(player);
    double xP = player.posX + look.x;
    double yP = player.posY + 1.5;
    double zP = player.posZ + look.z;             
    TargetPoint tp = new TargetPoint(player.dimension, x, y, z, 32);
    EnderIO.packetPipeline.INSTANCE.sendTo(new PacketXpTransferEffects(swing, xP, yP, zP), (EntityPlayerMP)player);
View Full Code Here

      }

      for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) {
        if(dir != face && dir != face.getOpposite()) { // don't project behind
          // us
          Vector3d offset = ForgeDirectionOffsets.forDirCopy(dir);
          addNodeInDirection(new Vector3d(offset), after);
          addNodeInDirection(offset.add(ForgeDirectionOffsets.forDirCopy(face.getOpposite())), after);
        }
      }

      addNodeInDirection(ForgeDirectionOffsets.forDirCopy(face.getOpposite()), after);

      Vector3d[] diags = new Vector3d[2];
      if(face.offsetX != 0) {
        diags[0] = ForgeDirectionOffsets.forDirCopy(ForgeDirection.UP);
        diags[1] = ForgeDirectionOffsets.forDirCopy(ForgeDirection.SOUTH);
      } else if(face.offsetY != 0) {
        diags[0] = ForgeDirectionOffsets.forDirCopy(ForgeDirection.EAST);
        diags[1] = ForgeDirectionOffsets.forDirCopy(ForgeDirection.SOUTH);
      } else {
        diags[0] = ForgeDirectionOffsets.forDirCopy(ForgeDirection.UP);
        diags[1] = ForgeDirectionOffsets.forDirCopy(ForgeDirection.EAST);
      }
      addDiaganals(diags, new Vector3d(), after);
      addDiaganals(diags, ForgeDirectionOffsets.forDirCopy(face.getOpposite()), after);

      if(!areEqual(before, after)) {

        clearLightNodes();
View Full Code Here

    }
    return true;
  }

  private void addDiaganals(Vector3d[] diags, Vector3d trans, List<NodeEntry> result) {
    Vector3d offset = new Vector3d();
    offset.set(diags[0]);
    offset.add(diags[1]);
    addNodeInDirection(offset.add(trans), true, result);

    offset.set(diags[0]);
    offset.sub(diags[1]);
    addNodeInDirection(offset.add(trans), true, result);

    offset.set(new Vector3d(diags[0]).negate());
    offset.add(diags[1]);
    addNodeInDirection(offset.add(trans), true, result);

    offset.set(new Vector3d(diags[0]).negate());
    offset.sub(diags[1]);
    addNodeInDirection(offset.add(trans), true, result);
  }
View Full Code Here

  }

  public IoConfigRenderer(List<BlockCoord> configurables) {
    this.configurables.addAll(configurables);

    Vector3d c;
    Vector3d size;
    if(configurables.size() == 1) {
      BlockCoord bc = configurables.get(0);
      c = new Vector3d(bc.x + 0.5, bc.y + 0.5, bc.z + 0.5);
      size = new Vector3d(1,1,1);
    } else {
      Vector3d min = new Vector3d(Double.MAX_VALUE,Double.MAX_VALUE,Double.MAX_VALUE);
      Vector3d max = new Vector3d(-Double.MAX_VALUE,-Double.MAX_VALUE,-Double.MAX_VALUE);
      for(BlockCoord bc : configurables) {
        min.set(Math.min(bc.x, min.x),Math.min(bc.y, min.y),Math.min(bc.z, min.z));
        max.set(Math.max(bc.x, max.x),Math.max(bc.y, max.y),Math.max(bc.z, max.z));
      }
      size = new Vector3d(max);
      size.sub(min);
      size.scale(0.5);
      c = new Vector3d(min.x + size.x, min.y + size.y,min.z + size.z);
      size.scale(2);
    }

    originBC = new BlockCoord((int) c.x, (int) c.y, (int) c.z);
    origin.set(c);
View Full Code Here

    long elapsed = System.currentTimeMillis() - initTime;
   
    int x = Mouse.getEventX();
    int y = Mouse.getEventY();
    Vector3d start = new Vector3d();
    Vector3d end = new Vector3d();
    if(camera.getRayForPixel(x, y, start, end)) {
      end.scale(distance * 2);
      end.add(start);
      updateSelection(start, end);
    }

    if(!Mouse.getEventButtonState() && camera.isValid() && elapsed > 500) {
      if(Mouse.getEventButton() == 1) {
View Full Code Here

    GL11.glDisable(GL11.GL_LIGHTING);
    RenderUtil.bindBlockTexture();
    GL11.glColor3f(1,1,1);
    Tessellator.instance.startDrawingQuads();
    Tessellator.instance.setColorOpaque_F(1, 1, 1);
    Vector3d trans = new Vector3d((-origin.x) + eye.x, (-origin.y) + eye.y, (-origin.z) + eye.z);
    Tessellator.instance.setTranslation(trans.x, trans.y, trans.z);
    RenderUtil.addVerticesToTesselator(corners);
    Tessellator.instance.draw();
    Tessellator.instance.setTranslation(0,0,0);
View Full Code Here

    RenderUtil.bindBlockTexture();
    GL11.glDisable(GL11.GL_LIGHTING);
    GL11.glEnable(GL11.GL_TEXTURE_2D);
    GL11.glEnable(GL11.GL_ALPHA_TEST);

    Vector3d trans = new Vector3d((-origin.x) + eye.x, (-origin.y) + eye.y, (-origin.z) + eye.z);
    for (int pass = 0; pass < 1; pass++) {
      setGlStateForPass(pass, false);
      doWorldRenderPass(trans, configurables, pass);
      if(renderNeighbours) {
        setGlStateForPass(pass, true);
View Full Code Here

TOP

Related Classes of crazypants.vecmath.Vector3d

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.