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

is it possible to perfrom collision checks Whether there is collsion between a given volume box and gvdb-voxels? #118

Open
jediofgever opened this issue May 15, 2021 · 1 comment

Comments

@jediofgever
Copy link

jediofgever commented May 15, 2021

Hi I am wondering whats the most efficient way to perform collision checks within gvdb-voxels?
I look through whole documentation and API but didn't see anything related to it.

@jediofgever jediofgever changed the title is it possible to perfrom collision checks Whether there is collsion between a given volume box and gvdb-voxels? ? is it possible to perfrom collision checks Whether there is collsion between a given volume box and gvdb-voxels? May 15, 2021
@ramakarl
Copy link
Contributor

You could write a kernel to do this.
Pass the bounding box min/max into a voxel compute kernel.
Then for each voxel above your threshold check if its inside the test volume. Each thread can write a single bit/byte into a global array as out (0=no hit, 1=hit). Bring back the output array to CPU. Then perform a compute reduction (sum all 1 entries) on the global array, that will tell you whether there is a collision and also the amount of collision (volume integral).
There is no build-in function to do collision tests, but the function for reductions is there.

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

No branches or pull requests

2 participants