Isaac Gym: How to get the terrain height when using triangle mesh based on the x- and y-coordinates?

I’m trying to modify the “legged gym” reinforcement learning environment (GitHub - leggedrobotics/legged_gym: Isaac Gym Environments for Legged Robots) for that I need to get the height of the ground beneath the feet. I know how to get the x- and y-coordinates of the feet but I can’t find any useful way to get the height at these coordinates.

I tried going through all the triangle mesh vertices and use the height of the vertex closest to the x- and y-coordinates but given how many vertices there are this is way too slow.

Are there any methods I don’t know of to get the height given the x- and y-coordinates? Or are there some workarounds?