Results 1 to 5 of 5

Thread: clan::Body::sig_collision_begin() & clan::Body::sig_collision_end() don't fire signal

  1. #1
    Lesser Knight
    Join Date
    Sep 2010
    Location
    Germany
    Posts
    36

    Default clan::Body::sig_collision_begin() & clan::Body::sig_collision_end() don't fire signal

    Hello,

    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

    Player.hpp
    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.cpp
    Code:
    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);
    ...
    }

    but
    Code:
    void on_collision_start(clan::Body);
    void on_collision_end(clan::Body);
    are never being called when a collision occurs.


    Thanks for your time!

  2. #2
    Lesser Knight
    Join Date
    Sep 2010
    Location
    Germany
    Posts
    36

    Default

    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...
    Last edited by Tuisto; 05-23-2014 at 07:32 AM.

  3. #3
    ClanLib Developer
    Join Date
    May 2007
    Posts
    1,824

    Default

    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.

  4. #4
    Lesser Knight
    Join Date
    Sep 2010
    Location
    Germany
    Posts
    36

    Default

    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.


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

    EDIT 2:
    Found it, was too oblivious as expected...
    Last edited by Tuisto; 05-24-2014 at 03:23 PM.

  5. #5
    Lesser Knight
    Join Date
    Sep 2010
    Location
    Germany
    Posts
    36

    Default

    It's working fine now.

    I'm just using the CollisionOutlines instead of Physics2D

Similar Threads

  1. Clan System and Clan Ranks!
    By COLTONROCKO in forum Suggestion Box
    Replies: 2
    Last Post: 04-17-2014, 01:17 AM
  2. BAD CLAN AND HAWK CLAN LISTEN UP...😃
    By demonkid in forum Tanked
    Replies: 31
    Last Post: 02-18-2013, 10:17 PM
  3. Replies: 21
    Last Post: 01-06-2013, 02:14 PM

Bookmarks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •