How to trigger a function while two bodies are overlapping?

Here's the place to get help and discuss features. The focus is on the C++ version, but generic questions are welcome.
Flaneder
Posts: 1
Joined: Tue Jan 23, 2018 5:53 am

How to trigger a function while two bodies are overlapping?

Postby Flaneder » Wed Jan 24, 2018 10:19 am

I want to describe my issue with an example:

I have two different bodies:
  1. A dynamic body that is just flying arround
  2. A static body that boosts dynamic bodies over time while they overlap with it (e.g. just like a boost in mario kart). I implented this body as a sensor.

In this picture the two bodies overlap:
https://imgur.com/a/zPCmS

I know i can handle begin/endContact with a b2ContactListener.
But can i trigger a function each frame as long as two objects overlap?

Extra Information: I am using Box2D in my C# code, but my issue is mostly programming language indepedent.

Return to “General Discussion”



Who is online

Users browsing this forum: No registered users and 3 guests