TestPoint() public méthode

Test a point for containment in this fixture.
public TestPoint ( System.Vector2 &point ) : bool
point System.Vector2 A point in world coordinates.
Résultat bool
Exemple #1
0
        private bool TestPointCallback(Fixture fixture)
        {
            bool inside = fixture.TestPoint(ref _point1);
            if (inside)
            {
                _myFixture = fixture;
                return false;
            }

            // Continue the query.
            return true;
        }
Exemple #2
0
        private bool TestPointAllCallback(Fixture fixture)
        {
            bool inside = fixture.TestPoint(ref _point2);
            if (inside)
                _testPointAllFixtures.Add(fixture);

            // Continue the query.
            return true;
        }
        private static void transferJoints(Body oldBody, List<Joint> joints, Body lb, Fixture glommed)
        {
            if (oldBody == lb) return;

            for (int i = joints.Count - 1; i >= 0; i--)
            {
                Joint j = joints[i];
                if (j.BodyA == oldBody)
                {
                    Vector2 testPoint = new Vector2(j.WorldAnchorA.X, j.WorldAnchorA.Y);
                    if (glommed == null || glommed.TestPoint(ref testPoint))
                    {
                        oldBody.JointList.Remove(j);
                        j.BodyA = lb;
                        lb.JointList.Add(j);
                        //joints.RemoveAt(i);

                    }
                }
                else
                {
                    Vector2 testPoint = new Vector2(j.WorldAnchorB.X, j.WorldAnchorB.Y);
                    if (glommed == null || glommed.TestPoint(ref testPoint))
                    {
                        oldBody.JointList.Remove(j);
                        j.BodyB = lb;
                        lb.JointList.Add(j);
                        //joints.RemoveAt(i);
                    }
                }

            }
        }