Пример #1
0
        float RayCastCallbackWrapper(ref RayCastInput input, int proxyId)
        {
            object        userData = _contactManager._broadPhase.GetUserData(proxyId);
            Fixture       fixture  = (Fixture)userData;
            RayCastOutput output;
            bool          hit = fixture.RayCast(out output, ref input);

            if (hit)
            {
                float   fraction = output.fraction;
                Vector2 point    = (1.0f - fraction) * input.p1 + fraction * input.p2;
                return(_rayCastCallback(fixture, point, output.normal, fraction));
            }

            return(input.maxFraction);
        }