QueryAABB bug or what?

I noticed whilst I was testing out the start of my platformer there was a problem with my collision detection method. I used a rotated polygon physics body with 4 points as a ramp for my character (a crate) to go up, I was using queryAABB to check if the crate was touching the ramp. From what I can see queryAABB will check for the bounding box around the ramp rather than the actual ramp itself, someone correct me if Im wrong and if I’m right is there a better way for me to detect a collision between the crate and objects underneath it, thanks.

Hi Luatee. You are right in that queryAABB only checks against the bounding box of shapes. However there are a number of other things you can use such as sensors or using the testOverlap function:

-- this will return true when the two bodies are touching
bodyA:testOverlap(bodyB)

There is an example of it in Physics Lab Test 8. Hope this helps.

So if I used queryAABB with the testOverlap of the body I get from the query function I should be alright? Ill try it anyway, thanks