Skip to content

Commit

Permalink
Fix shake stability
Browse files Browse the repository at this point in the history
  • Loading branch information
Sleitnick committed Apr 22, 2024
1 parent 5b142be commit dde8b20
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
| [Quaternion](https://sleitnick.github.io/RbxUtil/api/Quaternion) | `Quaternion = "sleitnick/[email protected]"` | Quaternion class |
| [Sequent](https://sleitnick.github.io/RbxUtil/api/Sequent) | `Sequent = "sleitnick/[email protected]"` | Sequent class |
| [Ser](https://sleitnick.github.io/RbxUtil/api/Ser) | `Ser = "sleitnick/[email protected]"` | Ser class for serialization and deserialization |
| [Shake](https://sleitnick.github.io/RbxUtil/api/Shake) | `Shake = "sleitnick/shake@1.0.1"` | Shake class for making things shake |
| [Shake](https://sleitnick.github.io/RbxUtil/api/Shake) | `Shake = "sleitnick/shake@1.1.0"` | Shake class for making things shake |
| [Signal](https://sleitnick.github.io/RbxUtil/api/Signal) | `Signal = "sleitnick/[email protected]"` | Signal class |
| [Silo](https://sleitnick.github.io/RbxUtil/api/Silo) | `Silo = "sleitnick/[email protected]"` | State container class |
| [Streamable](https://sleitnick.github.io/RbxUtil/api/Streamable) | `Streamable = "sleitnick/[email protected]"` | Streamable class and StreamableUtil |
Expand Down
6 changes: 3 additions & 3 deletions modules/shake/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ local renderId = 0
-- Multiplies against the shake vector to control the final amplitude of the position.
-- Can be seen internally as: position = shakeVector * fadeInOut * positionInfluence
shake.PositionInfluence = Vector3.new(1, 1, 1)
shake.PositionInfluence = Vector3.one
-- Multiplies against the shake vector to control the final amplitude of the rotation.
-- Can be seen internally as: position = shakeVector * fadeInOut * rotationInfluence
Expand Down Expand Up @@ -215,7 +215,7 @@ function Shake.new(): Shake
self.RotationInfluence = Vector3.one
self.TimeFunction = if RunService:IsRunning() then time else os.clock

self._timeOffset = rng:NextNumber(-1e9, 1e9)
self._timeOffset = rng:NextNumber(-1e6, 1e6)
self._startTime = 0
self._running = false
self._signalConnections = {}
Expand Down Expand Up @@ -355,7 +355,7 @@ function Shake:Update(): (Vector3, Vector3, boolean)
local now = self.TimeFunction()
local dur = now - self._startTime

local noiseInput = ((now + self._timeOffset) / self.Frequency) % 1000000
local noiseInput = ((now + self._timeOffset) / self.Frequency) % 10000

local multiplierFadeIn = 1
local multiplierFadeOut = 1
Expand Down
2 changes: 1 addition & 1 deletion modules/shake/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@rbxutil/shake",
"version": "1.0.1",
"version": "1.1.0",
"main": "init.lua",
"repository": "github:Sleitnick/RbxUtil",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion modules/shake/wally.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "sleitnick/shake"
description = "Shake class for making things shake"
version = "1.0.1"
version = "1.1.0"
license = "MIT"
authors = ["Stephen Leitnick"]
registry = "https://github.com/UpliftGames/wally-index"
Expand Down

0 comments on commit dde8b20

Please sign in to comment.