コード例 #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
ファイル: Collision.cs プロジェクト: Ethereal77/stride
        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;
        }