search/
Start typing to search packages!
package_2
gerstner
By @superdupernairobi
Roblox
Mirrored from Wally[image: Gerstner logo]
Gerstner
Pure Gerstner wave displacement for Roblox. One module and no Instances, no states. It takes wave definitions and returns surface positions.
Install
Wally:
[dependencies]
Gerstner = "superdupernairobi/gerstner@0.1.0"
Quickstart
local gerstner = require(game.ReplicatedStorage.gerstner)
local prepared = gerstner.prepare({
{ wavelength = 40, amplitude = 2, steepness = 0.5, direction = Vector2.new(1, 0) },
{ wavelength = 70, amplitude = 3, steepness = 0.4, direction = Vector2.new(0.7, 0.7) },
})
local position = gerstner.displace(prepared, x, z, t) -- Vector3
prepare validates and precomputes ONCE. displace is the hot path, call it PER vertex, per frame, against the same prepared value
Notes
- Studs.
Gis196.2studs/s^2, matching a scale of 20 studs per metre yis relative to the water plane.displacereturns absolute X and Z, butyis measured from the planes own level, so your renderer adds sea level- Reuse ONE
preparedvalue. Never callprepareinside an update loop - Buoyancy is an APPROXIMATION. Gerstner displaces horizontally, so "surface height at world (x, z)" is an inverse problem. Sampling
displace(x,z)and takingyis a good approximation, not an exact answer. If you use it for physics, keep the authoritative lookup on the server
API
prepare, displace, Wave, Prepared - see the API ref
License
MIT
Package Details
Install command (Click to copy)
Version
0.1.1
License
MIT
Safe for commercial use
Automated license review — not legal advice.
