Replies: 5 comments 4 replies
|
You are setting the context to null, not to your game. |
0 replies
|
How looking void* context function ? What parameters get function ? And i Do have to do for all bodys this or not ? |
1 reply
|
I recommend spending some time learning about pointers and lifetime in C/C++. |
2 replies
|
In docs says. Where is looking class MyGame ? I needed looking all functions(vtblInterfaceTab) class MyGame. Or MyGame class it simple some user class for just example ? |
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment

Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
bool MyCustomFilter(b3ShapeId shapeIdA, b3ShapeId shapeIdB, void* context)
{
//MyGame* myGame = context;
//return myGame->WantsCollision(shapeIdA, shapeIdB);
return false;// if return true, work fine. not crash.
}
enum MyCategories
{
PLAYER = 0x00000002,
MONSTER = 0x00000004,
};
b3ShapeDef playerShapeDef = b3DefaultShapeDef();
playerShapeDef.filter.categoryBits = PLAYER;
// Players collide with monsters, but not with other players
playerShapeDef.filter.maskBits = MONSTER;
playerShapeDef.enableCustomFiltering = true;
b3World_SetCustomFilterCallback(myWorldId, MyCustomFilter, NULL);
All reactions