#Question to the devs: Would irregular bounding boxes ever happen?
1 messages · Page 1 of 1 (latest)
I don't think that would ever happen even rails aren't anything but rectangles
aren't elevated rail supports shaped like a plus sign?
or a square with 1 tile cut from the corners?
Technically a circle
But yea
I'm fairly sure it's done with 2 rectangles
Everything is a box
i guess the collision boxes for entities can be as wacky as you like, since you can just add extra collision boxes to get the desired shape. but if inserters need to interact with an entity, i believe the code which governs that is not really designed for anything other than rectangles
From what i heard, its the opposite, they are trying to remove multiple collision boxes per entity as that makes some things more complicated. And old rails are the only thing thst has them right now
No
The diagonal ones just have a diagonal hitbox, but it's still a rectangle
Which means that if you place stuff around the base, you get a plus sign
concave boxes are annoying to deal with
Whatever the bounding boxes are, they must support convertion into axis aligned bounding box and must support collide check with other bounding box
Legacy curved rails are the only entities with two boxes as we want to get rid of this logic
Personally i predict this will never happen because of performance consideration of collide checks of moving trains, but also because this requires deep verification if all extra cases are correctly detected, for example assemblers reject rotating by 90deg if box is not a sqare because 90deg rotated would not overlap with itself from before rotation and doing it could rotate into a collision
Could a diagonal hitbox be made for an assembler?
The way I parse this, any rectangle is fine.
Not sure what a diagonal hitbox is. Do you mean diamond shaped? That's also a rectangle.
Yes
We have those already. Non-cardinally aligned rail supports have such hitboxes.
+api type BoundingBox
BoundingBoxes are typically centered around the position of an entity.
BoundingBoxes are usually specified with the short-hand notation of passing an array of exactly 2 or 3 items.
The first tuple item is left_top, the second tuple item is right_bottom. The third tuple item is a float that represents the orientation.
Positive x goes towards east, positive y goes towards south. This means that the upper-left point is the least dimension in x and y, and lower-right is the greatest.