@quenty/spring 10.0.0 → 10.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,17 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [10.1.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/spring@10.0.0...@quenty/spring@10.1.0) (2024-03-09)
7
+
8
+
9
+ ### Features
10
+
11
+ * Add Spring:SetTarget() ([090b4f5](https://github.com/Quenty/NevermoreEngine/commit/090b4f556340d44cde333a149a8f1d240437f758))
12
+
13
+
14
+
15
+
16
+
6
17
  # [10.0.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/spring@9.0.0...@quenty/spring@10.0.0) (2024-02-14)
7
18
 
8
19
  **Note:** Version bump only for package @quenty/spring
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quenty/spring",
3
- "version": "10.0.0",
3
+ "version": "10.1.0",
4
4
  "description": "Spring implementation for Roblox",
5
5
  "keywords": [
6
6
  "Roblox",
@@ -29,8 +29,8 @@
29
29
  "access": "public"
30
30
  },
31
31
  "dependencies": {
32
- "@quenty/ducktype": "^5.0.0",
33
- "@quenty/loader": "^10.0.0"
32
+ "@quenty/ducktype": "^5.1.0",
33
+ "@quenty/loader": "^10.1.0"
34
34
  },
35
- "gitHead": "63f949a67b77d3edc98b358cace163da8c789e9f"
35
+ "gitHead": "e0148dde5ca3864389a0faa2da66153a776acc1e"
36
36
  }
@@ -84,6 +84,24 @@ function Spring:TimeSkip(delta)
84
84
  self._time0 = now
85
85
  end
86
86
 
87
+ --[=[
88
+ Sets the actual target. If doNotAnimate is set, then animation will be skipped.
89
+
90
+ @param value T -- The target to set
91
+ @param doNotAnimate boolean? -- Whether or not to animate
92
+ ]=]
93
+ function Spring:SetTarget(value, doNotAnimate)
94
+ if doNotAnimate then
95
+ local now = self._clock()
96
+ self._position0 = value
97
+ self._velocity0 = 0*value
98
+ self._target = value
99
+ self._time0 = now
100
+ else
101
+ self.Target = value
102
+ end
103
+ end
104
+
87
105
  --[=[
88
106
  The current position at the given clock time. Assigning the position will change the spring to have that position.
89
107