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
In the documentations it says that poly-decomp is only needed when the vertices are not convex. But when I try to create a shape with convex vertices it fails with this error:
The weird thing is that these lines are only present in the built file.
I found a workaround by looking into the source code of Bodies.fromVertices(I use Body.create({ vertices })) so it is not a problem for me at the moment but I was wondering if that was intended. I think it is not because after throwing error if poly-decomp is not loaded, the latter parts of the function still checks for availability of the module.
Snippet to reproduce the error:
letvertices=[{x: 100,y: 100},{x: 150,y: 100},{x: 100,y: 150},];console.log(Matter.Vertices.isConvex(vertices));// prints trueletbody=Bodies.fromVertices(100,100,vertices);// Gives the error
The text was updated successfully, but these errors were encountered:
In the documentations it says that poly-decomp is only needed when the vertices are not convex. But when I try to create a shape with convex vertices it fails with this error:
The problem seems to be these lines:
matter-js/build/matter.js
Lines 6736 to 6738 in 61b1963
The weird thing is that these lines are only present in the built file.
I found a workaround by looking into the source code of
Bodies.fromVertices
(I useBody.create({ vertices })
) so it is not a problem for me at the moment but I was wondering if that was intended. I think it is not because after throwing error if poly-decomp is not loaded, the latter parts of the function still checks for availability of the module.Snippet to reproduce the error:
The text was updated successfully, but these errors were encountered: