-
Notifications
You must be signed in to change notification settings - Fork 18
Aabb #182
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
Aabb #182
Conversation
update the thing
|
I'm ready for more code review. |
|
This update comes in two complimentary parts Part one is the collision detection.
Part two adds force and velocity To determine if the player is in contact with the ground, the client checks the player character’s bounding box, and if any voxel within the bounding box is not air, the player is considered to be touching the ground. There are many issues yet to be tackled. The server has no ability to enforce the rules of physics. The current collision detecting lacks precision. The movement due to player velocity is jittery, leading to an uncomfortable viewing experiencing. |
patowen
left a comment
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.
I've finished looking through the PR, and it is definitely looking close to ready to merge. I tried to be as thorough as possible, which means that I have left a lot of comments. A lot of them are minor, but some require a closer look. I would recommend looking through all of my comments before making code changes in case one renders another obsolete.
| for &(id, new_pos) in &msg.positions { | ||
| self.update_position(msg.latest_input, id, new_pos); | ||
| for &(id, new_pos, node_transform) in &msg.positions { | ||
| self.update_position(msg.latest_input, id, new_pos, node_transform); |
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.
I'm not sure why, but with some println debugging, I've found situations in which node_transform was the identity matrix, but new_pos was different from the old position. I believe this is the main cause of the velocity redirection you noticed recently.
Rather than figuring out the root cause of this discrepancy, I believe the simplest fix would be to do this while fixing the jitter. For prototyping purposes, to simplify development, I would recommend having the client simply send the entire Position structure to the server and never have the server reposition the client. Once we have a better understanding of netcode, we can try to do things the right way.
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.
I don't think I made it very clear, but node_transform is only not the identity matrix when going from one node to another node.
When the player is moving around in the middle of the node, the exact scenario you are describing should be the norm.
I agree that the Client broadcasting its Position is the proper thing to do right now.
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.
Sorry, I meant that new_pos.old was different from the old pos.node. I'm aware that node_transform being the identity is correct when staying within a single node.
patowen
left a comment
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.
I took another pass at your PR. It looks like most of my comments were fully addressed. I left a few comments this time for new things I noticed as well as following up on unresolved threads.
|
|
||
| // place a small bounding box next to a dodecaherdral vertex. There should be exactly 8 chunks in contact. | ||
| #[test] | ||
| fn proper_chunks_8() { |
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.
PERPENDICULAR_VERTEX is not yet included in the proper_chunks_n tests. There should be another test added to the suite. Its associated comment should be something like
// place a small bounding box near the midpoint of a dodecahedron's edge. There should be exactly 8 chunks in contact.The chunk coordinates should be close to any permutation of (1, 1, 0).
|
Closing as we've now merged collision detection, drawing in part on the work here, into master. Thanks for your contribution! |
I don't expect this to get merged as is, but I feel like it's ready for code review.