/// <summary> Add a body that this body is not allowed to Collide with, i.e. /// the body specified will Collide with this body /// /// </summary> /// <param name="other">The body to exclude from collisions with this body /// </param> public virtual void AddExcludedBody(Body other) { if (other.Equals(this)) { return ; } if (!excluded.Contains(other)) { excluded.Add(other); other.AddExcludedBody(this); } }
/// <summary> Remove a body from the excluded list of this body. i.e. the /// body specified will be allowed to Collide with this body again /// /// </summary> /// <param name="other">The body to Remove from the exclusion list /// </param> public virtual void RemoveExcludedBody(Body other) { if (other.Equals(this)) { return ; } if (excluded.Contains(other)) { excluded.Remove(other); other.RemoveExcludedBody(this); } }