Duality.Components.Physics.RigidBody.QueryRectGlobal C# (CSharp) Méthode

QueryRectGlobal() public static méthode

Performs a global physical AABB query and returns the bodies that might be roughly contained or intersected by the specified region.
public static QueryRectGlobal ( System.Vector2 worldCoord, System.Vector2 size ) : List
worldCoord System.Vector2
size System.Vector2
Résultat List
        public static List<RigidBody> QueryRectGlobal(Vector2 worldCoord, Vector2 size)
        {
            List<RigidBody> bodies = new List<RigidBody>();

            Vector2 fsWorldCoord = PhysicsConvert.ToPhysicalUnit(worldCoord);
            FarseerPhysics.Collision.AABB fsWorldAABB = new FarseerPhysics.Collision.AABB(fsWorldCoord, PhysicsConvert.ToPhysicalUnit(size.X), PhysicsConvert.ToPhysicalUnit(size.Y));
            Scene.PhysicsWorld.QueryAABB(fixture =>
                {
                    ShapeInfo shape = fixture.UserData as ShapeInfo;
                    if (shape != null && shape.Parent != null && shape.Parent.Active)
                        bodies.Add(shape.Parent);
                    return true;
                },
                ref fsWorldAABB);

            return bodies;
        }