Before we start I wanna say thx to all the community. I leand lots of stuff by simply reading this forum :)
I'm posting this message because I haven't (yet) get the logic of the OnCollision.
I've create two entitys, the first one is Hero and the second one is PickableObject.
I want to know when this two entity are colliding and I want allow my hero to keep walking through the PickableObject.
I'm using the UserData to safe the reference of the body owner.
So I wrote this code for the Hero.OnCollision
bool Hero_OnCollision(Fixture fixtureA, Fixture fixtureB, FarseerPhysics.Dynamics.Contacts.Contact contact)
if ((Entity)fixtureB.UserData is PickableObject)
this.isColliding = false;
and there is the OnCollision for my PickableItems.
bool PickableObject_OnCollision(Fixture fixtureA, Fixture fixtureB, FarseerPhysics.Dynamics.Contacts.Contact contact)
if (fixtureB.UserData is Hero)
m_heroCollide = ((Hero)fixtureB.UserData);
That's great solution because my Hero is passing through my object and the collision is catched.
But (there is a but^^) I can't get the OnSeparation.
Nothing happend on the Hero OnSeparation and there is nothing on the PickableObject.
What did I miss ?