@quenty/vector3utils 3.0.0 → 3.0.2-canary.216.1c1ac8b.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 +19 -0
- package/package.json +4 -4
- package/src/Shared/Vector3Utils.lua +9 -3
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,25 @@
|
|
|
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
|
+
## [3.0.2-canary.216.1c1ac8b.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/vector3utils@3.0.1...@quenty/vector3utils@3.0.2-canary.216.1c1ac8b.0) (2021-10-02)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* Add another way to get the angle between vectors with more numeric stability ([b8136d1](https://github.com/Quenty/NevermoreEngine/commit/b8136d107647c44730844fe2ea381e6c8b5c948c))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
## [3.0.1](https://github.com/Quenty/NevermoreEngine/compare/@quenty/vector3utils@3.0.0...@quenty/vector3utils@3.0.1) (2021-09-18)
|
|
18
|
+
|
|
19
|
+
**Note:** Version bump only for package @quenty/vector3utils
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
6
25
|
# [3.0.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/vector3utils@2.1.0...@quenty/vector3utils@3.0.0) (2021-09-11)
|
|
7
26
|
|
|
8
27
|
**Note:** Version bump only for package @quenty/vector3utils
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quenty/vector3utils",
|
|
3
|
-
"version": "3.0.0",
|
|
3
|
+
"version": "3.0.2-canary.216.1c1ac8b.0",
|
|
4
4
|
"description": "Utilities involving Vector3 objects in Roblox",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Roblox",
|
|
@@ -25,11 +25,11 @@
|
|
|
25
25
|
"Quenty"
|
|
26
26
|
],
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@quenty/loader": "
|
|
29
|
-
"@quenty/math": "
|
|
28
|
+
"@quenty/loader": "3.0.2-canary.216.1c1ac8b.0",
|
|
29
|
+
"@quenty/math": "2.0.0"
|
|
30
30
|
},
|
|
31
31
|
"publishConfig": {
|
|
32
32
|
"access": "public"
|
|
33
33
|
},
|
|
34
|
-
"gitHead": "
|
|
34
|
+
"gitHead": "1c1ac8b60f35fcaa134378dc1c8e75fd145a84f9"
|
|
35
35
|
}
|
|
@@ -15,12 +15,18 @@ function Vector3Utils.fromVector2XZ(vector2)
|
|
|
15
15
|
return Vector3.new(vector2.x, 0, vector2.y)
|
|
16
16
|
end
|
|
17
17
|
|
|
18
|
-
function Vector3Utils.getAngleRad(
|
|
19
|
-
if
|
|
18
|
+
function Vector3Utils.getAngleRad(a, b)
|
|
19
|
+
if a.magnitude == 0 then
|
|
20
20
|
return nil
|
|
21
21
|
end
|
|
22
22
|
|
|
23
|
-
return math.acos(
|
|
23
|
+
return math.acos(a:Dot(b))
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
function Vector3Utils.angleBetweenVectors(a, b)
|
|
27
|
+
local u = b.magnitude*a
|
|
28
|
+
local v = a.magnitude*b
|
|
29
|
+
return 2*math.atan2((v - u).magnitude, (u + v).magnitude)
|
|
24
30
|
end
|
|
25
31
|
|
|
26
32
|
function Vector3Utils.round(vector3, amount)
|