Page 1 of 1

No overload matches delagate [SOLVED]

Posted: Mon Nov 17, 2014 11:55 pm
by jaja1

Code: Select all

public static void CheckPlayerAttack(Cylinder playerExtCol)
        {
            playerExtCol.CollisionInformation.Events.PairCreated += HandleCollision;
        }

        void HandleCollision(Cylinder sender, Collidable other, CollidablePairHandler pair)
        {

        }
Tried several 'types' in the HandleCollision method...but the error still prevails. Any help?

Re: No overload matches delagate

Posted: Tue Nov 18, 2014 6:32 pm
by Norbo
The PairCreated event uses the following delegate type:

Code: Select all

    public delegate void PairCreatedEventHandler<T>(T sender, BroadPhaseEntry other, NarrowPhasePair pair);
So, since the sender in this case is an EntityCollidable, you'd need to use (EntityCollidable, BroadPhaseEntry, NarrowPhasePair). If you want to get the entity associated with the EntityCollidable sender, check its Entity property. For more information about the distinction between BroadPhaseEntry/Collidable objects and Entity objects, check out the EntityConstructionDemo in the BEPUphysicsDemos.

All the different types are visible within the CollisionEventTypes.cs file. Also, Visual Studio has tools to generate event handlers.

Re: No overload matches delagate

Posted: Tue Nov 18, 2014 9:34 pm
by jaja1
Ahh thank you! I was looking for something like that in the demo but I must have missed it.