Detect collisions with triangle

Hello all!

Firstly - sorry for my bad English.

I’m russian developer, yeah yeah i’m drunk, i have bear and i’m playing on balalaika, right now :slight_smile: !

So, i have problem.

Me need detect a collisions between rectangle and triangle.

On this picture all shows.

That I have to detect:

Object 1 - Partially included

Object 2 - fully included

Object 3 and Object 4 - not included.

How to do?

Thanks in advance!

Corona has integrated box2d physics simulator. It’s under physics.* library. Check documentation of Corona’s api

Unfortunately you cannot check in corona what part of object is colliding. You can only check if objects collide or not.

I’m sorry, I forgot to say, the project without physics engine.

If you do not want ot use embeded engine (it’s easier) so you must write your own math for handling this. You can read about collision detection generaly and then can try to implement it in Lua.

Corona has integrated box2d physics simulator. It’s under physics.* library. Check documentation of Corona’s api

Unfortunately you cannot check in corona what part of object is colliding. You can only check if objects collide or not.

I’m sorry, I forgot to say, the project without physics engine.

If you do not want ot use embeded engine (it’s easier) so you must write your own math for handling this. You can read about collision detection generaly and then can try to implement it in Lua.