コード例 #1
0
ファイル: QuadTree.cs プロジェクト: jidungg/TestGame
        internal OrderedSet <CollisionBroadPhase> CollisionInspection(PhysicsObject col)
        {
            Debug.Log("Check " + this.name);
            OrderedSet <CollisionBroadPhase> set = new OrderedSet <CollisionBroadPhase>();

            if (!this.aabb.IsIntersects(col.DCollider))
            {
                Debug.Log("CollisionInpection Returns null");
                return(set);
            }
            if (!isLeaf)
            {
                foreach (QuadNode node in childNodes)
                {
                    set.Add(node.CollisionInspection(col));
                }
            }
            else
            {
                foreach (PhysicsObject obj in includedObjects)
                {
                    if (obj.id == col.id)
                    {
                        continue;
                    }
                    if (obj.DCollider.IsIntersects(col.DCollider))
                    {
                        CollisionBroadPhase tempCollision = new CollisionBroadPhase(col, obj);
                        set.Add(tempCollision);
                    }
                }
            }
            Debug.Log("CollisionInpection Returns : " + set);
            return(set);
        }
コード例 #2
0
        public override bool Equals(object obj)
        {
            if (obj is CollisionBroadPhase)
            {
                CollisionBroadPhase other = (CollisionBroadPhase)obj;
                if ((A.Equals(other.A) && B.Equals(other.B)) || (A.Equals(other.B) && B.Equals(other.A)))
                {
                    return(true);
                }
            }

            return(false);
        }
コード例 #3
0
 internal static void ResolveCollision(CollisionBroadPhase broadCollision)
 {
 }