Hello,
I'm in the process of creating my own 2d physics engine, but I'm hung up on resolving collisions between objects in my game. Does anyone have any tutorials that explain this process that I could have a link to? I've done a bit of searching but I can't seem to find the right material.
Thanks,
hihgsped
Creating a physics engine
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Re: Creating a physics engine
Studying Love2D's Physics Library might help you. especially love.graphics.newFixture, and love.graphics.getDistance.
Re: Creating a physics engine
Depends on whether your shapes are arbitrary or AABB. If you need arbitrary shapes for your objects, collision resolution is going to be a very hard problem, and I recommend sticking to Box2D; however, you can try the HC collision detection library, but last time I checked, it didn't provide collision response, only detection.
For AABBs, things become simple enough for a DIY. I can't recommend any specific tutorial, but look for sources that use 'Minkowski difference' as that simplifies collision resolution a lot.
For AABBs, things become simple enough for a DIY. I can't recommend any specific tutorial, but look for sources that use 'Minkowski difference' as that simplifies collision resolution a lot.
Re: Creating a physics engine
love2d already has it's own physics library, love.physics, if you are struggling with collision detection look this up
https://2dengine.com/?p=intersections
https://2dengine.com/?p=intersections
-
Re: Creating a physics engine
You probably won't be able to do any better than Box2D is already doing, in terms of performance anyway. So if you feel like doing a trigonometry exercise then go ahead, but otherwise you should just learn to use an existing physics engine instead.
Who is online
Users browsing this forum: Bing [Bot] and 3 guests