Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

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

  • 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)?

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

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.