I'm trying to find the measurement of force of a collision callback. Any ideas?
I looked at Contact objects, they'll provide friction information but not any information about forces or impulses.
love.physics getting collision force
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Re: love.physics getting collision force
The postsolve callback (World:setCallbacks) has 2 additional parameters for each contact point.
Code: Select all
function postsolve(fixture1, fixture2, contact, ...)
local impulses = {...}
local point1_normal_impulses = impulses[1]
local point1_tangent_impulses = impulses[2]
-- The following can be nil if there's only one contact point.
local point2_normal_impulses = impulses[3]
local point2_tangent_impulses = impulses[4]
end
Shallow indentations.
Who is online
Users browsing this forum: darkfrei, Google [Bot] and 2 guests