@quenty/ik 5.2.0 → 5.3.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,22 @@
|
|
|
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
|
+
# [5.3.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/ik@5.2.1...@quenty/ik@5.3.0) (2022-01-17)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @quenty/ik
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## [5.2.1](https://github.com/Quenty/NevermoreEngine/compare/@quenty/ik@5.2.0...@quenty/ik@5.2.1) (2022-01-16)
|
|
15
|
+
|
|
16
|
+
**Note:** Version bump only for package @quenty/ik
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
6
22
|
# [5.2.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/ik@5.1.2...@quenty/ik@5.2.0) (2022-01-07)
|
|
7
23
|
|
|
8
24
|
**Note:** Version bump only for package @quenty/ik
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quenty/ik",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.3.0",
|
|
4
4
|
"description": "Inverse Kinematics for characters on Roblox",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Roblox",
|
|
@@ -26,27 +26,27 @@
|
|
|
26
26
|
"Quenty"
|
|
27
27
|
],
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@quenty/acceltween": "^2.0
|
|
30
|
-
"@quenty/baseobject": "^3.
|
|
31
|
-
"@quenty/binder": "^4.
|
|
32
|
-
"@quenty/camera": "^5.
|
|
33
|
-
"@quenty/characterutils": "^3.
|
|
34
|
-
"@quenty/humanoidtracker": "^3.
|
|
35
|
-
"@quenty/loader": "^3.
|
|
36
|
-
"@quenty/maid": "^2.0
|
|
29
|
+
"@quenty/acceltween": "^2.1.0",
|
|
30
|
+
"@quenty/baseobject": "^3.5.0",
|
|
31
|
+
"@quenty/binder": "^4.8.0",
|
|
32
|
+
"@quenty/camera": "^5.3.0",
|
|
33
|
+
"@quenty/characterutils": "^3.6.0",
|
|
34
|
+
"@quenty/humanoidtracker": "^3.8.0",
|
|
35
|
+
"@quenty/loader": "^3.4.0",
|
|
36
|
+
"@quenty/maid": "^2.1.0",
|
|
37
37
|
"@quenty/math": "^2.0.1",
|
|
38
|
-
"@quenty/promise": "^3.
|
|
39
|
-
"@quenty/ragdoll": "^5.
|
|
40
|
-
"@quenty/remoting": "^3.
|
|
41
|
-
"@quenty/servicebag": "^3.
|
|
38
|
+
"@quenty/promise": "^3.6.0",
|
|
39
|
+
"@quenty/ragdoll": "^5.3.0",
|
|
40
|
+
"@quenty/remoting": "^3.6.0",
|
|
41
|
+
"@quenty/servicebag": "^3.5.0",
|
|
42
42
|
"@quenty/signal": "^2.1.0",
|
|
43
43
|
"@quenty/table": "^2.1.1"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
|
-
"@quenty/rigbuilderutils": "^3.
|
|
46
|
+
"@quenty/rigbuilderutils": "^3.6.0"
|
|
47
47
|
},
|
|
48
48
|
"publishConfig": {
|
|
49
49
|
"access": "public"
|
|
50
50
|
},
|
|
51
|
-
"gitHead": "
|
|
51
|
+
"gitHead": "c094ba8f4e128cdff08919d89de226d3d65247ce"
|
|
52
52
|
}
|
|
@@ -19,6 +19,15 @@ local IKRigAimerLocalPlayer = setmetatable({}, BaseObject)
|
|
|
19
19
|
IKRigAimerLocalPlayer.ClassName = "IKRigAimerLocalPlayer"
|
|
20
20
|
IKRigAimerLocalPlayer.__index = IKRigAimerLocalPlayer
|
|
21
21
|
|
|
22
|
+
--[=[
|
|
23
|
+
Constructs a new IKRigAimerLocalPlayer. Should not be used directly.
|
|
24
|
+
See [IKServiceClient] for the correct usage.
|
|
25
|
+
|
|
26
|
+
@param serviceBag ServiceBag
|
|
27
|
+
@param ikRig IKRigClient
|
|
28
|
+
@param remoteEvent RemoteEvent
|
|
29
|
+
@return IKRigAimerLocalPlayer
|
|
30
|
+
]=]
|
|
22
31
|
function IKRigAimerLocalPlayer.new(serviceBag, ikRig, remoteEvent)
|
|
23
32
|
local self = setmetatable(BaseObject.new(), IKRigAimerLocalPlayer)
|
|
24
33
|
|
|
@@ -34,15 +43,26 @@ function IKRigAimerLocalPlayer.new(serviceBag, ikRig, remoteEvent)
|
|
|
34
43
|
return self
|
|
35
44
|
end
|
|
36
45
|
|
|
46
|
+
--[=[
|
|
47
|
+
Sets whether the local player should look around automatically.
|
|
48
|
+
@param lookAround boolean
|
|
49
|
+
]=]
|
|
37
50
|
function IKRigAimerLocalPlayer:SetLookAround(lookAround)
|
|
51
|
+
assert(type(lookAround) == "boolean", "Bad lookAround")
|
|
52
|
+
|
|
38
53
|
self._lookAround = lookAround
|
|
39
54
|
end
|
|
40
55
|
|
|
41
|
-
--
|
|
56
|
+
--[=[
|
|
57
|
+
Sets the aim position for the local player for this frame. See [IKAimPositionPriorites].
|
|
58
|
+
|
|
59
|
+
@param position Vector3? -- May be nil to say to aim at nothing
|
|
60
|
+
@param optionalPriority number
|
|
61
|
+
]=]
|
|
42
62
|
function IKRigAimerLocalPlayer:SetAimPosition(position, optionalPriority)
|
|
43
63
|
optionalPriority = optionalPriority or IKAimPositionPriorites.DEFAULT
|
|
44
64
|
|
|
45
|
-
if self._aimData and (
|
|
65
|
+
if self._aimData and (os.clock() - self._aimData.timeStamp) < MAX_AGE_FOR_AIM_DATA then
|
|
46
66
|
if self._aimData.priority > optionalPriority then
|
|
47
67
|
return -- Don't overwrite
|
|
48
68
|
end
|
|
@@ -51,12 +71,16 @@ function IKRigAimerLocalPlayer:SetAimPosition(position, optionalPriority)
|
|
|
51
71
|
self._aimData = {
|
|
52
72
|
priority = optionalPriority;
|
|
53
73
|
position = position; -- May be nil
|
|
54
|
-
timeStamp =
|
|
74
|
+
timeStamp = os.clock();
|
|
55
75
|
}
|
|
56
76
|
end
|
|
57
77
|
|
|
78
|
+
--[=[
|
|
79
|
+
Gets the current aim direction.
|
|
80
|
+
@return Vector3?
|
|
81
|
+
]=]
|
|
58
82
|
function IKRigAimerLocalPlayer:GetAimDirection()
|
|
59
|
-
if self._aimData and (
|
|
83
|
+
if self._aimData and (os.clock() - self._aimData.timeStamp) < MAX_AGE_FOR_AIM_DATA then
|
|
60
84
|
-- If we have aim data within the last 0.2 seconds start pointing at that
|
|
61
85
|
return self._aimData.position -- May be nil
|
|
62
86
|
end
|
|
@@ -88,23 +112,26 @@ function IKRigAimerLocalPlayer:GetAimDirection()
|
|
|
88
112
|
return cameraCFrame.p + direction
|
|
89
113
|
end
|
|
90
114
|
|
|
91
|
-
|
|
115
|
+
--[=[
|
|
116
|
+
Updates the aimer on stepped.
|
|
117
|
+
@private
|
|
118
|
+
]=]
|
|
92
119
|
function IKRigAimerLocalPlayer:UpdateStepped()
|
|
93
|
-
if (
|
|
120
|
+
if (os.clock() - self._lastUpdate) <= 0.05 then
|
|
94
121
|
return
|
|
95
122
|
end
|
|
96
123
|
|
|
97
124
|
local aimDirection = self:GetAimDirection()
|
|
98
125
|
|
|
99
|
-
self._lastUpdate =
|
|
126
|
+
self._lastUpdate = os.clock()
|
|
100
127
|
local torso = self._ikRig:GetTorso()
|
|
101
128
|
if torso then
|
|
102
129
|
torso:Point(aimDirection)
|
|
103
130
|
end
|
|
104
131
|
|
|
105
132
|
-- Filter replicate
|
|
106
|
-
if (
|
|
107
|
-
self._lastReplication =
|
|
133
|
+
if (os.clock() - self._lastReplication) > REPLICATION_RATE then
|
|
134
|
+
self._lastReplication = os.clock()
|
|
108
135
|
self._remoteEvent:FireServer(aimDirection)
|
|
109
136
|
end
|
|
110
137
|
end
|