コード例 #1
0
ファイル: Body.cs プロジェクト: zdam/SilverWeightPhone
 /// <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);
     }
 }
コード例 #2
0
ファイル: Body.cs プロジェクト: zdam/SilverWeightPhone
 /// <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);
     }
 }