Search found 183 matches

by ddabrahim
Mon Sep 25, 2023 7:38 pm
Forum: General
Topic: Separate 2 colliding objects.
Replies: 2
Views: 7750

Separate 2 colliding objects.

Hi all! I have implemented HardonCollider in my project to allow me to rotate colliders and detect collision with the rotation taken in to account. However, it is introduced me to a new challenge when I try to detect where exactly the collision occurs and move object away from an other. I have attac...
by ddabrahim
Sun Sep 03, 2023 5:25 pm
Forum: General
Topic: Collision library that take rotation in to account
Replies: 14
Views: 6538

Re: Collision library that take rotation in to account

I have discovered an other "limitation" of HardonCollider that did not really fit my system and that is if I was calling polygon:scale() multiple times, it is constantly multiplied the scale and keep increased the size of the collider. For example if I set :scale(2) and then scale(3) insid...
by ddabrahim
Fri Sep 01, 2023 9:15 pm
Forum: General
Topic: Collision library that take rotation in to account
Replies: 14
Views: 6538

Re: Collision library that take rotation in to account

Okay. After going through every possible options, libraries to check collision without reading any documentation to make sure I struggle as much as possible, I managed to find a hack in HardonCollider to get it work the way I want it. The solution I've found is so simple I can't believe it, I share ...
by ddabrahim
Wed Aug 30, 2023 9:14 pm
Forum: Libraries and Tools
Topic: MiniIDE: live code inside a LOVE app
Replies: 13
Views: 25988

Re: MiniIDE: live code inside a LOVE app

Interesting project. One small problem I have immediately faced. If I implement my own love.draw callback and run it, it is clear the entire screen, get rid of all the menus including the option to stop the code. I would setup a key, maybe the Escape key traditionally to stop the code from running w...
by ddabrahim
Tue Aug 29, 2023 12:08 pm
Forum: General
Topic: Collision library that take rotation in to account
Replies: 14
Views: 6538

Re: Collision library that take rotation in to account

You **do not** overwrite the anchor point nor the position when you rotated the turret, because then you'll have a bad time managing relative rotations considering the turret isn't rotated along its center point, as you said; just save the rotation angle, and mess with that, then apply it with rota...
by ddabrahim
Tue Aug 29, 2023 10:01 am
Forum: General
Topic: Collision library that take rotation in to account
Replies: 14
Views: 6538

Re: Collision library that take rotation in to account

Wouldn't it be easier to switch to using center point for your stuff rather than the other way round? Just saying. It would be easier but this is not what I want. Lets say you have a turret on the ground facing up and you can rotate and move left and right to shoot the planes in the sky. You don’t ...
by ddabrahim
Tue Aug 29, 2023 8:20 am
Forum: General
Topic: Collision library that take rotation in to account
Replies: 14
Views: 6538

Re: Collision library that take rotation in to account

it does have a notice saying that the top-left x,y parameters are just for show, those get converted to center coordinates internally. Yes this is the problem. Apparently all collision libs using the center point including love.physics but when rotating it does not suite the way I rotate my sprites...
by ddabrahim
Mon Aug 28, 2023 2:30 pm
Forum: General
Topic: Collision library that take rotation in to account
Replies: 14
Views: 6538

Re: Collision library that take rotation in to account

Thanks a lot. I'll look in to ConvexPolygonShapes then. That said, according to the docs, "Most shapes will be centered on the point (x,y)." To me, that says that the positioning is based on the centroid of the shapes, not their topleft that you expect for some reason. When I create the re...
by ddabrahim
Mon Aug 28, 2023 1:14 pm
Forum: General
Topic: Collision library that take rotation in to account
Replies: 14
Views: 6538

Re: Collision library that take rotation in to account

Thank you I have considered using love.physics but I don't need a full physics engine and I was hoping there is some lightweight library that allow me to "simply" just create a rectangle collider, set x and y position, scale, rotation and check collision so I can super easily integrate it ...
by ddabrahim
Mon Aug 28, 2023 12:06 pm
Forum: General
Topic: Collision library that take rotation in to account
Replies: 14
Views: 6538

Re: Collision library that take rotation in to account

Yes, I am basically asking for collision libraries that also support rotation (and easy to use), or help with the HadronCollider library.

Windfield and Breezefield looks interesting, I have a look. Thank you.