Package org.spout.math.vector

Examples of org.spout.math.vector.Vector3f


      yy--;
    }
  }

  public void placeObject(int xx, int yy, int zz, WorldGeneratorObject object) {
    final Vector3f transformed = transform(xx, yy, zz);
    if (object.canPlaceObject(position.getWorld(), transformed.getFloorX(), transformed.getFloorY(), transformed.getFloorZ())) {
      object.placeObject(position.getWorld(), transformed.getFloorX(), transformed.getFloorY(), transformed.getFloorZ());
    }
  }
View Full Code Here


  protected Vector3f transform(int x, int y, int z) {
    return rotate(x, y, z).add(position).round();
  }

  protected Vector3f rotate(int x, int y, int z) {
    return Matrix3f.createRotation(rotation).transform(new Vector3f(x, y, z).sub(rotationPoint)).add(rotationPoint);
  }
View Full Code Here

    private final Vector3f min;
    private final Vector3f max;

    public BoundingBox(float xA, float yA, float zA,
               float xB, float yB, float zB) {
      this(new Vector3f(xA, yA, zA), new Vector3f(xB, yB, zB));
    }
View Full Code Here

    public float getZSize() {
      return max.getZ() - min.getZ();
    }

    public boolean intersects(BoundingBox box) {
      final Vector3f rMax = box.getMax();
      if (rMax.getX() < min.getX()
          || rMax.getY() < min.getY()
          || rMax.getZ() < min.getZ()) {
        return false;
      }
      final Vector3f rMin = box.getMin();
      return !(rMin.getX() > max.getX()
          || rMin.getY() > max.getY()
          || rMin.getZ() > max.getZ());
    }
View Full Code Here

    int shakeForce = getShakingForce();
    if (shakeForce > 0) {
      setShakingForce(shakeForce - 1);
    }

    getOwner().getPhysics().setMovementVelocity(new Vector3f(0.2, 0.0, 0.0));
  }
View Full Code Here

  private static Vector3f countToOffset(int count) {
    switch (count) {
      case 0:
        return Vector3f.ZERO;
      case 1:
        return new Vector3f(0, 16, 0);
      case 2:
        return new Vector3f(0, -16, 0);
      default:
        return Vector3f.ZERO;
    }
  }
View Full Code Here

      }
    }
  }

  private void setBlockMaterial(int xx, int zz, BlockMaterial material) {
    final Vector3f transformed = transform(xx, zz);
    parent.setBlockMaterial(transformed.getFloorX(), transformed.getFloorY(), transformed.getFloorZ(), material);
  }
View Full Code Here

    final Vector3f transformed = transform(xx, zz);
    parent.setBlockMaterial(transformed.getFloorX(), transformed.getFloorY(), transformed.getFloorZ(), material);
  }

  private Vector3f transform(int x, int z) {
    final Vector3f rotPoint = new Vector3f(rotationPoint.getX(), rotationPoint.getY(), rotationPoint.getZ());
    return Matrix3f.createRotation(rotation).transform(new Vector3f(x, 0, z).sub(rotPoint)).
        add(rotPoint).add(position.getX(), position.getY(), position.getZ()).round();
  }
View Full Code Here

  }

  @Override
  protected void generateTerrain(CuboidBlockMaterialBuffer blockData, int x, int y, int z, BiomeManager biomeManager, long seed) {
    PERLIN.setSeed((int) seed * 17);
    final Vector3f size = blockData.getSize();
    final int sizeX = size.getFloorX();
    final int sizeY = Math.min(size.getFloorY(), HEIGHT);
    final int sizeZ = size.getFloorZ();
    final double[][][] noise = WorldGeneratorUtils.fastNoise(NOISE, sizeX, sizeY, sizeZ, 4, x, y, z);
    for (int xx = 0; xx < sizeX; xx++) {
      for (int zz = 0; zz < sizeZ; zz++) {
        for (int yy = 0; yy < sizeY; yy++) {
          double value = noise[xx][yy][zz];
View Full Code Here

   * @param position to spawn the item
   * @param itemStack to set to the item
   * @return the Item entity
   */
  public static Item dropNaturally(Point position, ItemStack itemStack) {
    Vector3f velocity = new Vector3f(Math.random() * 2, 0.3, Math.random() * 2);
    return drop(position, itemStack, velocity);
  }
View Full Code Here

TOP

Related Classes of org.spout.math.vector.Vector3f

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.