Hehe, I know what you mean. Newton tutorials are quite complex and documentation is full of typos & mistakes, which makes picking this API up quite a challenge.
But, I think that setting that kind of callback is complicated... Only thing that I found from API is NewtonMaterialSetCollisionCallback where you can set callback when that kind of material collides.
Hmm...
Check the tutorial 4, file Material.cpp, seems that this should be done something like this:
// Get the default material IDint defaultID = NewtonMaterialGetDefaultGroupID (nWorld);// Set callback for the situation when default materials collideNewtonMaterialSetCollisionCallback (nWorld, defaultID, defaultID, &userData, GenericContactBegin, GenericContactProcess, GenericContactEnd);
Where those last three arguments are the callback functions:
int GenericContactBegin(const NewtonMaterial*, const NewtonBody*, const NewtonBody*)
So that would work if you don't specify your own materials, and if you do, then you must specify those same callbacks for every material collision.
In Newton it seems that you normally have one material for player, several for environment and also own materials for projectiles, etc. Although, I might be wrong in this one, haven't gone that far yet :)