2
\$\begingroup\$

I used the following code in Farseer 3.3.1 and it worked correctly, but in Farseer 3.5, I always get an error message in the following line:

list = BayazitDecomposer.ConvexPartition(textureVertices);
'FarseerPhysics.Common.Decomposition.BayazitDecomposer' is inaccessible due to its protection level

What is wrong? Why is the code not working with Farseer 3.5? How can I use the decomposition tools in Farseer 3.5?

\$\endgroup\$
1
  • \$\begingroup\$ I solved the problem. I changed the line to: list = Triangulate.ConvexPartition(textureVertices, TriangulationAlgorithm.Bayazit); \$\endgroup\$ – Homer_Simpson May 18 '14 at 23:28
1
\$\begingroup\$

The BayazitDecomposer class was made assembly-internal in commit 101497, which was aimed at centralizing the input validation for the triangulation algorithms in a single place according to the check-in comment:

Removed sanity checks from all triangulators and moved them into Triangulate. Added asserts into each triangulation algorithm that checks if the polygon is valid. Triangulator is a new class that does all the work of validating inputs and sanatizing outputs.

Per that comment, one is now expected to use the ConvexPartition method from the Triangulate class, passing an enumeration value to specify the desired triangulation algorithm (as you noted, the value you want to use for a Bayazit implementation is TriangulationAlgorithm.Bayazit).

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.