physics.getAverageCollisionPositions()

Type Function
Library physics.*
Return value Boolean
Revision 2017.3060
Keywords physics, collision, averaging
See also physics.setAverageCollisionPositions()
collision
preCollision
postCollision
physics.getReportCollisionsInContentCoordinates()

Overview

It's common for Box2D to report multiple contact points during a single iteration of a simulation.

This function is use to determine if averaging of all the contact points is enabled.

Return

false (default) — The point of contact reported is the first one reported by Box2D. The order is arbitrary.

true — The point of contact reported is the average of all the contact points.

Syntax

physics.getAverageCollisionPositions()

Example

-- Toggle the averaging.
if ( physics.getAverageCollisionPositions() ) then

    physics.setAverageCollisionPositions( false )

else

    physics.setAverageCollisionPositions( true )

end