Mirror flip fixture

Let us know if you have a nice R.U.B.E script to share!
Post Reply
UKDeveloper99
Posts: 13
Joined: Wed May 27, 2015 1:59 pm

Mirror flip fixture

Post by UKDeveloper99 » Sat Aug 08, 2015 10:37 pm

Anyone got a script to mirror flip a fixture in the x or y? Save me making one. Couldn't find it on here with the search.

iforce2d
Site Admin
Posts: 860
Joined: Sat Dec 22, 2012 7:20 pm

Re: Mirror flip fixture

Post by iforce2d » Sun Aug 09, 2015 12:25 am

Scaling by a negative factor will do that, as shown in the intro video:
https://www.youtube.com/watch?v=WqLR4dFn1qE#t=9m5s

One axis of the scale needs to be constrained. More details here:
https://www.youtube.com/watch?v=1UUHSezu96g#t=19m29s

UKDeveloper99
Posts: 13
Joined: Wed May 27, 2015 1:59 pm

Re: Mirror flip fixture

Post by UKDeveloper99 » Wed Aug 26, 2015 3:40 pm

Perfect thanks, do I need to reverse vertex winding when I do that?

iforce2d
Site Admin
Posts: 860
Joined: Sat Dec 22, 2012 7:20 pm

Re: Mirror flip fixture

Post by iforce2d » Wed Aug 26, 2015 5:39 pm

No, it will reverse it for you when it detects a negative scale.

EDIT: For bodies and fixtures the above is true. If you negative scale vertices though you would need to take care of winding reversal yourself if it's needed.

Post Reply