UTCheats.net - Unreal Tournament & Tactical Ops cheats and hacks

Please login or register.

Login with username, password and session length
Advanced search  



Author Topic: UScript 3D Bounding Boxes  (Read 5998 times)


  • Administrator
  • Dominating
  • ******
  • Posts: 327
    • View Profile
UScript 3D Bounding Boxes
« on: March 21, 2011, 08:58:12 PM »

Quote from: XfinitY
This will be in XfinityBot v2 but i figured i would share it with the community.
Will work as is for UT2k4 and 2k3 may need to modify how the line is drawn on the canvas for other versions.

Code: [Select]
function Draw3DBoundingBox(Pawn Target, Canvas Canvas)
local vector Front, Back, FTL, FTR, FBL, FBR, BTL, BTR, BBL, BBR;
local vector cFTL, cFTR, cFBL, cFBR, cBTL, cBTR, cBBL, cBBR;

//Set Front and back vectors to the targets location
   Front = Target.Location;
   Back  = Target.Location;
   //Adjust X Axis for front and back
   //When refering to the X axis of a vector, think of moving forward and backward in game
   Front.X -= Target.CollisionRadius;
   Back.X  += Target.CollisionRadius;

//Assign Front vars to the front vec, and back to back vec
FTL = Front;
   FTR = Front;
   FBL = Front;
   FBR = Front;
   BTL = Back;
   BTR = Back;
   BBL = Back;
   BBR = Back;

//Adjusting for outer bounds of the box
//Y and Z axis
//Y gives us our left and right boundries
//and Z gives us top and bottom
FTL.Y -= Target.CollisionRadius;
FTR.Y += Target.CollisionRadius;
FBL.Y -= Target.CollisionRadius;
FBR.Y += Target.CollisionRadius;
FTL.Z += Target.CollisionHeight;
FTR.Z += Target.CollisionHeight;
FBL.Z -= Target.CollisionHeight;
FBR.Z -= Target.CollisionHeight;

BTL.Y -= Target.CollisionRadius;
BTR.Y += Target.CollisionRadius;
BBL.Y -= Target.CollisionRadius;
BBR.Y += Target.CollisionRadius;
BTL.Z += Target.CollisionHeight;
BTR.Z += Target.CollisionHeight;
BBL.Z -= Target.CollisionHeight;
BBR.Z -= Target.CollisionHeight;

//Now we get our vector locations on the canvas
cFTL = WorldToScreen(FTL);
   cFTR = WorldToScreen(FTR);
   cFBL = WorldToScreen(FBL);
   cFBR = WorldToScreen(FBR);
   cBTL = WorldToScreen(BTL);
   cBTR = WorldToScreen(BTR);
   cBBL = WorldToScreen(BBL);
   cBBR = WorldToScreen(BBR);

   //Front Box
   vDrawLine(cFTL, cFTR, Canvas);
   vDrawLine(cFTL, cFBL, Canvas);
   vDrawLine(cFBL, cFBR, Canvas);
   vDrawLine(cFBR, cFTR, Canvas);
//Rear Box
vDrawLine(cBTL, cBTR, Canvas);
   vDrawLine(cBTL, cBBL, Canvas);
   vDrawLine(cBBL, cBBR, Canvas);
   vDrawLine(cBBR, cBTR, Canvas);
   //Connecting Lines
   vDrawLine(cFTL, cBTL, Canvas);
   vDrawLine(cFTR, cBTR, Canvas);
   vDrawLine(cFBL, cBBL, Canvas);
   vDrawLine(cFBR, cBBR, Canvas);
function vDrawLine(vector start, vector end, Canvas Canvas)
XfinityController.myHUD.StaticDrawCanvasLine(Canvas, Start.X, Start.Y, End.X, End.Y, Canvas.DrawColor);



  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: UScript 3D Bounding Boxes
« Reply #1 on: June 24, 2012, 01:24:40 AM »

does any1 have a copy of the old xfinity bot?