Quick Links: Download Gideros Studio | Gideros Documentation | Gideros community chat | DONATE
Angle Wrap (or constrain) — Gideros Forum

Angle Wrap (or constrain)

GregBUGGregBUG Guru
edited November 2012 in Code snippets
... could be useful ... :D

constrain angle from 0 to 360 (degree)
local function cAngle(x)
	local a = math.fmod(x, 360)
    if (a < 0) then
        a = a + 360
	end
    return a
end
Ciao!
TNT ENGiNE for Gideors Studio - Particle Engine, Virtual Pad, Animator Studio, Collision Engine - DOWNLOAD NOW !!! IT'S FREE!!! -
www.tntengine.com
Sign In or Register to comment.