smootheststep
Definition
-- @/lua/common/mathlib.lua:1211
function smootheststep(x)
x = min(max(x, 0), 1)
return square(x*x)*(35-x*(x*(x*20-70)+84))
end
Callers
@/lua/ge/extensions/core/cameraModes/driver.lua
local carRoll = math.atan2(push3(camUp):dot(-push3(carLeft)), camUp:dot(carUp))
local carRollFactor = 1 - self.stableHorizonFactor * smootheststep(clamp(1.42*carUp.z, 0, 1))
local camRoll = carRoll * carRollFactor
local carPitch = math.atan2(carFwd.z, flatFwdLen > 0 and flatFwdLen or 1e-12)
local carPitchFactor = self.stablePitchFactor * sign(carUp.z) * smootheststep(clamp((transitionEnd - abs(carPitch)) / (transitionEnd - transitionStart), 0, 1))
local camPitch = math.rad(self.camRot.y) - carPitch * carPitchFactor