Box2D.Dynamics.World.Raycast C# (CSharp) Method

Raycast() public method

Ray-cast the world for all fixtures in the path of the ray. Your callback controls whether you get the closest point, any point, or n-points. The ray-cast ignores shapes that contain the starting point.
public Raycast ( IRayCastCallback callback, Vec2 point1, Vec2 point2 ) : void
callback IRayCastCallback a user implemented callback class.
point1 Box2D.Common.Vec2 the ray starting point
point2 Box2D.Common.Vec2 the ray ending point
return void
        public void Raycast(IRayCastCallback callback, Vec2 point1, Vec2 point2)
        {
            wrcwrapper.BroadPhase = ContactManager.BroadPhase;
            wrcwrapper.Callback = callback;
            input.MaxFraction = 1.0f;
            input.P1.Set(point1);
            input.P2.Set(point2);
            ContactManager.BroadPhase.Raycast(wrcwrapper, input);
        }