/// <summary> /// Initializes a new instance of the <see cref="ContactSetCollection.Enumerator"/> struct. /// </summary> /// <param name="collection">The <see cref="ContactSetCollection"/> to be enumerated.</param> internal Enumerator(ContactSetCollection collection) { _collection = collection; _index = 0; _version = collection._version; _current = null; }
public static IEnumerable<ContactSet> Create(ContactSetCollection collection, CollisionObject collisionObject) { var enumerable = Pool.Obtain(); enumerable._collection = collection; enumerable._collisionObject = collisionObject; enumerable._index = 0; return enumerable; }
/// <summary> /// Creates a <see cref="ContactSetCollection"/> from an <see cref="IEnumerable{ContactSet}"/>. /// </summary> /// <param name="contactSets">The contact sets.</param> /// <returns> /// A <see cref="ContactSetCollection"/> that contains the elements from the input sequence. /// </returns> public static ContactSetCollection ToContactSetCollection(this IEnumerable <ContactSet> contactSets) { ContactSetCollection collection = contactSets as ContactSetCollection; if (collection != null) { return(collection); } return(new ContactSetCollection(contactSets)); }
/// <summary> /// Initializes a new instance of the <see cref="CollisionDetectionBroadPhase"/> class. /// </summary> public CollisionDetectionBroadPhase(CollisionDomain collisionDomain) { _collisionDomain = collisionDomain; // Register event handler. _collisionDomain.CollisionObjects.CollectionChanged += OnCollisionObjectsChanged; // Per default we use Sweep and Prune. SpatialPartition = new SweepAndPruneSpace <CollisionObject>(); CandidatePairs = new ContactSetCollection(); }
protected override void OnRecycle() { _collection = null; _collisionObject = null; Pool.Recycle(this); }
public ContactSetCollectionView(ContactSetCollection collection) { _collection = collection; }
/// <summary> /// Performs application-defined tasks associated with freeing, releasing, or resetting /// unmanaged resources. /// </summary> public void Dispose() { _collection = null; _current = null; }