Update changelog and document Translate#nudge

This commit is contained in:
Jozufozu 2022-01-25 10:12:08 -08:00
parent e6368b291f
commit 831c9b9e47
2 changed files with 19 additions and 2 deletions

View file

@ -1,3 +1,15 @@
0.6.0:
With this release, Flywheel is no longer needed on servers! Forge finally has client commands,
and the /flywheel command now takes advantage of this.
Fixes
- Fix crash when running with sodium/magnesium.
Technical/API
- Backend is now a static class.
- Shaders are now compiled on-the-fly and cached.
- Significantly reduced the amount of boilerplate needed in instancing shaders.
- Struct types no longer need to be registered ahead of time.
- Simplify unnecessarily complicated game state system.
0.5.1: 0.5.1:
Fixes Fixes
- Fix crash on resource reload with backend off - Fix crash on resource reload with backend off

View file

@ -56,8 +56,13 @@ public interface Translate<Self> {
return translate(-vec.getX(), -vec.getY(), -vec.getZ()); return translate(-vec.getX(), -vec.getY(), -vec.getZ());
} }
default Self nudge(int id) { /**
long randomBits = (long) id * 31L * 493286711L; * Translates this object randomly by a very small amount.
* @param seed The seed to use to generate the random offsets.
* @return {@code this}
*/
default Self nudge(int seed) {
long randomBits = (long) seed * 31L * 493286711L;
randomBits = randomBits * randomBits * 4392167121L + randomBits * 98761L; randomBits = randomBits * randomBits * 4392167121L + randomBits * 98761L;
float xNudge = (((float) (randomBits >> 16 & 7L) + 0.5F) / 8.0F - 0.5F) * 0.004F; float xNudge = (((float) (randomBits >> 16 & 7L) + 0.5F) / 8.0F - 0.5F) * 0.004F;
float yNudge = (((float) (randomBits >> 20 & 7L) + 0.5F) / 8.0F - 0.5F) * 0.004F; float yNudge = (((float) (randomBits >> 20 & 7L) + 0.5F) / 8.0F - 0.5F) * 0.004F;