OK, so I've done this:
Code: Select all
function load()
world = love.physics.newWorld(2000, 2000)
world:setCallback(collision)
Code: Select all
body1.circleShape:setData("foo")
body2.circleShape:setData("bar")
Finally, I've implemented the collision handler:
Code: Select all
function collision(a, b, c)
collisionDebugMsg = "Collided: " .. a .. " + " .. b
Collided: foo + bar
My question is: What is "c"? I get an error if I try to cat it in my collisionDebugMsg. I can't find any info in the physics documentation. I tried scanning the Box2D manual, but that didn't help me either. I'm sure I'm missing something obvious... anyway my overall goal is to get a hold of the specific shape instance that is colliding, so I can do things to it (I have many "body1" objects instantiated). I'm assuming c is some kind of contact object that I can use to find the actual objects that are colliding?
I'm investigating further, but I thought I'd post my query while I keep looking.