예제 #1
0
파일: Collision.cs 프로젝트: Aggror/Stride
 internal void Destroy()
 {
     ColliderA = null;
     ColliderB = null;
     NewContactChannel.Reset();
     ContactUpdateChannel.Reset();
     ContactEndedChannel.Reset();
     ChannelsPool.Enqueue(NewContactChannel);
     ChannelsPool.Enqueue(ContactUpdateChannel);
     ChannelsPool.Enqueue(ContactEndedChannel);
     Contacts.Clear();
 }
예제 #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;
        }