-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Allow rotating entity selectionboxes #12379
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
ee90272
to
ddbb9df
Compare
oh, this is so good. I hope it gets merged for 5.6. How does it affect walking on collisionboxes? |
It doesn't affect collisionboxes because that's way more complex, only selectionboxes. |
ddbb9df
to
8193935
Compare
8193935
to
9afabb0
Compare
9afabb0
to
4f1c9b3
Compare
4f1c9b3
to
daf3057
Compare
daf3057
to
7e25b2c
Compare
Carts may benefit from this as well: They are nonphysical either way and may be rotated by 45° when going uphill. |
Yeah, this could be cool for entity selection. |
Presumably the same issue as #11905 and thus somewhat out of scope for this PR to fix... There are two issues:
The fix for 2. is to simply call updateAbsolutePosition(). Latest commit fixes it. |
|
144a5c0
to
7e1d307
Compare
What about intersection normals: Should the Lua API return the rotated normal or the face normal as |
Was the entity static from the get go (in this case this would be a clear bug) or did you stop its automatic rotation after a while (then this would be expected to some extent)? Edit: I've been able to reproduce this for edge cases (thin boxes, significantly rotated) even after setting the rotation by punching. |
After further consideration: This is indeed the error incurred through the server guessing automatic rotate without knowing when the client started applying it; an error of automatic rotate times RTT / stepsize is to be expected. Setting automatic rotate to zero and then setting the rotation does not get rid of the rotation incurred through automatic rotate; automatic rotate only affects the rotation of the child node, which stays and is always additionally applied. We can not break this behavior due to backwards compatibility. Another caveat is that presumably this will reset when the entity is unloaded client-side. When the client comes back to the entity after a while, it will start with a fresh automatic rotate Y-axis rotation. In this case, client & server might experience a larger desync. In fact, different clients might see different total rotations incurred by automatic rotate - which one should the server use in its calculations? It seems with the current protocol, we can not reliably know, but only guess the rotation of an entity with automatic_rotate != 0. Some options:
|
Went with the first option. Note:
|
Needs rebase. |
Rebased. |
This is basic for the mob mods. |
I think this should implement only in singleplayer. |
Please elaborate: Are you referring to rotatable selectionboxes in general (if so: why?) or do you mean taking automatic rotate into account specifically? |
I mean the preccision errors. |
The precision errors are only relevant for automatic rotate. Disabling the approximation in multiplayer would require additional work and IMO be dirty. Adding the note for modders IMO is enough. |
Can anyone more review this? please @nerzhul @TurkeyMcMac @rubenwardy @SmallJoker @lhofhansl @savilli @x2048 @Df458 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works. Just some minor things.
…test into rot-selection-box
Co-authored-by: Jude Melton-Houghton <jwmhjwmh@gmail.com>
With two approvals this should be merged, isn't it? |
Sometimes core devs like to let some time pass, but yes, this does now fulfill the requirements to be merged. |
I prefer a exhaustive review and checking than a faulty release. Well, I guess this should be ready for 5.7 release. |
Ready for review. Closes #12372. Written with @runsy's petz in mind.
How to test
/spawnentity testentities:selectionbox