Hi guys,
I got this snippet that prints out what bodies have collided.
local function onPostSolve(event)
local fixtureA = event.fixtureA
local fixtureB = event.fixtureB
local bodyA = fixtureA:getBody()
local bodyB = fixtureB:getBody()
print("post solve: "..bodyA.name.."<->"..bodyB.name)
end
world:addEventListener(Event.POST_SOLVE, onPostSolve)
but I also want to know their collision strength, like is one body just sliding over the other or have they rammed into each other with force? Where do I get this info?
Thanks!
Comments
local lvA = bodyA:getLinearVelocity()
local lvB = bodyB:getLinearVelocity()
if lvA > 1 or lvB > 1 then
print("post solve: "..bodyA.name.." ("..lvA..") --- "..bodyB.name.." ("..lvB..")")
end
Likes: RogerT
Likes: RogerT