-
Notifications
You must be signed in to change notification settings - Fork 92
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
Collision physics for half-blocks or slabs #84
Comments
The short answer is this isn't in the engine yet. Terrain physics is done in this library. It would be possible (but nontrivial) to add support for blocks with a collision volume smaller than the full voxel, but I haven't tried doing it. |
I think I will try to experiment with it. My idea is to modify engine to output object with block's collision shape and using it for rest of checks. As I never did something similar before, do you have any suggestions/other ideas how it could work? |
I think if you check when player inslab like in water and offset him |
In physics.js export default function (noa, opts) { /**
var defaults = { function makePhysics(noa, opts) {
} |
@Patbox: I think the best approach would be to start with the dependency voxel-aabb-sweep. That library takes an AABB and a direction, and then "pushes" the AABB along that direction until it hits a solid voxel. Noa internally uses that dependency for both physics and for raycasting, so if Currently the But note that the math inside the "sweep" library is pretty complicated, and somewhat hard to test. Also I expect that it would be a lot easier if non-full voxels are required to have simple AABB collision geometries - i.e. things like half-slabs or fenceposts, but not slopes or arbitrary polygons. |
If you don't need to sweep and just need to test overlaps then it's a lot easier, but that would probably be buggy |
How would I overlap , explain me wath you know I almost cracked the code |
Wanted to create a half block ,that’s easy but the problem is how can I stand on it , how can I implement collision detection on a half block so I can stand on it thanks Andy
The text was updated successfully, but these errors were encountered: