@quenty/trajectory 2.8.0 → 2.9.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,14 @@
|
|
|
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
|
+
# [2.9.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/trajectory@2.8.0...@quenty/trajectory@2.9.0) (2025-07-11)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @quenty/trajectory
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
6
14
|
# [2.8.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/trajectory@2.7.4...@quenty/trajectory@2.8.0) (2025-05-10)
|
|
7
15
|
|
|
8
16
|
**Note:** Version bump only for package @quenty/trajectory
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quenty/trajectory",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.9.0",
|
|
4
4
|
"description": "Utility function for estimating low and high arcs of projectiles. Solves for bullet drop given",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Roblox",
|
|
@@ -32,5 +32,5 @@
|
|
|
32
32
|
"@quenty/draw": "^7.9.0",
|
|
33
33
|
"@quenty/loader": "^10.9.0"
|
|
34
34
|
},
|
|
35
|
-
"gitHead": "
|
|
35
|
+
"gitHead": "b2387bbbc347e784216a6e9e2d1abefd23c1d375"
|
|
36
36
|
}
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
local require = require(script.Parent.loader).load(script)
|
|
7
7
|
|
|
8
8
|
local Draw = require("Draw")
|
|
9
|
+
local Maid = require("Maid")
|
|
9
10
|
local MinEntranceVelocityUtils = require("MinEntranceVelocityUtils")
|
|
10
11
|
|
|
11
12
|
local ORIGIN_COLOR = Color3.new(0, 1, 0)
|
|
@@ -16,9 +17,11 @@ local TrajectoryDrawUtils = {}
|
|
|
16
17
|
--[=[
|
|
17
18
|
Draws a trajectory out for debugging purposes
|
|
18
19
|
]=]
|
|
19
|
-
function TrajectoryDrawUtils.draw(velocity: Vector3, origin: Vector3, target: Vector3, accel: Vector3):
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
function TrajectoryDrawUtils.draw(velocity: Vector3, origin: Vector3, target: Vector3, accel: Vector3): Maid.MaidTask
|
|
21
|
+
local maid = Maid.new()
|
|
22
|
+
|
|
23
|
+
maid:GiveTask(Draw.point(origin, ORIGIN_COLOR))
|
|
24
|
+
maid:GiveTask(Draw.point(target, FINISH_COLOR))
|
|
22
25
|
|
|
23
26
|
local entranceTime = MinEntranceVelocityUtils.computeEntranceTime(velocity, origin, target, accel)
|
|
24
27
|
|
|
@@ -30,8 +33,10 @@ function TrajectoryDrawUtils.draw(velocity: Vector3, origin: Vector3, target: Ve
|
|
|
30
33
|
local p1 = origin + velocity * t1 + 0.5 * accel * t1 * t1
|
|
31
34
|
|
|
32
35
|
local percent = t / entranceTime
|
|
33
|
-
Draw.line(p0, p1, ORIGIN_COLOR:Lerp(FINISH_COLOR, percent))
|
|
36
|
+
maid:GiveTask(Draw.line(p0, p1, ORIGIN_COLOR:Lerp(FINISH_COLOR, percent)))
|
|
34
37
|
end
|
|
38
|
+
|
|
39
|
+
return maid
|
|
35
40
|
end
|
|
36
41
|
|
|
37
42
|
return TrajectoryDrawUtils
|