Clicking triggers onFire which in the demo sets the voxel located at game.raycastVoxel(), but this only matches voxels the player is actually located inside:
(picture above shows the player inside the solid stone voxels, clicking to place)
On the other side of the valley (inside it, within air voxels), game.raycastVoxels() always returns false. Since maxDistance defaults to 10, it should at least match voxels ten blocks away.
voxel-example no longer includes an example of raycasting, but testing with voxel-example and adding voxel-outline 0.4.3 and voxel-voila 0.6.0, raycasting appears to be working correctly:
Clicking triggers
onFire
which in the demo sets the voxel located atgame.raycastVoxel()
, but this only matches voxels the player is actually located inside:(picture above shows the player inside the solid stone voxels, clicking to place)
On the other side of the valley (inside it, within air voxels),
game.raycastVoxels()
always returnsfalse
. SincemaxDistance
defaults to 10, it should at least match voxels ten blocks away.raycastVoxels()
is implemented using: https://github.com/mikolalysenko/voxel-raycast - which only depends on thegetBlock()
API, so that's likely broken in deathcap/voxel-engine#ndarray, somehow.edit: raycasting not raytracing. Check the camera direction vector.