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\$ Commented May 18, 2014 at 23:28

1 Answer 1

1
\$\begingroup\$

The BayazitDecomposer 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).


The original links will be unavaiable pending the closure of CodePlex.

Farseer Physics has been superseded by Velcro Physic and its implementation of BayazitDecomposer can be found here.

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .