Package Hexel.math

Examples of Hexel.math.Vector3d


    HexGeometry.cartesianToBlock(c.getX(), c.getY(), c.getZ(), tmp, checkBlockPos);
    final ArrayList<Vector3i> blocks = new ArrayList<Vector3i>();
    BlockTools.pointFloodSearch(checkBlockPos, new PointFloodSearchMatcher(){
      @Override
      public boolean matches(Vector3i p) {
        Vector3d partialFix = Resources.vector3dResourcePool.aquire();
        partialFix.x = 0;
        partialFix.y = 0;
        partialFix.z = 0;
        collides(c, zeroOffset, p.x, p.y, p.z, partialFix, fixOffsetTmps.collidesTmps);
        if (partialFix.x != 0 || partialFix.y != 0 || partialFix.z != 0){
View Full Code Here


    });
    return blocks;
  }

  public boolean isOutOfRangeOfCamera(Volumetric v){
    Vector3d c = Resources.vector3dResourcePool.aquire();
    c.x = this.engine.camera.getCameraX();
    c.y = this.engine.camera.getCameraY();
    c.z = this.engine.camera.getCameraZ();
    Vector3d p = Resources.vector3dResourcePool.aquire();
    v.getXYZ(p);

    Resources.vector3dResourcePool.recycle(c);
    Resources.vector3dResourcePool.recycle(p);

    return p.distance(c) > this.engine.chunkVisibilityManager.renderDistance;
  }
View Full Code Here

    Vector3i checkBlockPos = tmps.tmp3i;
    HexGeometry.cartesianToBlock(c.getX(), c.getY(), c.getZ(), tmps.tmp2d, checkBlockPos);
    BlockTools.pointFloodSearch(checkBlockPos, new PointFloodSearchMatcher(){
      @Override
      public boolean matches(Vector3i p) {
        Vector3d partialFix = Resources.vector3dResourcePool.aquire();
        partialFix.x = 0;
        partialFix.y = 0;
        partialFix.z = 0;
        collides(c, offset, p.x, p.y, p.z, partialFix, tmps.collidesTmps);
        if (partialFix.x != 0 || partialFix.y != 0 || partialFix.z != 0){
          Block b = chunks.getBlock(p.x, p.y, p.z, tmps.tmp3i, (Chunk)null);
          if (checkCollidableBlock.isColliding(b)){
            tmps.toFixBlockSet.add(partialFix);
            return true;
          }
          else {
            Resources.vector3dResourcePool.recycle(partialFix);
            return true;
          }
        }
        else {
          Resources.vector3dResourcePool.recycle(partialFix);
        }
        return false;
      }
    });


    Vector3d toFix = new Vector3d();
    for (Vector3d toFixBlock : tmps.toFixBlockSet) {
      toFix.add(toFixBlock);
      Resources.vector3dResourcePool.recycle(toFixBlock);
    }
    if (toFix.mag() == 0)
      return null;
    else {
      return toFix;
    }
  }
View Full Code Here

    axis[3] = null;
    axis[4] = null;
    axis[5] = null;


    Vector3d up = tmps.up;
    for (int i = 0; i < points.length; i++) {
      Vector2i v = points[i];
      Vector2i u = points[(i + 1) % points.length];
      Vector2d vd = tmps.vd;
      Vector2d ud = tmps.ud;
      HexGeometry.hexToCartesian(v.x, v.y, vd);
      HexGeometry.hexToCartesian(u.x, u.y, ud);

      Vector3d plane = tmps.v3d3[i];
      plane.x = vd.x - ud.x;
      plane.y = vd.y - ud.y;
      plane.z = 0;
      plane.cross(up);
      plane.unit();
      axis[3 + i] = plane;
      if (plane.y == -1)
        plane.y = 1;
    }
    double[] magnitudes = tmps.d6;
View Full Code Here

    this.dz = 0;
  }

  @Override
  public Vector3d getReqMoveVector(double fps) {
    Vector3d v = new Vector3d();
    double dragZ = 1;
    double dragXY = 1;
    if (this.thingBridge.inWater(this)) {
      dragZ = .5;
      dragXY = .75;
View Full Code Here

TOP

Related Classes of Hexel.math.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.