From Newton Wiki
Jump to: navigation, search


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


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


  • 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.


Data is returned in the callback.


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


  • 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