You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Issue description:
When having a CollisionPolygon2D with 3 consecutive points on the same line, interaction with rigid-bodies becomes unstable and janky.
When enabling collision shapes, the middle point on the collision polygon is visible although the colliding object is nowhere near it. (see image)
The most apparent effect is that applying torque in that direction will cause the object not to spin (most of the time), while applying torque in the other direction will behave normally
Steps to reproduce:
Create a floor from static body with CollisionBodyPolygon2D
Create the floor collision shape as a rectangle from a polygon using 5 points (1 extra point), for example:
PoolVector2Array( 64, 384, 554, 384, 832, 384, 832, 448, 64, 448 )
Create a box with controllable torque that lays on the floor, and try to apply torque in each direction, the box is expected to move, but sometimes it gets "stuck".
make sure to:
give enough torque (100 torque for 1 weight works for me)
disable "can sleep" on the box
Minimal reproduction project:
attached a minimal reproduction.
A and D keys apply torque to the box
deleting point 1 in the CollisionPolygon2D for floor fixes the issue Archive.zip
The text was updated successfully, but these errors were encountered:
It looks like it only affects rectangular polygons (including rotated ones, eg. a diamond shape, though they're more likely to be "rescued" by lack of precision). For sure, 3 collinear points is not an issue on polygons that deviate in any way from being a rectangle:
left, rotated rectangle (points arranged in a rotated rectangle that is, the node is unrotated); right, the same rectangle with 2 more points, one moved out a little. The whole polygon is now properly convexified.
For those arriving here with this issue requiring a quick fix, a workaround that works in game is to add the following script (in the minimal project's case, on the Floor static body):
this will remove collinear vertices, and so the bug can't occur. This of course won't help if you still needed those vertices (if, say, you were planning to deform the polygon into other shapes).
Godot version:
tested on 3.2.1 and 3.2.2 beta 2
OS/device including version:
tested on OSX
Issue description:
When having a CollisionPolygon2D with 3 consecutive points on the same line, interaction with rigid-bodies becomes unstable and janky.
When enabling collision shapes, the middle point on the collision polygon is visible although the colliding object is nowhere near it. (see image)
The most apparent effect is that applying torque in that direction will cause the object not to spin (most of the time), while applying torque in the other direction will behave normally
Steps to reproduce:
Create a floor from static body with CollisionBodyPolygon2D
Create the floor collision shape as a rectangle from a polygon using 5 points (1 extra point), for example:
PoolVector2Array( 64, 384, 554, 384, 832, 384, 832, 448, 64, 448 )
Create a box with controllable torque that lays on the floor, and try to apply torque in each direction, the box is expected to move, but sometimes it gets "stuck".
make sure to:
Minimal reproduction project:
attached a minimal reproduction.
A and D keys apply torque to the box
deleting point 1 in the CollisionPolygon2D for floor fixes the issue
Archive.zip
The text was updated successfully, but these errors were encountered: