{"id":"superdupernairobi/gerstner","name":"gerstner","scope":"superdupernairobi","platform":"roblox","description":"Gerstner wave displacement for Roblox. Pure math, no instances, no services, no state","version":"0.1.1","latest":"0.1.1","versions":["0.1.0","0.1.1"],"license":"MIT","licenseRating":"safe","licenseCaveats":[],"licenseVerified":true,"dependencies":{},"integrity":"82b414830fe5ff453e94f233789d449a0c5d221eccf646c86b6ebd6f0512b93b","likes":0,"downloads":0,"install":"forest install superdupernairobi/gerstner","url":"https://forest.dev/p/roblox/superdupernairobi/gerstner","files":"https://api.forest.dev/ai/package/roblox/superdupernairobi/gerstner/files","readme":"![Gerstner logo](assets/logo.png)\n\n# Gerstner\n\nPure Gerstner wave displacement for Roblox. One module and no Instances, no states. It takes wave definitions and returns surface positions.\n\n## Install\n\nWally:\n\n```toml\n[dependencies]\nGerstner = \"superdupernairobi/gerstner@0.1.0\"\n```\n\n## Quickstart\n\n```lua\nlocal gerstner = require(game.ReplicatedStorage.gerstner)\n\nlocal prepared = gerstner.prepare({\n    { wavelength = 40, amplitude = 2, steepness = 0.5, direction = Vector2.new(1, 0) },\n    { wavelength = 70, amplitude = 3, steepness = 0.4, direction = Vector2.new(0.7, 0.7) },\n})\n\nlocal position = gerstner.displace(prepared, x, z, t) -- Vector3\n```\n\n`prepare` validates and precomputes ONCE. `displace` is the hot path, call it PER vertex, per frame, against the same `prepared` value\n\n## Notes\n\n- **Studs.** `G` is `196.2` studs/s^2, matching a scale of 20 studs per metre\n- **`y` is relative to the water plane.** `displace` returns absolute X and Z, but `y` is measured from the planes own level, so your renderer adds sea level\n- **Reuse ONE `prepared` value.** Never call `prepare` inside an update loop\n- **Buoyancy is an APPROXIMATION.** Gerstner displaces horizontally, so \"surface height at world (x, z)\" is an inverse problem. Sampling `displace(x,z)` and taking `y` is a good approximation, not an exact answer. If you use it for physics, keep the authoritative lookup on the server\n\n## API\n\n`prepare`, `displace`, `Wave`, `Prepared` - see the [API ref](https://superdupernairobi.github.io/Gerstner/api/Gerstner)\n\n## License\n\nMIT","readmeTruncated":false}