Skip to content
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

Raycasting broken, only finds voxels the player is within #2

Closed
deathcap opened this issue May 6, 2014 · 1 comment
Closed

Raycasting broken, only finds voxels the player is within #2

deathcap opened this issue May 6, 2014 · 1 comment
Labels

Comments

@deathcap
Copy link
Member

deathcap commented May 6, 2014

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:

screen shot 2014-05-05 at 8 57 40 pm

(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.

raycastVoxels() is implemented using: https://github.com/mikolalysenko/voxel-raycast - which only depends on the getBlock() API, so that's likely broken in deathcap/voxel-engine#ndarray, somehow.

edit: raycasting not raytracing. Check the camera direction vector.

@deathcap deathcap added the bug label May 6, 2014
@deathcap deathcap changed the title Raytracing broken, only finds voxels the player is within Raycasting broken, only finds voxels the player is within May 6, 2014
deathcap added a commit that referenced this issue May 6, 2014
deathcap/voxel-engine@ef8c0ee Negate and flip camera vector - partially fixes raycasting, #2

Commit message generated by https://github.com/deathcap/lmno-cl
@deathcap
Copy link
Member Author

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:

screen shot 2016-01-18 at 10 42 53 pm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant