I have no idea how to use World.RayCast and can't find any tutorials!

Topics: Developer Forum
Jan 19, 2013 at 12:00 PM

I tried to copy a similar class I found on this forum through google but the callback function is never fired, even when I see the two points go through an object.

I'm trying to test against dynamic objects created with the BodyFactory, is this where I'm going wrong as they are not fixtures, only bodies? Bodies collide with each other just fine normally so I'm not sure what a Fixture is when all it says it that it attaches a shape for collision detection?

What should I be doing here to have my Dynamic objects work in the RayCast? Also, can someone post a basic example of how to use RayCast and how to use a RayCastCallback? I tried all last night and I'm stuck =/

 

Coordinator
Jan 19, 2013 at 8:50 PM

You should take a look at the Testbed project (download it here). It contains a Raycast test that shows you all the different ways you can use the Raycast feature.