Open bbarker opened 8 years ago
In this issue branch, they appear to be editable now in general, but:
Not all faces of a placed block appear to create collision outside of origin chunk - in fact, they are different
(-1, 0) chunk
: only the outer face in the -x
direction collides. (0, 1) chunk
: Placed and removed chunks aren't rendered, but they do seem to have exterior collision in +/-x
and +z
faces.(1, 0) chunk
: Rendered and have exterior collision on three sides: +/-z
and +x
.(0, -1) chunk
: Rendered and has exterior collision on only -x
.Have now addressed some of the collision issues in b743a5ada01d501729b76e4bf26b5194279b2cad due to unnecessary >0
, <=16
checks, but more subtle issues remain. Need to compare position of placed block and detected block collision to debug, starting in (-1,0)
chunk.
Modified list (note: not testing the bottom (-y
face) in this list):
(-1, 0) chunk
: only the outer face in the -x
direction collides. The z faces and the upper face are shifted in the -x
direction by 1 block. Removing the expressions - (if (chunk.xx < 0) 1 else 0
for the tentativeBlock selection do not alter this effect, so it is likely still an issue with the collision code.(0, 1) chunk
: Placed and removed chunks aren't rendered, but they do seem to have exterior collision in all faces now.(1, 0) chunk
: Rendered (even removed are rendered) and have exterior collision on all faces, but top face (+y
) seems to be slightly off - sometimes possible to fall through.(0, -1) chunk
: This one is hard to test now, but seems to not be rendered any longer and seems to only have faces in +/-z
faces.It appears we may need Math.round
instead of toInt
for negative chunks; limited use in 995704c6654a19de8e64123b171cbe0eae012503 seems to confirm this, need to investigate more.
Update: the rounding fixes have largely helped but not all is perfect in 0947544c67ec4e66d1c26397131a49397e3bc6ab, need to get some rendering issues for non-origin chunks resolved to make debugging collision detection easier.
Merged progress so far to master in 9ec1b76a53fb9ee00d711f80bdad467e00d62ddc.
There are a number of rendering issues, including this one, that would be easier if controls were improved (#3).
Currently cannot select them due to hardcoding of '16' in
GameState#calculateSelectedBlock
. When outside of the initial chunk, placement of blocks also seems to be off-by-one; likely related to #8.