Advertisement
yugecin

tracers + player ESP

Sep 30th, 2012
1,152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.90 KB | None | 0 0
  1.     public static void drawPlayerESP(double d, double d1, double d2){
  2.         GL11.glBlendFunc(770, 771);
  3.         GL11.glColor3f(255, 255, 255);
  4.         GL11.glLineWidth(1.0f);
  5.         GL11.glDisable(3553 /*GL_TEXTURE_2D*/);
  6.         GL11.glDisable(2929 /*GL_DEPTH_TEST*/);
  7.         GL11.glDepthMask(false);
  8.         drawOutlinedBoundingBox(new AxisAlignedBB(d - 0.5, d1 + 0.1, d2 - 0.5, d + 0.5, d1 + 2.0, d2 + 0.5));
  9.         GL11.glDepthMask(true);
  10.         GL11.glEnable(3553 /*GL_TEXTURE_2D*/);
  11.         GL11.glEnable(2929 /*GL_DEPTH_TEST*/);
  12.     }
  13.    
  14.     public void Tracer() {
  15.         GL11.glBlendFunc(770, 771);
  16.         GL11.glLineWidth(2.0f);
  17.         GL11.glDisable(2929);
  18.         GL11.glDisable(3553 /*GL_TEXTURE_2D*/);
  19.         GL11.glDepthMask(false);
  20.        
  21.         double size = 0.45;
  22.         double ytSize = 0.35;
  23.         GL11.glBegin(GL11.GL_LINES);
  24.        
  25.         for(int x = 0; x < mc.theWorld.playerEntities.size(); x ++) {
  26.             Entity entity = (Entity) mc.theWorld.playerEntities.get(x);
  27.             if(getDistanceSqToEntity(entity) < 80D){ //if player is closer then 8.0m
  28.                 GL11.glColor3f(255, 0, 0);  //draw red tracer line
  29.             } else {
  30.                 GL11.glColor3f(0, 255, 255); //draw aqua tracer line
  31.             }
  32.             double X = entity.posX;
  33.             double Y = entity.posY;
  34.             double Z = entity.posZ;
  35.             double mX = mc.thePlayer.posX;
  36.             double mY = mc.thePlayer.posY;
  37.             double mZ = mc.thePlayer.posZ;
  38.             double dX = (mX - X);
  39.             double dY = (mY - Y);
  40.             double dZ = (mZ - Z);
  41.            
  42.             if(X != mX && Y != mY && Z != mZ) {        
  43.                 GL11.glVertex3d(0, 0, 0);
  44.                 GL11.glVertex3d((-dX + size) - 0.5, (ytSize - dY) + 1.0, (-dZ - size) + 0.5);
  45.             }
  46.         }
  47.        
  48.         GL11.glEnd();    
  49.         GL11.glDepthMask(true);
  50.         GL11.glEnable(2929);
  51.         GL11.glEnable(3553 /*GL_TEXTURE_2D*/);
  52.     }
  53.    
  54.     public double getDistanceSqToEntity(Entity par1Entity)
  55.     {
  56.         double d = mc.thePlayer.posX - par1Entity.posX;
  57.         double d1 = mc.thePlayer.posY - par1Entity.posY;
  58.         double d2 = mc.thePlayer.posZ - par1Entity.posZ;
  59.         return d * d + d1 * d1 + d2 * d2;
  60.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement