NewtonTreeCollisionAddFace

From Newton Wiki
Jump to: navigation, search

NewtonTreeCollisionAddFace

void NewtonTreeCollisionAddFace (const NewtonCollision* treeCollision, int vertexCount, const dFloat* vertexPtr, int strideInBytes, int faceAttribute);

Usage

Add an individual polygon to a TreeCollision.

Parameters

  • const NewtonCollision* treeCollision - the pointer to the Tree Collision collision shape.
  • int vertexCount - number of vertices in vertexPtr
  • const dFloat *vertexPtr - pointer to an array of vertices. Each vertex should consist of at least 3 floats.
  • int strideInBytes - size of each vertex in bytes. This value should be 12 or larger.
  • int faceAttribute - ID that identifies the polygon. The application can use this value to customize the behavior of the collision geometry.

Return

  • Nothing.

Remarks

  • After the call to NewtonTreeCollisionBeginBuild the TreeCollision is ready to accept polygons. The application should iterate through the application's mesh, adding the mesh polygons to the TreeCollision one at a time. The polygons must be flat and non-self intersecting.

See also

NewtonTreeCollisionAddFace NewtonTreeCollisionEndBuild