No overload matches delagate [SOLVED]

Discuss any questions about BEPUphysics or problems encountered.
Post Reply
jaja1
Posts: 43
Joined: Sat Nov 15, 2014 3:27 am

No overload matches delagate [SOLVED]

Post 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?
Last edited by jaja1 on Tue Nov 18, 2014 9:34 pm, edited 1 time in total.
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

Re: No overload matches delagate

Post 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.
jaja1
Posts: 43
Joined: Sat Nov 15, 2014 3:27 am

Re: No overload matches delagate

Post by jaja1 »

Ahh thank you! I was looking for something like that in the demo but I must have missed it.
Post Reply