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 »

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: 861
Joined: Sat Dec 22, 2012 7:20 pm

Re: Mirror flip fixture

Post by iforce2d »

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 »

Perfect thanks, do I need to reverse vertex winding when I do that?
iforce2d
Site Admin
Posts: 861
Joined: Sat Dec 22, 2012 7:20 pm

Re: Mirror flip fixture

Post by iforce2d »

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