This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Field descriptions from the Tf2 Wiki: | |
//https://wiki.teamfortress.com/wiki/WebAPI/GetSchema | |
//This was created based on the Tf2 Schema from Jun 2022 | |
//While some fields have been generalized to adapt to future TF2 versions, others have not. | |
export type rawTf2Schema = { | |
result: { | |
status: number; //Should always be 1 | |
items_name_url: string; //A string containing the URL to the full item schema as used by the game. | |
items: rawTf2SchemaItem[]; //A list of item objects. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class BezierCurve { | |
static quadratic(x0, y0, x1, y1, x2, y2, steps) { | |
const points = []; | |
for (let step = 0; step <= steps; step++) { | |
const t = step / steps; | |
const [lx0, ly0] = interp(x0, y0, x1, y1, t); | |
const [lx1, ly1] = interp(x1, y1, x2, y2, t); |