Type Function Library physics.* Return value none Revision 2019.3470 Keywords physics, collision, averaging See also physics.getAverageCollisionPositions() collision preCollision postCollision physics.setReportCollisionsInContentCoordinates()
Because it's common for Box2D to report multiple collision points during a single frame iteration, this setting is useful to report those points as one averaged point. This function applies to all the contact points in the collision, preCollision, and postCollision physics events.
physics.setAverageCollisionPositions( enabled )
Boolean. Enables the averaging of all contact points in a collision between physics bodies.
-- Toggle the averaging if ( physics.getAverageCollisionPositions() ) then physics.setAverageCollisionPositions( false ) else physics.setAverageCollisionPositions( true ) end