NewtonWorldForEachBodyInAABBDo

From Newton Wiki
Jump to: navigation, search

NewtonWorldForEachBodyInAABBDo

void NewtonWorldForEachBodyInAABBDo (const NewtonWorld* const newtonWorld, const dFloat* const p0, const dFloat* const p1, NewtonBodyIterator callback, void* const userData)

Usage

Searches for bodies whose AABB intresects the specified AABB and returns those newton bodies in the specified callback.

Parameters

  • const NewtonWorld* newtonWorld - newtonWorld handle
  • const dFloat* p0 - Start AABB point
  • const dFloat* p1 - End AABB point
  • NewtonBodyIterator callback - callback to call for each body.
  • void* userData - userdata sent to the body iterator callback.

Return

Data is returned in the callback.

Description

This function is fast and uses newton's internal data structures to search for bodies in specified AABB region.

Remarks

  • The application should provide the function *NewtonBodyIterator callback* to be called by Newton for every body in the world.
  • For small AABB volumes this function is much more inefficients (fixme: more or less efficient?) than NewtonWorldGetFirstBody. However, if the AABB contains the majority of objects in the scene, the overhead of scanning the internal
  • Broadphase collision plus the AABB test make this function more expensive.


See also

NewtonBodyGetAABB NewtonCollisionCalculateAABB NewtonCollisionSupportVertex NewtonWorldGetFirstBody