View Full Version : clan::Body::sig_collision_begin() & clan::Body::sig_collision_end() don't fire signal

05-20-2014, 08:43 AM

I have another problem.
Both of the events don't fire even though they are connected to a function and a collision between two physics bodies happen.

I tried to only include the relevant parts in the following code examples.
Here is the github for a detailed view: https://github.com/thecherry94/CherryMoonLander/

... = unrelevant code


class Player
clan::Slot slot_collision_begin;
clan::Slot slot_collision_end;

void on_collision_start(clan::Body);
void on_collision_end(clan::Body);


Player::Player(Level* pLevel)
slot_collision_begin = m_physicsBody.sig_begin_collision().connect(this, &Player::on_collision_start);
slot_collision_end = m_physicsBody.sig_end_collision().connect(this, &Player::on_collision_end);


void on_collision_start(clan::Body);
void on_collision_end(clan::Body);

are never being called when a collision occurs.

Thanks for your time!

05-22-2014, 12:17 PM
I changed my ClanLib to the current official github version where clan::Slot got removed.

The code differs a bit from the example above now.

What am I doing wrong or did the physic collision events never work?
I bet its just a minimal mistake I can't discern...

05-23-2014, 09:56 AM
I'm sorry, but as far as I know, nobody is currently using clanPhysics2D.

I haven't seen the developer behind it on IRC for a long time.

I personally don't know the source, and it's completeness.

05-23-2014, 06:45 PM
Aww man, that sucks. I wish I knew that before.

Can I create a CollisionOutline programmatically from vertices?

I'd just do a normal CollisionOutline detection every iteration and use a box for the player.

If so, I'm apparently too oblivious to find where...

Found it, was too oblivious as expected...

05-25-2014, 02:53 PM
It's working fine now.

I'm just using the CollisionOutlines instead of Physics2D