Repository navigation
Conversation
BoxBuilding and MeshFace disagreed about whether an occupant resting exactly on top of an obstacle is inside it. BoxBuilding::inMovingBox is clear when the occupant's base equals the top (`lowerZ >= top`); MeshFace::inBox is not (`extents.maxs[2] < p[2]`). That decides where a tank comes to rest, and doUpdateMotion gives it no gravity to escape with -- while OnGround or OnBuilding it sets newVelocity[2] = 0, so a tank keeps the height it landed at exactly. A tank driving on a box therefore sits at exactly the shared top, and every face of an abutting mesh of the same height then reports a hit at once: the flat top it is driving onto and the perimeter wall beneath it. The search for the last moment the tank was clear has no clear moment to find at any point in the step, so the tank stops dead at the seam. A tank driving on a mesh is left a hair above the top instead, so every face of the next obstacle is below it and misses. That is why mesh to mesh and mesh to box both work and only box to mesh sticks. Fixed in the motion path only. inBox keeps its inclusive contact for collectInsideBuildings, the physics driver lookup and the death check. A tank falling onto a mesh top is still caught, so landing is unchanged. Fixes #395 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Member
|
This is a change that can't go into 2.4 because it would change behavior between compatible clients. |
Member
Author
|
People are relying on not being able to drive on the same level plane? I'd call it a bug. If older clients see it, they should upgrade. :) |
Member
|
I agree that it's a bug, but there have been plenty of times that we hold off fixing a bug until a protocol break. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
BoxBuilding and MeshFace disagreed about whether an occupant resting exactly on top of an obstacle is inside it. BoxBuilding::inMovingBox is clear when the occupant's base equals the top (
lowerZ >= top); MeshFace::inBox is not (extents.maxs[2] < p[2]).That decides where a tank comes to rest, and doUpdateMotion gives it no gravity to escape with -- while OnGround or OnBuilding it sets newVelocity[2] = 0, so a tank keeps the height it landed at exactly. A tank driving on a box therefore sits at exactly the shared top, and every face of an abutting mesh of the same height then reports a hit at once: the flat top it is driving onto and the perimeter wall beneath it. The search for the last moment the tank was clear has no clear moment to find at any point in the step, so the tank stops dead at the seam.
A tank driving on a mesh is left a hair above the top instead, so every face of the next obstacle is below it and misses. That is why mesh to mesh and mesh to box both work and only box to mesh sticks.
Fixed in the motion path only. inBox keeps its inclusive contact for collectInsideBuildings, the physics driver lookup and the death check. A tank falling onto a mesh top is still caught, so landing is unchanged.
Fixes #395