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

Fix BVH ray query docs #303

Closed
wants to merge 4 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Fix BVH ray query docs
mmacklin authored Sep 2, 2024
commit 1770c2c8a47a75d17575909468648bf7658d60e9
8 changes: 4 additions & 4 deletions docs/modules/runtime.rst
Original file line number Diff line number Diff line change
@@ -1135,11 +1135,11 @@ An example of performing a ray traversal on the data structure is as follows:
bounds_intersected: wp.array(dtype=wp.bool),
):
query = wp.bvh_query_ray(bvh_id, start, dir)
bounds_nr = wp.int32(0)
index = wp.int32(0)

while wp.bvh_query_next(query, bounds_nr):
# The ray intersects the volume with index bounds_nr
bounds_intersected[bounds_nr] = True
while wp.bvh_query_next(query, index):
# The ray intersects the bounds of the item at this index
bounds_intersected[index] = True


bounds_intersected = wp.zeros(shape=(num_bounds), dtype=wp.bool, device="cuda:0")