Examples of Vector4d


Examples of crazypants.vecmath.Vector4d

        }
      }
    }

    private boolean isRightFace(BlockCoord me, BlockCoord[] mb, ForgeDirection dir) {
      Vector4d uPlane = RenderUtil.getUPlaneForFace(dir);

      int myRightVal = (int) uPlane.x * me.x + (int) uPlane.y * me.y + (int) uPlane.z * me.z;
      int max = myRightVal;
      for (BlockCoord bc : mb) {
        int val = (int) uPlane.x * bc.x + (int) uPlane.y * bc.y + (int) uPlane.z * bc.z;
 
View Full Code Here

Examples of crazypants.vecmath.Vector4d

  public static Vector4d getVPlaneForFace(ForgeDirection face) {
    switch (face) {
    case DOWN:
    case UP:
      return new Vector4d(0, 0, 1, 0);
    case EAST:
    case WEST:
    case NORTH:
    case SOUTH:
      return new Vector4d(0, -1, 0, 1);
    case UNKNOWN:
    default:
      break;
    }
    return null;
View Full Code Here

Examples of crazypants.vecmath.Vector4d

  public static Vector4d getUPlaneForFace(ForgeDirection face) {
    switch (face) {
    case DOWN:
    case UP:
      return new Vector4d(1, 0, 0, 0);
    case EAST:
      return new Vector4d(0, 0, -1, 1);
    case WEST:
      return new Vector4d(0, 0, 1, 0);
    case NORTH:
      return new Vector4d(-1, 0, 0, 1);
    case SOUTH:
      return new Vector4d(1, 0, 0, 0);
    case UNKNOWN:
    default:
      break;
    }
    return null;
View Full Code Here

Examples of crazypants.vecmath.Vector4d

      }
    }
  }

  private boolean isRightFace(BlockCoord me, BlockCoord[] mb, ForgeDirection dir) {
    Vector4d uPlane = RenderUtil.getUPlaneForFace(dir);

    int myRightVal = (int) uPlane.x * me.x + (int) uPlane.y * me.y + (int) uPlane.z * me.z;
    int max = myRightVal;
    for (BlockCoord bc : mb) {
      int val = (int) uPlane.x * bc.x + (int) uPlane.y * bc.y + (int) uPlane.z * bc.z;
 
View Full Code Here

Examples of crazypants.vecmath.Vector4d

    GaugeBounds(BlockCoord me, BlockCoord[] mb, ForgeDirection face) {
      this.face = face;
      vInfo = getVPosForFace(me, mb, face);

      Vector4d uPlane = RenderUtil.getUPlaneForFace(face);
      float scaleX = uPlane.x != 0 ? 0.25f : 1;
      float scaleY = uPlane.y != 0 ? 0.25f : 1;
      float scaleZ = uPlane.z != 0 ? 0.25f : 1;
      bb = BoundingBox.UNIT_CUBE.scale(scaleX, scaleY, scaleZ);
    }
View Full Code Here

Examples of crazypants.vecmath.Vector4d

      return false;
    }
    if(mb == null) {
      return true;
    }
    Vector4d uPlane = RenderUtil.getUPlaneForFace(dir);

    int myRightVal = (int) uPlane.x * me.x + (int) uPlane.y * me.y + (int) uPlane.z * me.z;
    int max = myRightVal;
    for (BlockCoord bc : mb) {
      int val = (int) uPlane.x * bc.x + (int) uPlane.y * bc.y + (int) uPlane.z * bc.z;
 
View Full Code Here

Examples of crazypants.vecmath.Vector4d

  GaugeBounds(BlockCoord me, BlockCoord[] mb, ForgeDirection face) {
    this.face = face;
    vInfo = getVPosForFace(me, mb, face);

    Vector4d uPlane = RenderUtil.getUPlaneForFace(face);
    float scaleX = uPlane.x != 0 ? 0.25f : 1;
    float scaleY = uPlane.y != 0 ? 0.25f : 1;
    float scaleZ = uPlane.z != 0 ? 0.25f : 1;
    bb = BoundingBox.UNIT_CUBE.scale(scaleX, scaleY, scaleZ);
  }
View Full Code Here

Examples of crazypants.vecmath.Vector4d

      Vector3d playerPos = new Vector3d(player.prevPosX, player.prevPosY, player.prevPosZ);
      Vector3d b = new Vector3d(playerPos);
      b.y += 1;
      Vector3d c = new Vector3d(playerPos);
      c.add(side);
      Vector4d plane = new Vector4d();
      VecmathUtil.computePlaneEquation(playerPos, b, c, plane);
      double dist = Math.abs(VecmathUtil.distanceFromPointToPlane(plane, new Vector3d(player.posX, player.posY, player.posZ)));
      double minDist = 0.15;
      if(dist < minDist) {
        double dropRate = (minDist * 10) - (dist * 10);
 
View Full Code Here

Examples of javax.vecmath.Vector4d

  boundId = BOUNDING_POLYTOPE;
  planes = new Vector4d[6];
  mag = new double[planes.length];
  pDotN  = new double[planes.length];

  planes[0] = new Vector4d( 1.0, 0.0, 0.0, -1.0 );
  planes[1] = new Vector4d(-1.0, 0.0, 0.0, -1.0 );
  planes[2] = new Vector4d( 0.0, 1.0, 0.0, -1.0 );
  planes[3] = new Vector4d( 0.0,-1.0, 0.0, -1.0 );
  planes[4] = new Vector4d( 0.0, 0.0, 1.0, -1.0 );
  planes[5] = new Vector4d( 0.0, 0.0,-1.0, -1.0 );
  mag[0] = 1.0;
  mag[1] = 1.0;
  mag[2] = 1.0;
  mag[3] = 1.0;
  mag[4] = 1.0;
View Full Code Here

Examples of javax.vecmath.Vector4d

      BoundingSphere sphere = (BoundingSphere)boundsObject;
      planes = new Vector4d[6];
      mag = new double[planes.length];
      pDotN  = new double[planes.length];

      planes[0] = new Vector4d( 1.0, 0.0, 0.0, -(sphere.center.x+sphere.radius) );
      planes[1] = new Vector4d(-1.0, 0.0, 0.0,   sphere.center.x-sphere.radius );
      planes[2] = new Vector4d( 0.0, 1.0, 0.0, -(sphere.center.y+sphere.radius) );
      planes[3] = new Vector4d( 0.0,-1.0, 0.0,   sphere.center.y-sphere.radius );
      planes[4] = new Vector4d( 0.0, 0.0, 1.0, -(sphere.center.z+sphere.radius) );
      planes[5] = new Vector4d( 0.0, 0.0,-1.0,   sphere.center.z-sphere.radius );
      mag[0] = 1.0;
      mag[1] = 1.0;
      mag[2] = 1.0;
      mag[3] = 1.0;
      mag[4] = 1.0;
      mag[5] = 1.0;
      computeAllVerts(); // XXXX: lazy evaluate

  } else if( boundsObject.boundId == BOUNDING_BOX ){
      BoundingBox box = (BoundingBox)boundsObject;
      planes = new Vector4d[6];
      pDotN  = new double[planes.length];
      mag = new double[planes.length];

      planes[0] = new Vector4d( 1.0, 0.0, 0.0, -box.upper.x );
      planes[1] = new Vector4d(-1.0, 0.0, 0.0,  box.lower.x );
      planes[2] = new Vector4d( 0.0, 1.0, 0.0, -box.upper.y );
      planes[3] = new Vector4d( 0.0,-1.0, 0.0,  box.lower.y );
      planes[4] = new Vector4d( 0.0, 0.0, 1.0, -box.upper.z );
      planes[5] = new Vector4d( 0.0, 0.0,-1.0,  box.lower.z );
      mag[0] = 1.0;
      mag[1] = 1.0;
      mag[2] = 1.0;
      mag[3] = 1.0;
      mag[4] = 1.0;
      mag[5] = 1.0;
      computeAllVerts(); // XXXX: lazy evaluate

  } else if( boundsObject.boundId == BOUNDING_POLYTOPE ) {
      BoundingPolytope polytope = (BoundingPolytope)boundsObject;
      planes = new Vector4d[polytope.planes.length];
      mag = new double[planes.length];
      pDotN  = new double[planes.length];
      nVerts = polytope.nVerts;
      verts  = new Point3d[nVerts];
      for(i=0;i<planes.length;i++) {
    planes[i] = new Vector4d(polytope.planes[i]);
    mag[i] = polytope.mag[i];
    pDotN[i] = polytope.pDotN[i];
      }
      for(i=0;i<verts.length;i++) {
    verts[i] = new Point3d(polytope.verts[i]);
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.