Package universalelectricity.api.vector

Examples of universalelectricity.api.vector.Vector3.rotate()


    Vector3 projectorPos = new Vector3((TileEntity) projector);
    projectorPos.add(projector.getTranslation());

    Vector3 relativePosition = position.clone().subtract(projectorPos);
    relativePosition.rotate(-projector.getRotationYaw(), -projector.getRotationPitch());

    if (relativePosition.x * relativePosition.x + relativePosition.z * relativePosition.z + RADIUS_Expansion <= radius * radius)
    {
      return true;
    }
View Full Code Here


      if (projector.getMode() instanceof ItemModeCustom && !(projector.getModuleCount(ModularForceFieldSystem.itemModuleCamouflage) > 0))
      {
        HashMap<Vector3, int[]> fieldBlocks = ((ItemModeCustom) projector.getMode()).getFieldBlockMap(projector, projector.getModeStack());
        Vector3 fieldCenter = new Vector3((TileEntity) projector).translate(projector.getTranslation());
        Vector3 relativePosition = position.clone().subtract(fieldCenter);
        relativePosition.rotate(-projector.getRotationYaw(), -projector.getRotationPitch());
        blockInfo = fieldBlocks.get(relativePosition.round());
      }

      // Search nearby inventories to extract blocks.
      for (int dir = 0; dir < 6; dir++)
View Full Code Here

    double zDifference = this.posZ - orbitPosition.z;

    double speed = this.maxSpeed * ((float) this.particleAge / (float) this.particleMaxAge);
    Vector3 originalPosition = new Vector3(this);
    Vector3 relativePosition = originalPosition.clone().subtract(this.orbitPosition);
    relativePosition.rotate(speed, 0, 0);
    Vector3 newPosition = this.orbitPosition.clone().add(relativePosition);
    this.rotation += speed;

    // Orbit
    this.moveEntity(newPosition.x - originalPosition.x, newPosition.y - originalPosition.y, newPosition.z - originalPosition.z);
View Full Code Here

              if (fieldMap != null)
              {
                Vector3 fieldCenter = new Vector3((TileEntity) projector).translate(projector.getTranslation());
                Vector3 relativePosition = position.clone().subtract(fieldCenter);
                relativePosition.rotate(-projector.getRotationYaw(), -projector.getRotationPitch());
                int[] blockInfo = fieldMap.get(relativePosition.round());

                if (blockInfo != null && blockInfo[0] > 0)
                {
                  return new ItemStack(Block.blocksList[blockInfo[0]], 1, blockInfo[1]);
View Full Code Here

  public boolean isInField(IFieldInteraction projector, Vector3 position)
  {
    Vector3 projectorPos = new Vector3((TileEntity) projector);
    projectorPos.add(projector.getTranslation());
    Vector3 relativePosition = position.clone().subtract(projectorPos);
    relativePosition.rotate(-projector.getRotationYaw(), -projector.getRotationPitch());
    Cuboid region = new Cuboid(projector.getNegativeScale().clone().scale(-1), projector.getPositiveScale());
    return region.intersects(relativePosition);
  }

  @SideOnly(Side.CLIENT)
View Full Code Here

    Vector3 projectorPos = new Vector3((TileEntity) projector);
    projectorPos.add(projector.getTranslation());
    projectorPos.add(new Vector3(0, -negScale.intY() + 1, 0));

    Vector3 relativePosition = position.clone().subtract(projectorPos);
    relativePosition.rotate(-projector.getRotationYaw(), -projector.getRotationPitch());

    Cuboid region = new Cuboid(negScale.scale(-1), posScale);

    if (region.isIn(relativePosition) && relativePosition.y > 0)
    {
View Full Code Here

    {
      Vector3 newPosition = position.clone();

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

      newPosition.translate(new Vector3(this));
      newPosition.translate(translation);
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.