Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Collision handler docs #9

Open
BrownNPC opened this issue Jun 2, 2024 · 1 comment
Open

Collision handler docs #9

BrownNPC opened this issue Jun 2, 2024 · 1 comment

Comments

@BrownNPC
Copy link

BrownNPC commented Jun 2, 2024

I'm kinda struggling to add collison handlers. I added a collision type to my rigid bodies, now how exactly do i pass a collison function to space.AddCollisionHanlder? Some explanation for this would be cool.

@jhasse
Copy link
Owner

jhasse commented Jun 5, 2024

You would probably use a lambda. E.g. for postSolve:

space.addCollisionHandler(TypeA, TypeB,
    nullptr,
    nullptr,
    [this](Arbiter a, Space& s) { yourMemberFunction(a, s); },
    nullptr
);

Does this help? If so I could add it in a docstring.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants