Package crazypants.vecmath

Examples of crazypants.vecmath.Vector3d.scale()


    return new Vector3d(OFFSETS[dir.ordinal()]);
  }

  public static Vector3d offsetScaled(ForgeDirection dir, double scale) {
    Vector3d res = forDirCopy(dir);
    res.scale(scale);
    return res;
  }

  public ForgeDirection closest(float x, float y, float z) {
    float ax = Math.abs(x);
View Full Code Here


  public boolean doBlink(ItemStack equipped, EntityPlayer player) {
    Vector3d eye = Util.getEyePositionEio(player);
    Vector3d look = Util.getLookVecEio(player);

    Vector3d sample = new Vector3d(look);
    sample.scale(Config.travelStaffMaxBlinkDistance);
    sample.add(eye);
    Vec3 eye3 = Vec3.createVectorHelper(eye.x, eye.y, eye.z);
    Vec3 end = Vec3.createVectorHelper(sample.x, sample.y, sample.z);

    double playerHeight = player.yOffset;
View Full Code Here

      //go as far as possible
      for (double i = maxDistance; i > 1; i--) {

        sample.set(look);
        sample.scale(i);
        sample.add(eye);
        //we test against our feets location
        sample.y -= playerHeight;
        if(doBlinkAround(player, sample, true)) {
          return true;
View Full Code Here

      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

    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) {
View Full Code Here

    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

    return result;
  }

  public Vector3d getTranslation(ForgeDirection dir, Offset offset) {
    Vector3d result = new Vector3d(offset.xOffset, offset.yOffset, offset.zOffset);
    result.scale(WIDTH);
    return result;
  }

  public BoundingBox createBoundsForConnectionController(ForgeDirection dir, Offset offset) {
View Full Code Here

  }

  public BoundingBox createBoundsForConnectionController(ForgeDirection dir, Offset offset) {

    Vector3d nonUniformScale = ForgeDirectionOffsets.forDirCopy(dir);
    nonUniformScale.scale(0.5);

    nonUniformScale.x = 0.8 * (1 - Math.abs(nonUniformScale.x));
    nonUniformScale.y = 0.8 * (1 - Math.abs(nonUniformScale.y));
    nonUniformScale.z = 0.8 * (1 - Math.abs(nonUniformScale.z));

View Full Code Here

    offsetFromEnd = Math.min(offsetFromEnd, bb.sizeZ());
    offsetFromEnd = Math.max(offsetFromEnd, 0.075);
    double transMag = 0.5 - (offsetFromEnd * 1.2);

    Vector3d trans = ForgeDirectionOffsets.forDirCopy(dir);
    trans.scale(transMag);
    bb = bb.translate(trans);
    bb = bb.translate(getTranslation(dir, offset));
    return bb;
  }

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.