Skip to content

How to cast_ray with latest bevy_rapier (0.29.0) #17957

Answered by dsellers22
dsellers22 asked this question in Q&A
Discussion options

You must be logged in to vote

Update: I've made some progress here, by bothering to notice that the rapier repo I linked above has an example of raycasting!

It seems I was missing a simple let context = rapier_context.single() which is the object that contains the cast_ray() method.

However I'm not seeing an error on the max_toi parameter: Expected 'Real' but found 'f32'

I don't understand this at all and I can't find any documentation on it. The raycasting example simply feeds it f32::MAX but even with that same argument the error persists.

rapier_context_systemparams.rs does specify that argument as "Real" but I don't know how to convert to this type from f32 or why the example doesn't mention it at all.

Help?

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Answer selected by dsellers22
Comment options

You must be logged in to vote
1 reply
@dsellers22
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant