Scirra / Construct-feature-requests

A place to submit feature requests and suggestions for Construct.
https://www.construct.net
11 stars 1 forks source link

Collision polygon circle #187

Open XHXIAIEIN opened 6 months ago

XHXIAIEIN commented 6 months ago

Reviewed guidelines

Checked for duplicate suggestions

Summary

Add a circle collision option. and adjust the radius.

Possible workarounds or alternatives

  1. add the behavior physics and put the collision in a circle.

  2. Use the more points to make a collision polygon.

Why can't an octagon collision polygon replace a true circle?

Because 8 and 12 polygons may get stuck at some extreme angles when sliding.And it is not so easy to draw a regular octagon in the editor.

A simple example, I hope that when collision the LampPostPole, player can slide over it instead of stop https://editor.construct.net/#open=vehicle-switching

Using more points can also cause performance issues, as the editor prompts.

Proposed solution

Add a circle collision option. and adjust the radius.

Maybe it is in the parameter bar above the collision tool, there is a polygon option. Enter a number and it will automatically generate a prefabricated regular polygon based on the center of the canvas/or the position of the image point.

Snipaste_2024-03-23_15-22-00

Why is this idea important?

This would solve so many problems with bullet, 8direction, car and other behaviors, that collide with solids.

Using circles instead of polygons can also improve the collision algorithm and use radius to determine

Even better if we could make an ellipse collision mask with horizontal diameter=sprite.width and vertical diameter=sprite.height

Additional remarks

No response

fodi commented 6 months ago

This would be extremely useful and if I'm not mistaken checking for collisions/overlaps of objects with circle collision masks is easier/faster compared to using "circleish" polygons with a bunch of points.

I'd be very happy with the option to put even just a single circle collision mask on an object with the possibility the radius (and maybe the position) of the circle.

Wackytoaster commented 5 months ago

Yeah I've also heard that a check for a circle collision is really efficent. But in any case I have quite often spend time making these awkward polygon circles and it's just... bleh. Circle collision would be really elegant (box2D also has that option which is great!)