@quenty/inputobjectutils 3.0.0 → 3.0.1-canary.38bdfe3.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
+ ## [3.0.1-canary.38bdfe3.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/inputobjectutils@3.0.0...@quenty/inputobjectutils@3.0.1-canary.38bdfe3.0) (2022-09-07)
7
+
8
+
9
+ ### Features
10
+
11
+ * Support Vector2 and Vector3 in InputObjectRayUtils ([8843d02](https://github.com/Quenty/NevermoreEngine/commit/8843d02fd1c4e7aa6fee4cbd9cd1cafe076ca7ef))
12
+
13
+
14
+
15
+
16
+
6
17
  # [3.0.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/inputobjectutils@2.1.0...@quenty/inputobjectutils@3.0.0) (2022-05-21)
7
18
 
8
19
  **Note:** Version bump only for package @quenty/inputobjectutils
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quenty/inputobjectutils",
3
- "version": "3.0.0",
3
+ "version": "3.0.1-canary.38bdfe3.0",
4
4
  "description": "Provides utility functions involving input objects",
5
5
  "keywords": [
6
6
  "Roblox",
@@ -27,5 +27,5 @@
27
27
  "publishConfig": {
28
28
  "access": "public"
29
29
  },
30
- "gitHead": "9f7eaea7543c33c89d2e32c38491b13f9271f4f7"
30
+ "gitHead": "38bdfe3721bddf1d272628b1104b1d8e0abaf24f"
31
31
  }
@@ -13,7 +13,7 @@ local InputObjectRayUtils = {}
13
13
  Computes a camera ray from an inputObject
14
14
  @param inputObject InputObject
15
15
  @param distance number
16
- @param offset Vector3? -- Optional
16
+ @param offset Vector3 | Vector2 | nil -- Optional
17
17
  @param camera Camera? -- Optional
18
18
  @return Ray
19
19
  ]=]
@@ -21,14 +21,15 @@ function InputObjectRayUtils.cameraRayFromInputObject(inputObject, distance, off
21
21
  assert(inputObject, "Bad inputObject")
22
22
  offset = offset or Vector3.new()
23
23
 
24
- return InputObjectRayUtils.cameraRayFromScreenPosition(inputObject.Position + offset, distance, camera)
24
+ local position = inputObject.Position
25
+ return InputObjectRayUtils.cameraRayFromScreenPosition(Vector2.new(position.x + offset.x, position.y + offset.y), distance, camera)
25
26
  end
26
27
 
27
28
  --[=[
28
29
  Computes a camera ray from the mouse
29
30
  @param mouse Mouse
30
31
  @param distance number
31
- @param offset Vector3? -- Optional
32
+ @param offset Vector3 | Vector2 | nil -- Optional
32
33
  @param camera Camera? -- Optional
33
34
  @return Ray
34
35
  ]=]
@@ -45,21 +46,22 @@ end
45
46
  --[=[
46
47
  @param inputObject InputObject
47
48
  @param distance number? -- Optional
48
- @param offset Vector3
49
+ @param offset Vector3 | Vector2
49
50
  @param camera Camera? -- Optional
50
51
  @return Ray
51
52
  ]=]
52
53
  function InputObjectRayUtils.cameraRayFromInputObjectWithOffset(inputObject, distance, offset, camera)
53
54
  assert(inputObject, "Bad inputObject")
54
55
 
56
+ local position = inputObject.Position
55
57
  return InputObjectRayUtils.cameraRayFromScreenPosition(
56
- inputObject.Position + offset,
58
+ Vector2.new(position.x + offset.x, position.y + offset.y),
57
59
  distance,
58
60
  camera)
59
61
  end
60
62
 
61
63
  --[=[
62
- @param position Vector3
64
+ @param position Vector3 | Vector2
63
65
  @param distance number? -- Optional
64
66
  @param camera Camera? -- Optional
65
67
  @return Ray
@@ -73,7 +75,7 @@ function InputObjectRayUtils.cameraRayFromScreenPosition(position, distance, cam
73
75
  end
74
76
 
75
77
  --[=[
76
- @param position Vector3
78
+ @param position Vector3 | Vector2
77
79
  @param distance number? -- Optional
78
80
  @param camera Camera? -- Optional
79
81
  @return Ray