Looks great, nice work!
It sounds like you implemented this functionality in game code, which is where it gets a bit problematic: There is no way to provide editor functionality in a CorePlugin, the two are strictly separated and the RigidBody Editor where you'd do most of the editing does not forward input events to the core at all. Only the Game View does, which is by design. So to get this working in the editor, you'd actually have to write an editor plugin.
There is no getting started guide on writing editor plugins right now, but it's been done on the community-side, so there are some questions around on the forum which may have answers that could help, and also you can take a look at the source of some of the existing editor plugins
. Also note that Duality auto-generates an editor plugin project just as it does with the core plugin for you - it's just not part of the solution file by default, so you'll have to add it manually in Visual Studio.
In this specific case, you'd probably want to provide a custom tool for the RigidBody editor
that does the cutting. The way this works is that you define a public class that derives from the tool base class and the editor will automatically add it to the appropriate toolbar and call your methods. I think the current API might not work that well for what you intend to do here, but could be worth a try.
Other than that, you may be interested in these issues on GitHub that I plan to address sooner or later. Feel free to join the discussion or contribute code samples or sketches on how this could be done!Allow Non-Convex, Arbitrary-Sized Polygon Shapes in RigidBodiesIntroduce an "Edit Shape" Tool to the RigidBody Editor
As far as the texturing issue goes, that might have something to do with how the RigidBodyRenderer
works, if you're using that one, e.g. with how it fills polygons
: Each one independently of the others, so there is no overarching continuity of texture coordinates. Since you're generating multiple polygons, there are seams between them. Another thing to be addressed on the core side, could be suitable for a PR as well.
Hope this helps a little, even though it might not be the answer that you anticipated.