Skip to content

Instantly share code, notes, and snippets.

View TypicalPanda97's full-sized avatar

TypicalPanda97

View GitHub Profile
--[[Meta Table]]
Graphic = {}
Graphic.__index = Graphic
--[[
Lerps a point
p1, p2: tables with x and y value
t: time factor between 0 and 1
]]
function Graphic.LerpPoint(p1, p2, t)
--[[
Creates a quadratic bezier curve
coord1, coord2, coord3: tables with x and y values
finesse: controls how many steps are calculated, suggested 100
if there are gaps in the line you can try to increase this
Returns a array of xy coords
]]
local function CreateQuadraticBezierCurve(coord1, coord2, coord3, finesse)
local line = {}