NevermoreEngine icon indicating copy to clipboard operation
NevermoreEngine copied to clipboard

Refactor qMath.MapNumber and qMath.LerpNumber to qMath.Map and qMath.Lerp, respectively

Open Quenty opened this issue 6 years ago • 1 comments

Quenty avatar Jan 05 '18 02:01 Quenty

function Math.CompoundTransparency(a, b)
	-- For when you need something to have a Transparency of a Transparency.
	-- For example, a Ripple whose "Color" is Black with 0.46 Transparency (for gray)
	--	that would, if it were any other color, have 0.8 or 0.9 Transparency
	-- @param number a
	-- @param number b

	return a + b - a*b
end

function Math.Lerp(Start, Finish, Alpha)
	-- Return intermediate value between Start and Finish
	-- @param number Start
	-- @param number Finish
	-- @param number Alpha [0, 1]

	return Start + Alpha * (Finish - Start)
end

Validark avatar Apr 18 '18 11:04 Validark