예제 #1
0
 protected override void OnRecycle()
 {
     _compressedAabbTree = null;
     _enumerator.Dispose();
     _enumerator = null;
     Pool.Recycle(this);
 }
예제 #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);
            }
예제 #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);
            }
예제 #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);
            }
예제 #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);
            }
예제 #6
0
 protected override void OnRecycle()
 {
     _partition      = null;
     _otherPartition = null;
     _leafNodes.Dispose();
     _leafNodes = null;
     if (_otherCandidates != null)
     {
         _otherCandidates.Dispose();
         _otherCandidates = null;
     }
     Pool.Recycle(this);
 }
예제 #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);
            }
예제 #8
0
 protected override void OnRecycle()
 {
     _compressedAabbTree = null;
     Pool.Recycle(this);
 }