Miscellaneous Recipes
246
The top-right corner sets our position to use the maximum X value from our ActorBB
variable and subtract the actual width of the box, while the Y value is simply set to
the minimum size of the actor's bounding box Y variable.
We draw our rectangle next. The first parameter is the X value and determines
how thick or wide the bar appears on the sides. The second parameter, the Y
variable, does the same for the top and bottom bar. The ActualWidth variable
defines a very thin line, while a number such as 10 in the Y parameter creates a
nice thick one to stand out.
- Let's take a look at where we actually get our bounding box information from. This
may look like quite a bit, but it's really just a lot of the same information repeated
over and over. We'll create our GetBB() function, which grabs our bounding box
dimensions from our actor.
/*****- Grabs bounding box around an actor
*****/
function Box GetBB(Actor Actor)
{
local Box CompBBox, OutBox;
local Vector BoundingBoxCoords[8];
local int i;
- Grabs bounding box around an actor