Preferred way to handle materials

A place to discuss everything related to Newton Dynamics.

Moderators: Sascha Willems, walaber

Preferred way to handle materials

Postby Shaderman » Fri Jan 13, 2017 6:17 am


I want to add materials to my game engine plugin and wonder if this is the preferred way to do it with the current Newton version:

- get material ID's using NewtonMaterialCreateGroupID for a material pair
- create a dMaterialPairManager::dMaterialPair with these id's and set restitution and friction values
- add the dMaterialPairManager::dMaterialPair to dMaterialPairManager
- in the material collision callback, get each material from the contactJoint.
- get the dMaterialPair from dMaterialPairManager and apply the material pair values using NewtonMaterialSetContactFrictionCoef and NewtonMaterialSetContactElasticity

I wonder if I really have to handle materials myself with material collission callbacks or if there's a way where Newton will do it for me automagically.


Posts: 66
Joined: Tue Mar 08, 2016 2:51 am

Return to General Discussion

Who is online

Users browsing this forum: Dave Gravel and 3 guests