Page 1 of 1

Help with understanding specific command

Posted: Mon Dec 12, 2016 9:24 am
by MeteorFalling2
So I spent a lot of time trying to decode one of my favorite GlovePIE scripts relating to wiimote gyro-mouse.

So far I have condensed the code into several lines that are easy to understand. The only thing I do not understand is one command, which is the " *|var.wmSpeed| " reference. However, I understand what the var.wmSpeed means.

Could someone help me understand this? I'm trying to find code alternatives in FreePIE, but this seems to be the last code I cannot interpret.

Code: Select all


var.wmSpeedYaw = wiimote.MotionPlus.RawYawSpeed/ 120

var.wmSpeedPitch = wiimote.MotionPlus.RawPitchSpeed/120

var.wmSpeed = [ var.wmSpeedYaw, -var.wmSpeedPitch ]


[ var.wmRollFix_x, var.wmRollFix_y ] = [ sin(atan2(var.wmSpeedYaw, -var.wmSpeedPitch)), cos(atan2(var.wmSpeedYaw, -var.wmSpeedPitch)) ] * |var.wmSpeed|




Re: Help with understanding specific command

Posted: Mon Dec 12, 2016 11:59 am
by MeteorFalling2
I have finally found out the meaning of |var.wmSpeed|. It means absolute value.