Exemple #1
0
 internal void Destroy()
 {
     ColliderA = null;
     ColliderB = null;
     NewContactChannel.Reset();
     ContactUpdateChannel.Reset();
     ContactEndedChannel.Reset();
     ChannelsPool.Enqueue(NewContactChannel);
     ChannelsPool.Enqueue(ContactUpdateChannel);
     ChannelsPool.Enqueue(ContactEndedChannel);
     Contacts.Clear();
 }
Exemple #2
0
        internal void Destroy()
        {
            // Because we raise CollisionEnded for removed components right before Simulation.BeginContactTesting()
            // cleans up the ended collisions, we need to retain the collider information for an additional frame.
            // The collision has been removed from PhysicsComponent.Collisions and the user should not store the
            // collision object between frames.
            if (!HasEndedFromComponentRemoval)
            {
                ColliderA = null;
                ColliderB = null;
            }
            NewContactChannel.Reset();
            ContactUpdateChannel.Reset();
            ContactEndedChannel.Reset();
            ChannelsPool.Enqueue(NewContactChannel);
            ChannelsPool.Enqueue(ContactUpdateChannel);
            ChannelsPool.Enqueue(ContactEndedChannel);
            Contacts.Clear();

            destroyed = true;
        }