Package crazypants.vecmath

Examples of crazypants.vecmath.Vector3d


  private void doTileEntityRenderPass(List<BlockCoord> blocks, int pass) {
    ForgeHooksClient.setRenderPass(pass);
    for (BlockCoord bc : blocks) {
      TileEntity tile = world.getTileEntity(bc.x, bc.y, bc.z);
      if(tile != null) {
        Vector3d at = new Vector3d(eye.x, eye.y, eye.z);
        at.x += bc.x - origin.x;
        at.y += bc.y - origin.y;
        at.z += bc.z - origin.z;
        TileEntityRendererDispatcher.instance.renderTileEntityAt(tile, at.x, at.y, at.z, 0);
      }
View Full Code Here


  private Vector3d offset = new Vector3d();

  private void drawSwitch(ForgeDirection dir, BoundingBox bb) {
    Tessellator tes = Tessellator.instance;

    Vector3d cent = bb.getCenter();
    offset.set(cent);

    boolean isUp = dir.offsetY != 0;

    if(dir == ForgeDirection.UP) {
View Full Code Here

      Tessellator tes = Tessellator.instance;
      Vector2f u = gb.getMinMaxU(icon);
      List<Vertex> corners = gb.bb.getCornersWithUvForFace(gb.face, u.x, u.y, icon.getMinV(), icon.getMaxV());
      for (Vertex coord : corners) {
        coord.xyz.add(ForgeDirectionOffsets.offsetScaled(gb.face, 0.001f));
        Vector3d xyz = new Vector3d(coord.xyz);
        xyz.x += x;
        xyz.y += y;
        xyz.z += z;
        Vertex v = getClosestVertex(vertices, xyz);
        if(v != null) {
View Full Code Here

      Vector2f u = gb.getMinMaxU(icon);
      List<crazypants.vecmath.Vertex> corners = gb.bb.getCornersWithUvForFace(gb.face, u.x, u.y, icon.getMinV(), maxV);
      for (Vertex coord : corners) {
        coord.xyz.add(ForgeDirectionOffsets.offsetScaled(gb.face, 0.002f));

        Vector3d xyz = new Vector3d(coord.xyz);
        xyz.x += x;
        xyz.y += y;
        xyz.z += z;
        Vertex v = getClosestVertex(vertices, xyz);
        if(v != null) {
View Full Code Here

            float xOffset = 0.52f * (1 - dir.offsetX) (dir.offsetX * (-0.1F + rand.nextFloat() * 0.2F));
            float yOffset = -0.1F + rand.nextFloat() * 0.2F;
            float zOffset = 0.52f * (1 - dir.offsetZ) (dir.offsetZ * (-0.1F + rand.nextFloat() * 0.2F));

            if(rand.nextFloat() > 0.5) {
              VertexRotation vr = new VertexRotation(Math.PI/4, new Vector3d(0,1,0), new Vector3d(0.5,0.25,0.5));
              Vector3d vec = new Vector3d(xOffset, yOffset, zOffset);
              vr.apply(vec);
              xOffset = (float)vec.x;
              yOffset = (float)vec.y;
              zOffset = (float)vec.z;

View Full Code Here

    BlockCoord railCoord = new BlockCoord(transciever).getLocation(ForgeDirection.UP);
    int meta = worldObj.getBlockMetadata(railCoord.x, railCoord.y, railCoord.z);

    double buf = 1;
    ForgeDirection dir = BlockEnderRail.getDirection(meta);
    Vector3d offset = ForgeDirectionOffsets.forDirCopy(dir);
    offset.scale(buf);
    offset.x = Math.abs(offset.x);
    offset.z = Math.abs(offset.z);
    List res = worldObj.getEntitiesWithinAABB(Entity.class, AxisAlignedBB.getBoundingBox(railCoord.x - offset.x, railCoord.y,
        railCoord.z - offset.z, railCoord.x + 1 + offset.x, railCoord.y + 1, railCoord.z + 1 + offset.z));
    return res == null || res.isEmpty();
View Full Code Here

      List<EntityMinecart> carts = getMinecartsOnTrack();
      for (EntityMinecart cart : carts) {
        if(cart != null && cart.getPersistentID().equals(cartId)) {
          EntityPlayer player = transciever.getWorldObj().getPlayerEntityByName(playerName);
          if(player != null) {
            Vector3d playerPos = EntityUtil.getEntityPosition(player);
            Vector3d cartPos = EntityUtil.getEntityPosition(cart);
            if(playerPos.distanceSquared(cartPos) <= 9) {
              player.posX = cart.posX;
              player.posY = cart.posY;
              player.posZ = cart.posZ;
              player.mountEntity(cart);
View Full Code Here

    @Override
    public void renderFace(CustomRenderBlocks rb, ForgeDirection face, Block par1Block, double x, double y, double z, IIcon texture, List<Vertex> refVertices,
        boolean translateToXyz) {

      if(gen != null && par1Block instanceof AbstractMachineBlock) {
        Vector3d offset = ForgeDirectionOffsets.offsetScaled(face, 0.01);
        Tessellator.instance.addTranslation((float) offset.x, (float) offset.y, (float) offset.z);

        IoMode mode = gen.getIoMode(face);
        IIcon tex = ((AbstractMachineBlock) par1Block).getOverlayIconForMode(mode);
        if(tex != null) {
View Full Code Here

    @Override
    public void renderFace(CustomRenderBlocks rb, ForgeDirection face, Block par1Block, double x, double y, double z, IIcon texture, List<Vertex> refVertices,
        boolean translateToXyz) {
      if(xform != null) {
        Vector3d xyz = new Vector3d(x,y,z);
        for (Vertex v : refVertices) {
          v.xyz.sub(xyz);
          xform.apply(v);
          if(!enableLighting) {
            v.brightness = 15 << 20 | 15 << 4;
View Full Code Here

      BoundingBox bb = BoundingBox.UNIT_CUBE.scale(xLen, yLen, zLen);

      List<Vector3f> corners = bb.getCornersForFace(face);

      for (Vector3f unitCorn : corners) {
        Vector3d corner = new Vector3d(unitCorn);
        if(translateToXYZ) {
          corner.x += x;
          corner.y += y;
          corner.z += z;
        }
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.