Skip to content

Commit 62eeee2

Browse files
authored
[BUG FIX] Fix viewer raycast kernel compilation race condition. (#2430)
1 parent 1ef7303 commit 62eeee2

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

genesis/utils/raycast_qd.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -377,6 +377,9 @@ def __init__(self, scene: "Scene"):
377377

378378
self.update()
379379

380+
# Make sure raycasting is pre-compiled to avoid race condition with Quadrants.
381+
self.cast(ray_origin=np.zeros(3, dtype=gs.np_float), ray_direction=np.zeros(3, dtype=gs.np_float))
382+
380383
def _raycast_from_result(self, result: array_class.RaycastResult) -> "RayHit | None":
381384
distance = float(qd_to_numpy(result.distance))
382385
if math.isnan(distance):

0 commit comments

Comments
 (0)