XaiJu
Megan Fox
Megan Fox

patreon


Heading mirroring and ugly skate code

First, here's the heading mirroring function, and a bonus vector mirror that you probably already had. I don't claim this is the cleanest possible way, or the fastest way, but it's at least a way where you can intuit what's happening: https://pastebin.com/jn8Xwi3Q

Now this is how I use it. It won't make a ton of sense, but this is the code where I find the nearest point on the rail we're grinding along, snap to it, and then move forward along it a bit. I'm including this so you can see how and where the 180 degree rotation thing comes in. For those not aware, "Switch" means you're rolling backwards on the board. That's where your non-dominant foot is forward. It's the down-arrow in the other post's example, the case where you need to do the not-quite-a-mirror logic: https://pastebin.com/pjfkMLB4

Ok, cool! Have fun!


More Creators