Move cursor along fixture edge

Let us know if you have a nice R.U.B.E script to share!
Post Reply
iforce2d
Site Admin
Posts: 861
Joined: Sat Dec 22, 2012 7:20 pm

Move cursor along fixture edge

Post by iforce2d »

Here is a script that moves the cursor along the perimeter of a fixture (polygon, line or loop) by a specified distance. See the comments in the source code for a few places where you can make adjustments:
Attachments
moveAlongEdge.zip
(1.64 KiB) Downloaded 787 times
dAlex65
Posts: 16
Joined: Tue Feb 19, 2013 8:55 am

Re: Move cursor along fixture edge

Post by dAlex65 »

Cool. Just two comments to script code:
1 In layout.json have "desc": "move along edeg" instead edge. Just typo :)
2 In four places have local coord (.pos) in code, but script only work correctly for me when I changed this to the world pos (.wpos).
iforce2d
Site Admin
Posts: 861
Joined: Sat Dec 22, 2012 7:20 pm

Re: Move cursor along fixture edge

Post by iforce2d »

Thanks Alex, nice catch! I spent quite a while making this but completely forgot to check it with a body that was not at 0,0 with angle 0 as well :? The file has been fixed.
Post Reply