Posted May 10, 201411 yr How does the Bounding Box work? Where's the center? Does it rotate with the entity?
May 11, 201411 yr The bounding box works by having a set minimum x, y, and z, and a maximum x, y, and z. The center of the bounding box is between the min x and max x, the min y and the max y, etc. I'm pretty sure it doesn't rotate. Kain
May 11, 201411 yr Author By center I mean what the mins and maxs measure from. Location of the entity? Also, are these variables pixels or blocks or other(what unit)?
May 11, 201411 yr bounding boxes can move with blocks but you have to add another method to change the bound box with orientation, the bound box is done in floats i believe it starts to one side of a block, not from the middle, but you can figure out what values change what side by trial and error this is code for a cube like bounding box in the middle of a block this.setBlockBounds(A-0.170F, B-0.0F, C-0.180F, D-0.830F, E-0.80F, F-0.820F); B value when increased moves the bottom of the bounding box upwards the E value when DECREASED moves the top of the bounding box down or when Increased moves the bounding box border upwards i believe A and D are x axis, also C and F are y axis (OR THE OTHER WAY AROUND) off memory the bound box DOESNT move with entities but i may be wrong there may be a way for it
May 11, 201411 yr Hi By center I mean what the mins and maxs measure from. Location of the entity? Also, are these variables pixels or blocks or other(what unit)? The bounding box is "centred" around around the entity location [posX, posY, posZ]. It doesn't automatically rotate as the entity rotates, it always stays aligned with the x, y, and z axes. The units are the same as the blocks, i.e. 1.0 is 1 metre is 1 block. -TGG
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.