示例#1
0
        public void ForBlobsInRange(Vector position, float radius, Action <Blob> action)
        {
            lock (UpdateLock)
            {
                var boundingBox = cpBB.cpBBNewForCircle(ChipmunkVectorConverter.ToChipmunk(position), radius);
                _space.BBQuery(
                    boundingBox, cpShape.FILTER_ALL, (shape, data) =>
                {
                    var blob = shape?.body.GetUserData() as Blob;
                    if (blob == null)
                    {
                        return;
                    }

                    action(blob);
                }, null);
            }
        }