@quenty/hintscoringutils 14.19.0 → 14.19.1
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 +8 -0
- package/package.json +7 -7
- package/src/Client/HintScoringUtils.lua +13 -13
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
|
+
## [14.19.1](https://github.com/Quenty/NevermoreEngine/compare/@quenty/hintscoringutils@14.19.0...@quenty/hintscoringutils@14.19.1) (2025-03-21)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @quenty/hintscoringutils
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
6
14
|
# [14.19.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/hintscoringutils@14.18.2...@quenty/hintscoringutils@14.19.0) (2025-02-18)
|
|
7
15
|
|
|
8
16
|
**Note:** Version bump only for package @quenty/hintscoringutils
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quenty/hintscoringutils",
|
|
3
|
-
"version": "14.19.
|
|
3
|
+
"version": "14.19.1",
|
|
4
4
|
"description": "Utility functions that let you score a proximity prompt (i.e. a Hint) based upon its relation to a character in 3D space.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Roblox",
|
|
@@ -26,18 +26,18 @@
|
|
|
26
26
|
"Quenty"
|
|
27
27
|
],
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@quenty/adorneeutils": "^3.3.
|
|
29
|
+
"@quenty/adorneeutils": "^3.3.1",
|
|
30
30
|
"@quenty/boundingboxutils": "^4.3.0",
|
|
31
|
-
"@quenty/camera": "^14.19.
|
|
32
|
-
"@quenty/draw": "^7.8.
|
|
31
|
+
"@quenty/camera": "^14.19.1",
|
|
32
|
+
"@quenty/draw": "^7.8.1",
|
|
33
33
|
"@quenty/loader": "^10.8.0",
|
|
34
34
|
"@quenty/maid": "^3.4.0",
|
|
35
|
-
"@quenty/math": "^2.7.
|
|
35
|
+
"@quenty/math": "^2.7.1",
|
|
36
36
|
"@quenty/region3utils": "^10.9.0",
|
|
37
|
-
"@quenty/vector3utils": "^10.8.
|
|
37
|
+
"@quenty/vector3utils": "^10.8.1"
|
|
38
38
|
},
|
|
39
39
|
"publishConfig": {
|
|
40
40
|
"access": "public"
|
|
41
41
|
},
|
|
42
|
-
"gitHead": "
|
|
42
|
+
"gitHead": "6b7c3e15e60cdb185986207b574e2b5591261e7a"
|
|
43
43
|
}
|
|
@@ -40,7 +40,7 @@ local HintScoringUtils = {}
|
|
|
40
40
|
@return Vector3? -- Position
|
|
41
41
|
@return Vector3? -- LookVector
|
|
42
42
|
]=]
|
|
43
|
-
function HintScoringUtils.getHumanoidPositionDirection(humanoid)
|
|
43
|
+
function HintScoringUtils.getHumanoidPositionDirection(humanoid: Humanoid)
|
|
44
44
|
local rootPart = humanoid.RootPart
|
|
45
45
|
if not rootPart then
|
|
46
46
|
return nil, nil
|
|
@@ -75,7 +75,7 @@ function HintScoringUtils.getAdorneeInRegionSet(position, radius, ignoreList, ge
|
|
|
75
75
|
end
|
|
76
76
|
|
|
77
77
|
if DEBUG_ENABLED then
|
|
78
|
-
--[=[
|
|
78
|
+
--[=[
|
|
79
79
|
Draws the score in debug mode
|
|
80
80
|
@param adornee Instance
|
|
81
81
|
@param score number
|
|
@@ -107,7 +107,7 @@ function HintScoringUtils.raycastToAdornee(raycaster, humanoidCenter, adornee, c
|
|
|
107
107
|
return nil
|
|
108
108
|
end
|
|
109
109
|
|
|
110
|
-
local ray = Ray.new(humanoidCenter, offset.unit*(offset.magnitude + extraDistance))
|
|
110
|
+
local ray = Ray.new(humanoidCenter, offset.unit * (offset.magnitude + extraDistance))
|
|
111
111
|
local hitData = raycaster:FindPartOnRay(ray)
|
|
112
112
|
|
|
113
113
|
if DEBUG_ENABLED then
|
|
@@ -151,7 +151,7 @@ end
|
|
|
151
151
|
@return Vector3? -- clamped point
|
|
152
152
|
@return Vector3? -- center of bounding box
|
|
153
153
|
]=]
|
|
154
|
-
function HintScoringUtils.clampToBoundingBox(adornee, humanoidCenter)
|
|
154
|
+
function HintScoringUtils.clampToBoundingBox(adornee: Instance, humanoidCenter: Vector3)
|
|
155
155
|
if adornee:IsA("Attachment") then
|
|
156
156
|
return adornee.WorldPosition, adornee.WorldPosition
|
|
157
157
|
end
|
|
@@ -186,7 +186,8 @@ function HintScoringUtils.scoreAdornee(
|
|
|
186
186
|
maxTriggerRadius,
|
|
187
187
|
maxViewAngle,
|
|
188
188
|
maxTriggerAngle,
|
|
189
|
-
isLineOfSightRequired
|
|
189
|
+
isLineOfSightRequired
|
|
190
|
+
)
|
|
190
191
|
assert(maxTriggerAngle, "Bad maxTriggerAngle")
|
|
191
192
|
|
|
192
193
|
-- local center = AdorneeUtils.getCenter(adornee)
|
|
@@ -206,13 +207,12 @@ function HintScoringUtils.scoreAdornee(
|
|
|
206
207
|
|
|
207
208
|
local extraDistance = 10
|
|
208
209
|
|
|
209
|
-
local closestPoint =
|
|
210
|
-
raycaster, humanoidCenter, adornee, boundingBoxPoint, extraDistance)
|
|
210
|
+
local closestPoint =
|
|
211
|
+
HintScoringUtils.raycastToAdornee(raycaster, humanoidCenter, adornee, boundingBoxPoint, extraDistance)
|
|
211
212
|
|
|
212
213
|
-- Round objects be sad
|
|
213
214
|
if not closestPoint then
|
|
214
|
-
closestPoint = HintScoringUtils.raycastToAdornee(
|
|
215
|
-
raycaster, humanoidCenter, adornee, center, 4)
|
|
215
|
+
closestPoint = HintScoringUtils.raycastToAdornee(raycaster, humanoidCenter, adornee, center, 4)
|
|
216
216
|
end
|
|
217
217
|
|
|
218
218
|
if not closestPoint then
|
|
@@ -228,7 +228,7 @@ function HintScoringUtils.scoreAdornee(
|
|
|
228
228
|
-- closestPoint = (closestPoint + boundingBoxPoint)/2 -- Weight this!
|
|
229
229
|
-- end
|
|
230
230
|
|
|
231
|
-
closestPoint = (boundingBoxPoint + center + closestPoint)/3
|
|
231
|
+
closestPoint = (boundingBoxPoint + center + closestPoint) / 3
|
|
232
232
|
|
|
233
233
|
if DEBUG_ENABLED then
|
|
234
234
|
debugMaid:GiveTask(Draw.point(closestPoint))
|
|
@@ -253,7 +253,7 @@ function HintScoringUtils.scoreAdornee(
|
|
|
253
253
|
return false
|
|
254
254
|
end
|
|
255
255
|
|
|
256
|
-
return (distScore + angleScore)/2
|
|
256
|
+
return (distScore + angleScore) / 2
|
|
257
257
|
end
|
|
258
258
|
|
|
259
259
|
--[=[
|
|
@@ -276,7 +276,7 @@ function HintScoringUtils.scoreDist(distance, maxViewDistance, maxTriggerRadius)
|
|
|
276
276
|
end
|
|
277
277
|
|
|
278
278
|
local inverseDistProportion = Math.map(distance, 0, maxTriggerRadius, 1, 0)
|
|
279
|
-
return inverseDistProportion*inverseDistProportion
|
|
279
|
+
return inverseDistProportion * inverseDistProportion
|
|
280
280
|
end
|
|
281
281
|
|
|
282
282
|
--[=[
|
|
@@ -300,4 +300,4 @@ function HintScoringUtils.scoreAngle(angle, maxViewAngle, maxTriggerAngle)
|
|
|
300
300
|
return Math.map(angle, 0, maxTriggerAngle, 1, 0)
|
|
301
301
|
end
|
|
302
302
|
|
|
303
|
-
return HintScoringUtils
|
|
303
|
+
return HintScoringUtils
|