Esempio n. 1
0
 protected override void OnRecycle()
 {
     _compressedAabbTree = null;
     _enumerator.Dispose();
     _enumerator = null;
     Pool.Recycle(this);
 }
Esempio n. 2
0
            public static IEnumerable <Node> Create(CompressedAabbTree compressedAabbTree, ref Aabb aabb)
            {
                var enumerable = Pool.Obtain();

                enumerable._compressedAabbTree = compressedAabbTree;
                enumerable._aabb  = aabb;
                enumerable._index = 0;
                return(enumerable);
            }
Esempio n. 3
0
            public static IEnumerable <Pair <int> > Create(CompressedAabbTree partition, ISpatialPartition <int> otherPartition)
            {
                var enumerable = Pool.Obtain();

                enumerable._partition      = partition;
                enumerable._otherPartition = otherPartition;
                enumerable._leafNodes      = partition.GetLeafNodes(otherPartition.Aabb).GetEnumerator();
                return(enumerable);
            }
Esempio n. 4
0
            public static IEnumerable <int> Create(CompressedAabbTree compressedAabbTree, int item)
            {
                var enumerable = Pool.Obtain();

                enumerable._compressedAabbTree = compressedAabbTree;
                enumerable._item = item;
                Aabb aabb = compressedAabbTree.GetAabbForItem(item);

                enumerable._enumerator = compressedAabbTree.GetOverlaps(aabb).GetEnumerator();
                return(enumerable);
            }
Esempio n. 5
0
            public static IEnumerable <int> Create(CompressedAabbTree compressedAabbTree, ref Ray ray)
            {
                var enumerable = Pool.Obtain();

                enumerable._compressedAabbTree = compressedAabbTree;
                enumerable._ray = ray;
                enumerable._rayDirectionInverse = new Vector3(1 / ray.Direction.X,
                                                              1 / ray.Direction.Y,
                                                              1 / ray.Direction.Z);
                enumerable._epsilon = Numeric.EpsilonF * (1 + compressedAabbTree.Aabb.Extent.Length);
                enumerable._index   = 0;
                return(enumerable);
            }
Esempio n. 6
0
 protected override void OnRecycle()
 {
     _partition      = null;
     _otherPartition = null;
     _leafNodes.Dispose();
     _leafNodes = null;
     if (_otherCandidates != null)
     {
         _otherCandidates.Dispose();
         _otherCandidates = null;
     }
     Pool.Recycle(this);
 }
Esempio n. 7
0
            public static IEnumerable <Pair <int> > Create(CompressedAabbTree partition,
                                                           ISpatialPartition <int> otherPartition, IEnumerable <Node> leafNodes,
                                                           ref Vector3 scale, ref Vector3 otherScaleInverse, ref Pose toOther)
            {
                var enumerable = Pool.Obtain();

                enumerable._partition         = partition;
                enumerable._otherPartition    = otherPartition;
                enumerable._leafNodes         = leafNodes.GetEnumerator();
                enumerable._scale             = scale;
                enumerable._otherScaleInverse = otherScaleInverse;
                enumerable._toOther           = toOther;
                return(enumerable);
            }
Esempio n. 8
0
 protected override void OnRecycle()
 {
     _compressedAabbTree = null;
     Pool.Recycle(this);
 }