Package universalelectricity.api.vector

Examples of universalelectricity.api.vector.Vector3


    float height = 0.5f;
    float width = 0.3f;
    int uvMaxX = 2;
    int uvMaxY = 2;
    Vector3 translation = new Vector3(0, -0.4, 0);
    tessellator.startDrawing(6);
    tessellator.setColorRGBA(72, 198, 255, 255);
    tessellator.addVertexWithUV(0 + translation.x, 0 + translation.y, 0 + translation.z, 0, 0);
    tessellator.addVertexWithUV(-width + translation.x, height + translation.y, -width + translation.z, -uvMaxX, -uvMaxY);
    tessellator.addVertexWithUV(-width + translation.x, height + translation.y, width + translation.z, -uvMaxX, uvMaxY);
View Full Code Here


    zScaleNeg += omnidirectionalScale;
    xScaleNeg += omnidirectionalScale;
    yScaleNeg += omnidirectionalScale;

    Vector3 negativeScale = new Vector3(xScaleNeg, yScaleNeg, zScaleNeg);

    if (Settings.USE_CACHE)
    {
      this.cache.put(cacheID, negativeScale);
    }
View Full Code Here

      ((ItemModuleArray) ModularForceFieldSystem.itemModuleArray).onPreCalculateInterior(this, getMode().getExteriorPoints(this), newField);
    }

    Set<Vector3> returnField = new HashSet();

    Vector3 translation = this.getTranslation();
    int rotationYaw = this.getRotationYaw();
    int rotationPitch = this.getRotationPitch();

    for (Vector3 position : newField)
    {
      Vector3 newPosition = position.clone();

      if (rotationYaw != 0 || rotationPitch != 0)
      {
        newPosition.rotate(rotationYaw, rotationPitch);
      }

      newPosition.translate(new Vector3(this));
      newPosition.translate(translation);

      returnField.add(newPosition);
    }

    if (Settings.USE_CACHE)
View Full Code Here

      for (int theta_n = 0; theta_n < steps; theta_n++)
      {
        double phi = Math.PI * 2 / steps * phi_n;
        double theta = Math.PI / steps * theta_n;

        Vector3 point = new Vector3(Math.sin(theta) * Math.cos(phi), Math.cos(theta), Math.sin(theta) * Math.sin(phi)).scale(radius);
        fieldBlocks.add(point);
      }
    }

    return fieldBlocks;
View Full Code Here

  @Override
  public Set<Vector3> getInteriorPoints(IFieldInteraction projector)
  {
    Set<Vector3> fieldBlocks = new HashSet<Vector3>();
    final Vector3 translation = projector.getTranslation();

    int radius = projector.getModuleCount(ModularForceFieldSystem.itemModuleScale);

    for (int x = -radius; x <= radius; x++)
    {
      for (int z = -radius; z <= radius; z++)
      {
        for (int y = -radius; y <= radius; y++)
        {
          Vector3 position = new Vector3(x, y, z);

          if (this.isInField(projector, Vector3.translate(position, new Vector3((TileEntity) projector)).add(translation)))
          {
            fieldBlocks.add(position);
          }
        }
      }
View Full Code Here

  }

  @Override
  public boolean isInField(IFieldInteraction projector, Vector3 position)
  {
    return new Vector3((TileEntity) projector).add(projector.getTranslation()).distance(position) < projector.getModuleCount(ModularForceFieldSystem.itemModuleScale);
  }
View Full Code Here

      for (int theta_n = 0; theta_n < steps; theta_n++)
      {
        double phi = Math.PI * 2 / steps * phi_n;
        double theta = Math.PI / steps * theta_n;

        Vector3 vector = new Vector3(Math.sin(theta) * Math.cos(phi), Math.cos(theta), Math.sin(theta) * Math.sin(phi));
        vector.scale(radius);
        GL11.glTranslated(vector.x, vector.y, vector.z);
        ModelCube.INSTNACE.render();
        GL11.glTranslated(-vector.x, -vector.y, -vector.z);
      }
    }
View Full Code Here

  @Override
  public Set<Vector3> getExteriorPoints(IFieldInteraction projector)
  {
    Set<Vector3> fieldBlocks = new HashSet<Vector3>();
    ForgeDirection direction = projector.getDirection();
    Vector3 posScale = projector.getPositiveScale();
    Vector3 negScale = projector.getNegativeScale();

    for (float x = -negScale.intX(); x <= posScale.intX(); x += 0.5f)
    {
      for (float z = -negScale.intZ(); z <= posScale.intZ(); z += 0.5f)
      {
        for (float y = -negScale.intY(); y <= posScale.intY(); y += 0.5f)
        {
          if (!(direction == ForgeDirection.UP || direction == ForgeDirection.DOWN) && (y == -negScale.intY() || y == posScale.intY()))
          {
            fieldBlocks.add(new Vector3(x, y, z));
            continue;
          }

          if (!(direction == ForgeDirection.NORTH || direction == ForgeDirection.SOUTH) && (z == -negScale.intZ() || z == posScale.intZ()))
          {
            fieldBlocks.add(new Vector3(x, y, z));
            continue;
          }

          if (!(direction == ForgeDirection.WEST || direction == ForgeDirection.EAST) && (x == -negScale.intX() || x == posScale.intX()))
          {
            fieldBlocks.add(new Vector3(x, y, z));
            continue;
          }
        }
      }
    }
View Full Code Here

          {
            this.setFortronEnergy(this.getFortronCapacity());
          }
          else if (itemStack.getItem() instanceof ICoordLink)
          {
            Vector3 linkPosition = ((ICoordLink) itemStack.getItem()).getLink(itemStack);

            if (linkPosition != null && linkPosition.getTileEntity(this.worldObj) instanceof IFortronFrequency)
            {
              machines.add(this);
              machines.add((IFortronFrequency) linkPosition.getTileEntity(this.worldObj));
            }
          }
        }
      }
View Full Code Here

  @Override
  public Set<IFortronFrequency> getLinkedDevices()
  {
    Set<IFortronFrequency> fortronBlocks = new HashSet<IFortronFrequency>();
    Set<IBlockFrequency> frequencyBlocks = FrequencyGrid.instance().get(this.worldObj, new Vector3(this), this.getTransmissionRange(), this.getFrequency());

    for (IBlockFrequency frequencyBlock : frequencyBlocks)
    {
      if (frequencyBlock instanceof IFortronFrequency)
      {
View Full Code Here

TOP

Related Classes of universalelectricity.api.vector.Vector3

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.