Difference between revisions of "Category:Physics Material Section"
(One intermediate revision by the same user not shown) | |||
Line 3: | Line 3: | ||
[[NewtonMaterialSetDefaultCollidable]] - Sets information, weither a material pair can collide. | [[NewtonMaterialSetDefaultCollidable]] - Sets information, weither a material pair can collide. | ||
− | [[NewtonMaterialSetDefaultElasticity]] - Sets default elasticity | + | [[NewtonMaterialSetDefaultElasticity]] - Sets default elasticity of collision between materials (coefficients of restitution) - https://en.wikipedia.org/wiki/Coefficient_of_restitution |
[[NewtonMaterialSetDefaultFriction]] - Sets default static and dynamic / kinetic / sliding friction | [[NewtonMaterialSetDefaultFriction]] - Sets default static and dynamic / kinetic / sliding friction | ||
− | [[NewtonMaterialSetDefaultSoftness]] - Sets surface softness | + | [[NewtonMaterialSetDefaultSoftness]] - Sets surface softness - this controls how physics engine handles penetrating contacts. |
[[NewtonMaterialSetSurfaceThickness]] - Sets surface's skin thickness | [[NewtonMaterialSetSurfaceThickness]] - Sets surface's skin thickness | ||
− | Friction for materials can be set up using a real world table or calculator such as: | + | Friction for materials can be set up using a real world table or calculator such as: https://www.engineeringtoolbox.com/friction-coefficients-d_778.html |
− | https://www.engineeringtoolbox.com/friction-coefficients-d_778.html | ||
− | Since material is assigned to a body, that would limit complex material setup on trimeshes or compound collisions | + | Since material is assigned to a body, that would limit complex material setup on trimeshes or compound collisions where multiple materials are desired on a single shape. |
+ | In such case you can use a custom material setup can be implemented in following way: | ||
[[NewtonContactsProcess]] callback sends you the contact "joint" object pointer which you can iterate using ([[NewtonContactJointGetContactCount]], [[NewtonContactJointGetFirstContact]], [[NewtonContactJointGetNextContact]]). | [[NewtonContactsProcess]] callback sends you the contact "joint" object pointer which you can iterate using ([[NewtonContactJointGetContactCount]], [[NewtonContactJointGetFirstContact]], [[NewtonContactJointGetNextContact]]). | ||
− | * To determine which part of compound collision, you can use [[NewtonMaterialGetBodyCollidingShape]] function, that will give you individual piece of compound collision that collided. On that you can make another call to [[NewtonCollisionGetUserData]] to get collision shape's user data. | + | * To determine which part of compound collision, you can use [[NewtonMaterialGetBodyCollidingShape]] function, that will give you individual piece of compound collision that collided. On that you can make another call to [[NewtonCollisionGetUserData]] to get collision shape's user data. |
− | * To determine which part of trimesh collided, you can use [[NewtonMaterialGetContactFaceAttribute]], that will give you the faceid / faceAttribute that you specified while building the trimesh - function [[NewtonTreeCollisionAddFace]]. | + | |
+ | * To determine which part of trimesh collided, you can use [[NewtonMaterialGetContactFaceAttribute]], that will give you the faceid / faceAttribute that you specified while building the trimesh - function [[NewtonTreeCollisionAddFace]]. | ||
With material contact functions you can then control individual customized collision contact response, this are: | With material contact functions you can then control individual customized collision contact response, this are: |
Latest revision as of 07:08, 3 July 2020
Newton material settings are based on real world values and always set in pairs.
NewtonMaterialSetDefaultCollidable - Sets information, weither a material pair can collide. NewtonMaterialSetDefaultElasticity - Sets default elasticity of collision between materials (coefficients of restitution) - https://en.wikipedia.org/wiki/Coefficient_of_restitution NewtonMaterialSetDefaultFriction - Sets default static and dynamic / kinetic / sliding friction NewtonMaterialSetDefaultSoftness - Sets surface softness - this controls how physics engine handles penetrating contacts. NewtonMaterialSetSurfaceThickness - Sets surface's skin thickness Friction for materials can be set up using a real world table or calculator such as: https://www.engineeringtoolbox.com/friction-coefficients-d_778.html
Since material is assigned to a body, that would limit complex material setup on trimeshes or compound collisions where multiple materials are desired on a single shape. In such case you can use a custom material setup can be implemented in following way:
NewtonContactsProcess callback sends you the contact "joint" object pointer which you can iterate using (NewtonContactJointGetContactCount, NewtonContactJointGetFirstContact, NewtonContactJointGetNextContact).
* To determine which part of compound collision, you can use NewtonMaterialGetBodyCollidingShape function, that will give you individual piece of compound collision that collided. On that you can make another call to NewtonCollisionGetUserData to get collision shape's user data.
* To determine which part of trimesh collided, you can use NewtonMaterialGetContactFaceAttribute, that will give you the faceid / faceAttribute that you specified while building the trimesh - function NewtonTreeCollisionAddFace.
With material contact functions you can then control individual customized collision contact response, this are:
NewtonMaterialSetContactSoftness NewtonMaterialSetContactThickness NewtonMaterialSetContactElasticity NewtonMaterialSetContactFrictionState NewtonMaterialSetContactFrictionCoef NewtonMaterialSetContactNormalAcceleration NewtonMaterialSetContactNormalDirection NewtonMaterialSetContactPosition NewtonMaterialSetContactTangentFriction NewtonMaterialSetContactTangentAcceleration NewtonMaterialContactRotateTangentDirections NewtonMaterialGetContactPruningTolerance NewtonMaterialSetContactPruningTolerance
Pages in category ‘Physics Material Section’
The following 21 pages are in this category, out of 21 total.
N
- NewtonContactsProcess
- NewtonMaterialCreateGroupID
- NewtonMaterialDestroyAllGroupID
- NewtonMaterialGetDefaultGroupID
- NewtonMaterialGetUserData
- NewtonMaterialSetCallbackUserData
- NewtonMaterialSetCollisionCallback
- NewtonMaterialSetCompoundCollisionCallback
- NewtonMaterialSetContactGenerationCallback
- NewtonMaterialSetDefaultCollidable
- NewtonMaterialSetDefaultElasticity
- NewtonMaterialSetDefaultFriction
- NewtonMaterialSetDefaultSoftness
- NewtonMaterialSetSurfaceThickness
- NewtonOnAABBOverlap
- NewtonOnCompoundSubCollisionAABBOverlap
- NewtonOnContactGeneration
- NewtonWorldGetFirstBody
- NewtonWorldGetFirstMaterial
- NewtonWorldGetNextBody
- NewtonWorldGetNextMaterial