Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package net.minecraft.src;
- // Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
- // Jad home page: http://www.kpdus.com/jad.html
- // Decompiler options: packimports(3) braces deadcode
- import org.lwjgl.opengl.GL11;
- public class RenderTank extends Render
- {
- public RenderTank()
- {
- shadowSize = 2F;
- modelTank = new ModelTank();
- }
- public void func_157_a(EntityTank entitytank, double d, double d1, double d2,
- float f, float f1)
- {
- GL11.glPushMatrix();
- float f5 = 0;
- float f6 = 0;
- if(entitytank.riddenByEntity != null)
- {
- f5 = entitytank.riddenByEntity.prevRotationYaw + (entitytank.riddenByEntity.rotationYaw - entitytank.riddenByEntity.prevRotationYaw) * f1 - entitytank.prevRotationYaw - 90;
- f6 = entitytank.riddenByEntity.prevRotationPitch + (entitytank.riddenByEntity.rotationPitch - entitytank.riddenByEntity.prevRotationPitch) * f1;
- for(int i = 5; i < 11; i++)
- {
- modelTank.sideModels[i].rotateAngleZ = entitytank.wheelRotation;
- }
- for(int i = 30; i < 37; i++)
- {
- modelTank.sideModels[i].rotateAngleY = f5 / 57.29578F;
- }
- modelTank.turret.relativeAngles.angleY = f5 / 57.29578F;
- modelTank.muzzle.relativeAngles.angleX = -f6 / 57.29578F;
- }else
- {
- for(int i = 5; i < 11; i++)
- {
- modelTank.sideModels[i].rotateAngleZ = 0F;
- }
- for(int i = 30; i < 37; i++)
- {
- modelTank.sideModels[i].rotateAngleY = 0F;
- }
- modelTank.turret.relativeAngles.angleY = 0F;
- modelTank.muzzle.relativeAngles.angleX = 0F;
- }
- float f8 = entitytank.prevRotationPitch + (entitytank.rotationPitch - entitytank.prevRotationPitch) * f1;
- float f9 = entitytank.prevRotationYaw + (entitytank.rotationYaw - entitytank.prevRotationYaw) * f1;
- //d = entitytank.prevPosX + (entitytank.posX - entitytank.prevPosX) * (double)f1;
- //d1 = (entitytank.prevPosY + (entitytank.posY - entitytank.prevPosY) * (double)f1 + 1.6200000000000001D) - (double)entitytank.yOffset;
- //d2 = entitytank.prevPosZ + (entitytank.posZ - entitytank.prevPosZ) * (double)f1;
- Vec3D vec3d = Vec3D.createVector(d, d1, d2);
- float f10 = MathHelper.cos(-f9 * 0.01745329F - 3.141593F);
- float f11 = MathHelper.sin(-f9 * 0.01745329F - 3.141593F);
- float f12 = -MathHelper.cos(-f8 * 0.01745329F);
- float f13 = MathHelper.sin(-f8 * 0.01745329F);
- float f14 = f11 * f12;
- float f15 = f13;
- float f16 = f10 * f12;
- double d3 = 5D;
- Vec3D vec3d1 = vec3d.addVector((double)f14 * d3, (double)f15 * d3, (double)f16 * d3);
- MovingObjectPosition movingobjectposition = entitytank.worldObj.rayTraceBlocks_do(vec3d, vec3d1, true);
- if(movingobjectposition != null)
- {
- if(movingobjectposition.typeOfHit == EnumMovingObjectType.TILE)
- {
- int i = movingobjectposition.blockX;
- int j = movingobjectposition.blockY;
- int k = movingobjectposition.blockZ;
- System.out.println((new StringBuilder("found at ")).append(i).append(" ").append(j).append(" ").append(k).toString());
- if(movingobjectposition.sideHit >= 2 && movingobjectposition.sideHit <= 5)
- {
- j++;
- }
- if(entitytank.worldObj.isAirBlock(i, j, k) || !entitytank.worldObj.getBlockMaterial(i, j, k).isSolid())
- {
- /*double d3 = entitytank.lastTickPosX + (entitytank.posX - entitytank.lastTickPosX) * (double)f1;
- double d4 = entitytank.lastTickPosY + (entitytank.posY - entitytank.lastTickPosY) * (double)f1;
- double d5 = entitytank.lastTickPosZ + (entitytank.posZ - entitytank.lastTickPosZ) * (double)f1;
- double d6 = 0.30000001192092896D;
- Vec3D vec3d = entitytank.func_514_g(d3, d4, d5);
- float f2 = entitytank.prevRotationPitch + (entitytank.rotationPitch - entitytank.prevRotationPitch) * f1;
- if(vec3d != null)
- {
- Vec3D vec3d1 = entitytank.func_515_a(d3, d4, d5, d6);
- Vec3D vec3d2 = entitytank.func_515_a(d3, d4, d5, -d6);
- if(vec3d1 == null)
- {
- vec3d1 = vec3d;
- }
- if(vec3d2 == null)
- {
- vec3d2 = vec3d;
- }
- d += vec3d.xCoord - d3;
- d1 += (vec3d1.yCoord + vec3d2.yCoord) / 2D - d4;
- d2 += vec3d.zCoord - d5;*/
- Vec3D vec3d3 = vec3d.addVector(-vec3d1.xCoord, -vec3d1.yCoord, -vec3d1.zCoord);
- if(vec3d3.lengthVector() != 0.0D)
- {
- vec3d3 = vec3d3.normalize();
- f = (float)((Math.atan2(vec3d3.zCoord, vec3d3.xCoord) * 180D) / 3.1415926535897931D);
- f8 = (float)(Math.atan(vec3d3.yCoord) * 73D);
- }
- }/**/}}
- GL11.glTranslatef((float)d, (float)d1, (float)d2);
- GL11.glRotatef(180F - f, 0.0F, 1.0F, 0.0F);
- GL11.glRotatef(-f8, 0.0F, 0.0F, 1.0F);
- float f2 = (float)entitytank.tankTimeSinceHit - f1;
- float f3 = (float)entitytank.tankCurrentDamage - f1;
- if(f3 < 0.0F)
- {
- f3 = 0.0F;
- }
- if(f2 > 0.0F)
- {
- GL11.glRotatef(((MathHelper.sin(f2) * f2 * f3) / 10F) * (float)entitytank.tankRockDirection, 1.0F, 0.0F, 0.0F);
- }
- modelTank.tankCS = entitytank;
- loadTexture("/terrain.png");
- float f4 = 0.75F;
- GL11.glScalef(f4, f4, f4);
- GL11.glScalef(1.0F / f4, 1.0F / f4, 1.0F / f4);
- loadTexture("/item/tanktexture.png");
- GL11.glScalef(-1F, -1F, 1.0F);
- modelTank.render(0.0F, 0.0F, -0.1F, f5, f6, 0.0625F);
- entitytank.currentModel = modelTank;
- GL11.glPopMatrix();
- }
- public void doRender(Entity entity, double d, double d1, double d2,
- float f, float f1)
- {
- func_157_a((EntityTank)entity, d, d1, d2, f, f1);
- }
- public ModelTank modelTank;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement