Skip to content

Assert when sleeping body is activated by applying impulse/force directly in collision callback #257

@captaintechnicality

Description

@captaintechnicality

In my project I'm working on, I have breakable objects which are created as a set of dynamic bodies. These objects can be "broken" by a kinematic sensor, which applies an impulse force in the begin collision callback. If the dynamic bodies are sleeping, this triggers an assert at cpSpaceComponent.c:172 "Failed condition: cpArbiterThreadForBody(arb, body)->next == NULL".

I'm not sure if applying an impulse in the collision callback this way is meant to be a supported operation, as it works fine if the dynamic bodies are not sleeping.

For now, I can work around the issue by adding the impulse in a post-step callback instead, however, this is not ideal as it means I have to persist the data outside of the scope of the collision callback.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions