NewtonMaterialSetContactNormalDirection

From Newton Wiki
Revision as of 08:02, 10 June 2019 by WikiSysop (talk | contribs) (1 revision imported)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

NewtonMaterialSetContactNormalDirection

void NewtonMaterialSetContactNormalDirection( const NewtonMaterial* materialHandle, const dFloat* direction)

Usage

Set the new direction of the for this contact point.

Parameters

  • const NewtonMaterial materialHandle - pointer to a material pair.
  • const dFloat *direction - pointer to an array of at least three floats holding the direction vector.

Return

  • Nothing.

Remarks

  • This function can only be called from a material callback event handler. This function changes the basis of the contact point to one where the contact normal is alinend to the new direction vector and the tangent direction are recalculated to be perpendicular to the new contact normal.
  • In 99.9% of the cases the collision system can calculates a very good contact normal. however this algorithm that calculate the contact normal use as criteria the normal direction that will resolve the interpenetration with the least amount on motion. There are situations however when this solution is not the best. Take for example a rolling ball over a texelated floor, when the ball is over a flat polygon, the contact normal is always perpendicular to the floor and pass by the origin of the sphere, however when the sphere is going across two adjacent polygons, the contact normal is now perpendicular to the polygons edge and this does not guarantee they it will pass bay the origin of the sphere, but we know that the best normal is always the one passing by the origin of the sphere.

See also

NewtonMaterialSetCollisionCallback NewtonMaterialContactRotateTangentDirections