{"id":"gigahd/splynx","name":"splynx","scope":"gigahd","platform":"roblox","description":"Fast splines for Roblox: linear, Bezier, Hermite, Catmull-Rom, cardinal, B-splines, rounded corners and arc length corners, with constant-speed distance lookups","version":"0.2.0","latest":"0.2.0","versions":["0.1.0","0.2.0"],"license":"MIT","licenseRating":"safe","licenseCaveats":[],"licenseVerified":true,"dependencies":{},"integrity":"72aa39d30ac385d8eac4cfd4196bb0e764ba097d9507759c76ac4ba18bc71418","likes":0,"downloads":0,"install":"forest install gigahd/splynx","url":"https://forest.dev/p/roblox/gigahd/splynx","files":"https://api.forest.dev/ai/package/roblox/gigahd/splynx/files","readme":"# Splynx\n\nFast splines for Roblox. Linear, Bezier, Hermite, Catmull-Rom, cardinal and B-splines, with constant-speed movement\nalong any of them.\n\n## Install\n\nWith [Wally](https://wally.run):\n\n```toml\n[dependencies]\nSplynx = \"gigahd/splynx@0.1.0\"\n```\n\n## Use\n\n```lua\nlocal Splynx = require(path.to.Splynx)\n\nlocal spline = Splynx.catmullRom({\n    Vector3.new(0, 0, 0),\n    Vector3.new(10, 5, 0),\n    Vector3.new(20, 0, 0),\n})\n\n-- Move a part along it at 12 studs per second\nlocal distance, hint = 0, nil\nRunService.Heartbeat:Connect(function(deltaTime)\n    distance = (distance + 12 * deltaTime) % spline:getLength()\n    local position\n    position, hint = spline:getPosAtDistance(distance, hint)\n    part.Position = position\nend)\n```\n\nNeed the fastest lookups and won't edit the spline? `Splynx.sampled(spline, 0.5)` makes a static copy with constant-time\ndistance lookups.\n\nLaying a path out from waypoints? `Splynx.rounded(points, 2)` keeps the straight parts straight and rounds each\ncorner, starting 2 studs before it and ending 2 studs after. For many things moving along one spline,\n`getPosAtDistances` fills positions, directions and sideways offsets for all of them in one call, into tables you reuse.\n\n## Develop\n\nTools are managed with [Rokit](https://github.com/rojo-rbx/rokit): `rokit install`.\n\n- `lune run test`: correctness checks\n- `lune run bench`: benchmarks\n- `rojo serve test.project.json`: the same checks plus live visualizations in Studio (press F8 and drag the points)\n- `npx moonwave dev`: the documentation site\n\n## License\n\nMIT\n\n## [Documentation](https://gigahd.github.io/Splynx/)\n","readmeTruncated":false}