NewtonTreeCollisionGetVertexListTriangleListInAABB

From Newton Wiki
Revision as of 07:55, 13 April 2020 by WikiSysop (talk | contribs)
Jump to: navigation, search

NewtonTreeCollisionGetVertexListTriangleListInAABB

int NewtonTreeCollisionGetVertexListTriangleListInAABB (const NewtonCollision* const treeCollision, const dFloat* const p0, const dFloat* const p1, const dFloat** const vertexArray, int* const vertexCount, int* const vertexStrideInBytes, const int* const indexList, int maxIndexCount, const int* const faceAttribute)

Usage

collect the vertex list index list mesh intersecting the AABB in collision mesh.

Parameters

  • const NewtonCollision* const treeCollision
  • const dFloat* const p0
  • const dFloat* const p1
  • const dFloat** const vertexArray
  • int* const vertexCount
  • int* const vertexStrideInBytes
  • const int* const indexList
  • int maxIndexCount
  • const int* const faceAttribute

Return

  • int - number of faces
  • vertexStrideInBytes - gets filled with a value telling you the stride between vertexarray vertices (12 bytes)
  • vertexArray - here you receive a pointer to array of vertexes in newton memory (data is not copied to your buffer, here you receive pointer to newton's data)
  • faceAttribute and indexList get filled with data constructing the faces, returned geometry is always returned as triangles (3 indexes per face, and 1 faceattribute per face).

Description

  • indexList should be a list 3 * maxIndexCount the number of elements.
  • faceAttributet should be a list maxIndexCount the number of elements.
  • this function could be used by the application for many purposes. For example it can be used to draw the collision geometry intersecting a collision primitive instead of drawing the entire collision tree in debug mode. Another use for this function is to to efficient draw projective texture shadows.

See also