Package crazypants.vecmath

Examples of crazypants.vecmath.Vector3d


  public static void getUvForCorner(Vector2f uv, Vector3d corner, int x, int y, int z, ForgeDirection face, IIcon icon) {
    if(icon == null) {
      return;
    }

    Vector3d p = new Vector3d(corner);
    p.x -= x;
    p.y -= y;
    p.z -= z;

    float uWidth = 1;
View Full Code Here


      BoundingBox bb = BoundingBox.UNIT_CUBE.scale(0.85, 0.96, 0.85);
      bb = bb.scale(1, 0.85 * fullness, 1);
      float ty = -(0.85f - (bb.maxY - bb.minY)) / 2;     
     
     
      Vector3d offset = ForgeDirectionOffsets.offsetScaled(ForgeDirection.values()[gen.facing], -0.075);
      bb = bb.translate((float)offset.x, ty, (float)offset.z);
     
      int brightness;
      if(gen.getWorldObj() == null) {
        brightness = 15 << 20 | 15 << 4;
View Full Code Here

    @Override
    public void renderFace(CustomRenderBlocks rb, ForgeDirection face, Block par1Block, double x, double y, double z, IIcon texture, List<Vertex> refVertices,
        boolean translateToXyz) {

      if(vat != null && par1Block instanceof AbstractMachineBlock) {
        Vector3d offset = ForgeDirectionOffsets.offsetScaled(face, 0.01);
        Tessellator.instance.addTranslation((float)offset.x, (float)offset.y, (float)offset.z);

        IoMode mode = vat.getIoMode(face);
        IIcon tex = ((AbstractMachineBlock)par1Block).getOverlayIconForMode(mode);
        if(tex != null) {
View Full Code Here

    List<SoundSource> tmp = soundQueue;
    soundQueue = sounds;
    sounds = tmp;

    try {
      Vector3d eye = Util.getEyePositionEio(mc.thePlayer);
      for (SoundSource ss : sounds) {
        double distSq = ss.pos.distanceSquared(eye);
        int minDist = ss.isEntity ? 4 : 49;
        if(distSq > minDist && distSq <= maxRangeSq) {
          mc.thePlayer.worldObj.spawnEntityInWorld(new SoundEntity(mc.thePlayer.worldObj, ss.pos, ss.volume));
View Full Code Here

    boolean isEntity;

    public SoundSource(Entity ent, float volume) {
      AxisAlignedBB bb = ent.boundingBox;
      if(bb != null) {
        pos = new Vector3d(bb.minX + (bb.maxX - bb.minX) / 2, bb.minY + (bb.maxY - bb.minY) / 2, bb.minZ + (bb.maxZ - bb.minZ) / 2);
      } else {
        pos = new Vector3d(ent.posX, ent.posY, ent.posZ);
      }
      this.volume = volume;
      isEntity = true;
    }
View Full Code Here

      this.volume = volume;
      isEntity = true;
    }

    public SoundSource(double x, double y, double z, float volume) {
      pos = new Vector3d(x, y, z);
      this.volume = volume;
      isEntity = false;
    }
View Full Code Here

    TileReservoir tr = (TileReservoir) te;
    if(!tr.isMultiblock()) {
      return super.getSelectedBoundingBoxFromPool(world, x, y, z);
    }

    Vector3d min = new Vector3d(Double.MAX_VALUE, Double.MAX_VALUE, Double.MAX_VALUE);
    Vector3d max = new Vector3d(-Double.MAX_VALUE, -Double.MAX_VALUE, -Double.MAX_VALUE);
    for (BlockCoord bc : tr.multiblock) {
      min.x = Math.min(min.x, bc.x);
      max.x = Math.max(max.x, bc.x + 1);
      min.y = Math.min(min.y, bc.y);
      max.y = Math.max(max.y, bc.y + 1);
View Full Code Here

      double verticalSpeed = Config.darkSteelGliderVerticalSpeed;
      if(player.isSprinting()) {
        verticalSpeed = Config.darkSteelGliderVerticalSpeedSprinting;
      }

      Vector3d look = Util.getLookVecEio(player);
      Vector3d side = new Vector3d();
      side.cross(new Vector3d(0, 1, 0), look);
      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);
        verticalSpeed = verticalSpeed + (verticalSpeed * dropRate * 8);
        horizontalSpeed -= (0.02 * dropRate);
 
View Full Code Here

    ep.worldObj.playSoundEffect(message.x, message.y, message.z, "mob.endermen.portal", 1.0F, 1.0F);
    ep.fallDistance = 0;

    if(message.conserveMotion) {
      Vector3d velocityVex = Util.getLookVecEio(ep);
      S12PacketEntityVelocity p = new S12PacketEntityVelocity(ep.getEntityId(), velocityVex.x, velocityVex.y, velocityVex.z);

      ctx.getServerHandler().sendPacket(p);
    }
View Full Code Here

   
    IIcon baseIcon = EnderIO.blockWirelessCharger.getIcon(0, 0);
   
    tes.addTranslation(x, y, z);
   
    VertexTransform rot = new VertexRotation(Math.toRadians(45), new Vector3d(0,1,0), new Vector3d(0.5,0.5,0.5));
    VertexTransform trans = new VertexTranslation(0, -0.5 + 0.025, 0);
   
    VertexTransformComposite xform = new VertexTransformComposite(rot, trans);   
    CubeRenderer.render(BoundingBox.UNIT_CUBE.scale(0.7, 0.05, 0.7), baseIcon, xform, true);
   
    trans = new VertexTranslation(0, 0.5 - 0.025, 0);
    xform = new VertexTransformComposite(rot, trans);
    CubeRenderer.render(BoundingBox.UNIT_CUBE.scale(0.7, 0.05, 0.7), baseIcon, xform, true);
   
    CubeRenderer.render(BoundingBox.UNIT_CUBE.scale(0.2, 0.91, 0.2), EnderIO.blockWirelessCharger.getCenterOn(), true);
   
    trans = new VertexTranslation(0, 0, 0.5 - 0.01);
    xform = new VertexTransformComposite(trans);
    CubeRenderer.render(BoundingBox.UNIT_CUBE.scale(0.25, 0.25, 0.01), baseIcon, xform, true);
    CubeRenderer.render(BoundingBox.UNIT_CUBE.scale(0.01, 1, 0.01), baseIcon, xform, true);
   
    rot = new VertexRotation(Math.toRadians(90), new Vector3d(0,1,0), new Vector3d(0.5,0.5,0.5));
    xform = new VertexTransformComposite(trans, rot);
    CubeRenderer.render(BoundingBox.UNIT_CUBE.scale(0.25, 0.25, 0.01), baseIcon, xform, true);
    CubeRenderer.render(BoundingBox.UNIT_CUBE.scale(0.01, 1, 0.01), baseIcon, xform, true);
   
    rot = new VertexRotation(Math.toRadians(180), new Vector3d(0,1,0), new Vector3d(0.5,0.5,0.5));
    xform = new VertexTransformComposite(trans, rot);
    CubeRenderer.render(BoundingBox.UNIT_CUBE.scale(0.25, 0.25, 0.01), baseIcon, xform, true);
    CubeRenderer.render(BoundingBox.UNIT_CUBE.scale(0.01, 1, 0.01), baseIcon, xform, true);
   
    rot = new VertexRotation(Math.toRadians(270), new Vector3d(0,1,0), new Vector3d(0.5,0.5,0.5));
    xform = new VertexTransformComposite(trans, rot);
    CubeRenderer.render(BoundingBox.UNIT_CUBE.scale(0.25, 0.25, 0.01), baseIcon, xform, true);
    CubeRenderer.render(BoundingBox.UNIT_CUBE.scale(0.01, 1, 0.01), baseIcon, xform, true);
   
   
View Full Code Here

TOP

Related Classes of crazypants.vecmath.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.