Exemple #1
0
 void ProcessPair()
 {
     pair = PhysicsManager.GetCollisionPair(id1, id2);
     if (pair.IsNotNull())
     {
         if (pair.PartitionVersion != Partition._Version)
         {
             pair.PartitionVersion = Partition._Version;
             pair.CheckAndDistributeCollision();
         }
     }
 }
        public void Distribute()
        {
            int nodePeakCount = PeakCount;

            for (int j = 0; j < nodePeakCount; j++)
            {
                id1 = ContainedObjects [j];
                for (int k = j + 1; k < nodePeakCount; k++)
                {
                    id2 = ContainedObjects [k];


                    pair = PhysicsManager.GetCollisionPair(id1, id2);
                    if (System.Object.ReferenceEquals(null, pair) == false && (pair.PartitionVersion != Partition._Version))
                    {
                        pair.CheckAndDistributeCollision();
                        pair.PartitionVersion = Partition._Version;
                    }
                }
            }
        }