@quenty/ragdoll 15.23.4-canary.559.339cfa7.0 → 15.24.0-canary.0a5db80.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 +2 -10
- package/package.json +31 -31
- package/src/Client/Classes/RagdollCameraShakeClient.lua +64 -72
- package/src/Client/Classes/RagdollClient.lua +2 -1
- package/src/Client/Classes/RagdollHumanoidOnDeathClient.lua +2 -2
- package/src/Client/Classes/RagdollHumanoidOnFallClient.lua +1 -1
- package/src/Client/Classes/RagdollableClient.lua +5 -5
- package/src/Client/RagdollBindersClient.lua +5 -5
- package/src/Client/RagdollServiceClient.lua +1 -1
- package/src/Server/Classes/Ragdoll.lua +1 -1
- package/src/Server/Classes/RagdollCameraShake.lua +3 -2
- package/src/Server/Classes/RagdollHumanoidOnDeath.lua +2 -2
- package/src/Server/Classes/RagdollHumanoidOnFall.lua +2 -1
- package/src/Server/Classes/Ragdollable.lua +7 -7
- package/src/Server/Classes/UnragdollAutomatically.lua +35 -37
- package/src/Server/Classes/UnragdollAutomaticallyConstants.lua +3 -3
- package/src/Server/RagdollBindersServer.lua +6 -6
- package/src/Server/RagdollService.lua +1 -1
- package/src/Shared/Classes/BindableRagdollHumanoidOnFall.lua +5 -3
- package/src/Shared/Classes/RagdollHumanoidOnFallConstants.lua +2 -2
- package/src/Shared/Classes/RagdollableBase.lua +1 -1
- package/src/Shared/Interfaces/RagdollableInterface.lua +8 -7
- package/src/Shared/RagdollServiceConstants.lua +2 -2
- package/src/Shared/Rigging/RagdollAdditionalAttachmentUtils.lua +22 -44
- package/src/Shared/Rigging/RagdollBallSocketUtils.lua +163 -163
- package/src/Shared/Rigging/RagdollCollisionUtils.lua +61 -60
- package/src/Shared/Rigging/RagdollMotorData.lua +3 -3
- package/src/Shared/Rigging/RagdollMotorLimitData.lua +78 -78
- package/src/Shared/Rigging/RagdollMotorUtils.lua +2 -2
- package/src/Shared/Rigging/RxRagdollUtils.lua +3 -3
|
@@ -7,6 +7,6 @@ local require = require(script.Parent.loader).load(script)
|
|
|
7
7
|
local Table = require("Table")
|
|
8
8
|
|
|
9
9
|
return Table.readonly({
|
|
10
|
-
UNRAGDOLL_AUTOMATICALLY_ATTRIBUTE = "UnragdollAutomatically"
|
|
11
|
-
UNRAGDOLL_AUTOMATIC_TIME_ATTRIBUTE = "UnragdollAutomaticTime"
|
|
12
|
-
})
|
|
10
|
+
UNRAGDOLL_AUTOMATICALLY_ATTRIBUTE = "UnragdollAutomatically";
|
|
11
|
+
UNRAGDOLL_AUTOMATIC_TIME_ATTRIBUTE = "UnragdollAutomaticTime";
|
|
12
|
+
})
|
|
@@ -16,7 +16,7 @@ local require = require(script.Parent.loader).load(script)
|
|
|
16
16
|
local BinderProvider = require("BinderProvider")
|
|
17
17
|
|
|
18
18
|
return BinderProvider.new(script.Name, function(self, serviceBag)
|
|
19
|
-
|
|
19
|
+
--[=[
|
|
20
20
|
Apply this [Binder] to a humanoid to ragdoll it. Humanoid must already have [Ragdollable] defined.
|
|
21
21
|
|
|
22
22
|
```lua
|
|
@@ -57,31 +57,31 @@ return BinderProvider.new(script.Name, function(self, serviceBag)
|
|
|
57
57
|
]=]
|
|
58
58
|
self:Add(serviceBag:GetService(require("Ragdoll")))
|
|
59
59
|
|
|
60
|
-
|
|
60
|
+
--[=[
|
|
61
61
|
Enables ragdolling on a humanoid.
|
|
62
62
|
@prop Ragdollable PlayerHumanoidBinder<Ragdollable>
|
|
63
63
|
@within RagdollBindersServer
|
|
64
64
|
]=]
|
|
65
65
|
self:Add(serviceBag:GetService(require("Ragdollable")))
|
|
66
66
|
|
|
67
|
-
|
|
67
|
+
--[=[
|
|
68
68
|
Automatically applies ragdoll upon humanoid death.
|
|
69
69
|
@prop RagdollHumanoidOnDeath PlayerHumanoidBinder<RagdollHumanoidOnDeath>
|
|
70
70
|
@within RagdollBindersServer
|
|
71
71
|
]=]
|
|
72
72
|
self:Add(serviceBag:GetService(require("RagdollHumanoidOnDeath")))
|
|
73
73
|
|
|
74
|
-
|
|
74
|
+
--[=[
|
|
75
75
|
Automatically applies ragdoll upon humanoid fall.
|
|
76
76
|
@prop RagdollHumanoidOnFall PlayerHumanoidBinder<RagdollHumanoidOnFall>
|
|
77
77
|
@within RagdollBindersServer
|
|
78
78
|
]=]
|
|
79
79
|
self:Add(serviceBag:GetService(require("RagdollHumanoidOnFall")))
|
|
80
80
|
|
|
81
|
-
|
|
81
|
+
--[=[
|
|
82
82
|
Automatically unragdolls the humanoid.
|
|
83
83
|
@prop UnragdollAutomatically PlayerHumanoidBinder<UnragdollAutomatically>
|
|
84
84
|
@within RagdollBindersServer
|
|
85
85
|
]=]
|
|
86
86
|
self:Add(serviceBag:GetService(require("UnragdollAutomatically")))
|
|
87
|
-
end)
|
|
87
|
+
end)
|
|
@@ -42,7 +42,7 @@ function BindableRagdollHumanoidOnFall.new(humanoid, ragdollBinder)
|
|
|
42
42
|
end)
|
|
43
43
|
|
|
44
44
|
task.spawn(function()
|
|
45
|
-
task.wait(math.random()
|
|
45
|
+
task.wait(math.random()*FRAME_TIME) -- Apply jitter
|
|
46
46
|
while alive do
|
|
47
47
|
self:_updateVelocity()
|
|
48
48
|
task.wait(FRAME_TIME)
|
|
@@ -152,10 +152,12 @@ function BindableRagdollHumanoidOnFall:_updateVelocity()
|
|
|
152
152
|
end
|
|
153
153
|
|
|
154
154
|
local currentState = self._obj:GetState()
|
|
155
|
-
if currentState == Enum.HumanoidStateType.Physics
|
|
155
|
+
if currentState == Enum.HumanoidStateType.Physics
|
|
156
|
+
or currentState == Enum.HumanoidStateType.Swimming then
|
|
156
157
|
return
|
|
157
158
|
end
|
|
158
159
|
|
|
160
|
+
|
|
159
161
|
if (os.clock() - self._lastRagDollTime) <= RAGDOLL_DEBOUNCE_TIME then
|
|
160
162
|
return
|
|
161
163
|
end
|
|
@@ -163,4 +165,4 @@ function BindableRagdollHumanoidOnFall:_updateVelocity()
|
|
|
163
165
|
self:_ragdollFromFall()
|
|
164
166
|
end
|
|
165
167
|
|
|
166
|
-
return BindableRagdollHumanoidOnFall
|
|
168
|
+
return BindableRagdollHumanoidOnFall
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
local require = require(script.Parent.loader).load(script)
|
|
6
6
|
|
|
7
7
|
local BaseObject = require("BaseObject")
|
|
8
|
-
local Rx = require("Rx")
|
|
9
8
|
local RxSignal = require("RxSignal")
|
|
9
|
+
local Rx = require("Rx")
|
|
10
10
|
|
|
11
11
|
local RagdollableBase = setmetatable({}, BaseObject)
|
|
12
12
|
RagdollableBase.ClassName = "RagdollableBase"
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
|
|
1
2
|
--[=[
|
|
2
3
|
@class RagdollableInterface
|
|
3
4
|
]=]
|
|
@@ -7,11 +8,11 @@ local require = require(script.Parent.loader).load(script)
|
|
|
7
8
|
local TieDefinition = require("TieDefinition")
|
|
8
9
|
|
|
9
10
|
return TieDefinition.new("Ragdollable", {
|
|
10
|
-
Ragdolled = TieDefinition.Types.SIGNAL
|
|
11
|
-
Unragdolled = TieDefinition.Types.SIGNAL
|
|
11
|
+
Ragdolled = TieDefinition.Types.SIGNAL;
|
|
12
|
+
Unragdolled = TieDefinition.Types.SIGNAL;
|
|
12
13
|
|
|
13
|
-
Ragdoll = TieDefinition.Types.METHOD
|
|
14
|
-
Unragdoll = TieDefinition.Types.METHOD
|
|
15
|
-
ObserveIsRagdolled = TieDefinition.Types.METHOD
|
|
16
|
-
IsRagdolled = TieDefinition.Types.METHOD
|
|
17
|
-
})
|
|
14
|
+
Ragdoll = TieDefinition.Types.METHOD;
|
|
15
|
+
Unragdoll = TieDefinition.Types.METHOD;
|
|
16
|
+
ObserveIsRagdolled = TieDefinition.Types.METHOD;
|
|
17
|
+
IsRagdolled = TieDefinition.Types.METHOD;
|
|
18
|
+
})
|
|
@@ -7,8 +7,8 @@ local require = require(script.Parent.loader).load(script)
|
|
|
7
7
|
local EnumUtils = require("EnumUtils")
|
|
8
8
|
local Maid = require("Maid")
|
|
9
9
|
local RxBrioUtils = require("RxBrioUtils")
|
|
10
|
-
local RxInstanceUtils = require("RxInstanceUtils")
|
|
11
10
|
local RxR15Utils = require("RxR15Utils")
|
|
11
|
+
local RxInstanceUtils = require("RxInstanceUtils")
|
|
12
12
|
|
|
13
13
|
local RagdollAdditionalAttachmentUtils = {}
|
|
14
14
|
|
|
@@ -23,47 +23,27 @@ local V3_LEFT = Vector3.new(-1, 0, 0)
|
|
|
23
23
|
-- of non-ideal axis orientation, but it's not as noticable there since the limits for natural
|
|
24
24
|
-- motion are tighter for those joints anyway.
|
|
25
25
|
local R15_ADDITIONAL_ATTACHMENTS = {
|
|
26
|
-
{
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
"RightShoulderRigAttachment",
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
"RightUpperArm",
|
|
34
|
-
"RightShoulderRagdollAttachment",
|
|
35
|
-
CFrame.fromMatrix(V3_ZERO, V3_DOWN, V3_RIGHT),
|
|
36
|
-
"RightShoulderRigAttachment",
|
|
37
|
-
},
|
|
38
|
-
{
|
|
39
|
-
"UpperTorso",
|
|
40
|
-
"LeftShoulderRagdollAttachment",
|
|
41
|
-
CFrame.fromMatrix(V3_ZERO, V3_LEFT, V3_UP),
|
|
42
|
-
"LeftShoulderRigAttachment",
|
|
43
|
-
},
|
|
44
|
-
{
|
|
45
|
-
"LeftUpperArm",
|
|
46
|
-
"LeftShoulderRagdollAttachment",
|
|
47
|
-
CFrame.fromMatrix(V3_ZERO, V3_DOWN, V3_LEFT),
|
|
48
|
-
"LeftShoulderRigAttachment",
|
|
49
|
-
},
|
|
26
|
+
{"UpperTorso", "RightShoulderRagdollAttachment", CFrame.fromMatrix(V3_ZERO, V3_RIGHT, V3_UP), "RightShoulderRigAttachment"},
|
|
27
|
+
{"RightUpperArm", "RightShoulderRagdollAttachment", CFrame.fromMatrix(V3_ZERO, V3_DOWN, V3_RIGHT), "RightShoulderRigAttachment"},
|
|
28
|
+
{"UpperTorso", "LeftShoulderRagdollAttachment", CFrame.fromMatrix(V3_ZERO, V3_LEFT, V3_UP), "LeftShoulderRigAttachment"},
|
|
29
|
+
{"LeftUpperArm", "LeftShoulderRagdollAttachment", CFrame.fromMatrix(V3_ZERO, V3_DOWN, V3_LEFT), "LeftShoulderRigAttachment"},
|
|
50
30
|
}
|
|
51
31
|
|
|
52
32
|
local R6_ADDITIONAL_ATTACHMENTS = {
|
|
53
|
-
{
|
|
54
|
-
{
|
|
33
|
+
{"Head", "NeckAttachment", CFrame.new(0, -0.5, 0)},
|
|
34
|
+
{"Torso", "NeckAttachment", CFrame.new(0, 1, 0)},
|
|
55
35
|
|
|
56
|
-
{
|
|
57
|
-
{
|
|
36
|
+
{"Torso", "RightShoulderRagdollAttachment", CFrame.fromMatrix(Vector3.new(1, 0.5, 0), V3_RIGHT, V3_UP)},
|
|
37
|
+
{"Right Arm", "RightShoulderRagdollAttachment", CFrame.fromMatrix(Vector3.new(-0.5, 0.5, 0), V3_DOWN, V3_RIGHT)},
|
|
58
38
|
|
|
59
|
-
{
|
|
60
|
-
{
|
|
39
|
+
{"Torso", "LeftShoulderRagdollAttachment", CFrame.fromMatrix(Vector3.new(-1, 0.5, 0), V3_LEFT, V3_UP)},
|
|
40
|
+
{"Left Arm", "LeftShoulderRagdollAttachment", CFrame.fromMatrix(Vector3.new(0.5, 0.5, 0), V3_DOWN, V3_LEFT)},
|
|
61
41
|
|
|
62
|
-
{
|
|
63
|
-
{
|
|
42
|
+
{"Torso", "RightHipAttachment", CFrame.new(0.5, -1, 0)},
|
|
43
|
+
{"Right Leg", "RightHipAttachment", CFrame.new(0, 1, 0)},
|
|
64
44
|
|
|
65
|
-
{
|
|
66
|
-
{
|
|
45
|
+
{"Torso", "LeftHipAttachment", CFrame.new(-0.5, -1, 0)},
|
|
46
|
+
{"Left Leg", "LeftHipAttachment", CFrame.new(0, 1, 0)},
|
|
67
47
|
}
|
|
68
48
|
|
|
69
49
|
function RagdollAdditionalAttachmentUtils.getAdditionalAttachmentData(rigType)
|
|
@@ -87,8 +67,8 @@ function RagdollAdditionalAttachmentUtils.ensureAdditionalAttachments(character,
|
|
|
87
67
|
|
|
88
68
|
if baseAttachmentName then
|
|
89
69
|
local observable = RxBrioUtils.flatCombineLatest({
|
|
90
|
-
part = RxR15Utils.observeCharacterPartBrio(character, partName)
|
|
91
|
-
baseAttachment = RxR15Utils.observeRigAttachmentBrio(character, partName, baseAttachmentName)
|
|
70
|
+
part = RxR15Utils.observeCharacterPartBrio(character, partName);
|
|
71
|
+
baseAttachment = RxR15Utils.observeRigAttachmentBrio(character, partName, baseAttachmentName);
|
|
92
72
|
})
|
|
93
73
|
|
|
94
74
|
topMaid:GiveTask(observable:Subscribe(function(state)
|
|
@@ -98,12 +78,10 @@ function RagdollAdditionalAttachmentUtils.ensureAdditionalAttachments(character,
|
|
|
98
78
|
local attachment = Instance.new("Attachment")
|
|
99
79
|
attachment.Name = attachmentName
|
|
100
80
|
|
|
101
|
-
maid:GiveTask(
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
end)
|
|
106
|
-
)
|
|
81
|
+
maid:GiveTask(RxInstanceUtils.observeProperty(state.baseAttachment, "CFrame"):Subscribe(function(baseCFrame)
|
|
82
|
+
attachment.CFrame = baseCFrame * cframe
|
|
83
|
+
attachment.Parent = state.part -- event ordering...
|
|
84
|
+
end))
|
|
107
85
|
|
|
108
86
|
maid:GiveTask(attachment)
|
|
109
87
|
|
|
@@ -133,4 +111,4 @@ function RagdollAdditionalAttachmentUtils.ensureAdditionalAttachments(character,
|
|
|
133
111
|
return topMaid
|
|
134
112
|
end
|
|
135
113
|
|
|
136
|
-
return RagdollAdditionalAttachmentUtils
|
|
114
|
+
return RagdollAdditionalAttachmentUtils
|
|
@@ -12,172 +12,172 @@ local Workspace = game:GetService("Workspace")
|
|
|
12
12
|
local EnumUtils = require("EnumUtils")
|
|
13
13
|
local Maid = require("Maid")
|
|
14
14
|
local RagdollMotorLimitData = require("RagdollMotorLimitData")
|
|
15
|
-
local Rx = require("Rx")
|
|
16
15
|
local RxBrioUtils = require("RxBrioUtils")
|
|
17
16
|
local RxInstanceUtils = require("RxInstanceUtils")
|
|
18
|
-
local RxPhysicsUtils = require("RxPhysicsUtils")
|
|
19
17
|
local RxR15Utils = require("RxR15Utils")
|
|
18
|
+
local Rx = require("Rx")
|
|
19
|
+
local RxPhysicsUtils = require("RxPhysicsUtils")
|
|
20
20
|
|
|
21
21
|
local RagdollBallSocketUtils = {}
|
|
22
22
|
|
|
23
23
|
local R6_RAGDOLL_RIG = {
|
|
24
24
|
{
|
|
25
|
-
part0Name = "Torso"
|
|
26
|
-
part1Name =
|
|
27
|
-
attachmentName = "NeckAttachment"
|
|
28
|
-
motorParentName = "Torso"
|
|
29
|
-
motorName = "Neck"
|
|
30
|
-
limitData = RagdollMotorLimitData.R6_NECK_LIMITS
|
|
31
|
-
}
|
|
25
|
+
part0Name = "Torso";
|
|
26
|
+
part1Name ="Head",
|
|
27
|
+
attachmentName = "NeckAttachment";
|
|
28
|
+
motorParentName = "Torso";
|
|
29
|
+
motorName = "Neck";
|
|
30
|
+
limitData = RagdollMotorLimitData.R6_NECK_LIMITS;
|
|
31
|
+
};
|
|
32
32
|
{
|
|
33
|
-
part0Name = "Torso"
|
|
34
|
-
part1Name =
|
|
35
|
-
attachmentName = "LeftHipAttachment"
|
|
36
|
-
motorParentName = "Torso"
|
|
37
|
-
motorName = "Left Hip"
|
|
38
|
-
limitData = RagdollMotorLimitData.R6_HIP_LIMITS
|
|
39
|
-
}
|
|
33
|
+
part0Name = "Torso";
|
|
34
|
+
part1Name ="Left Leg";
|
|
35
|
+
attachmentName = "LeftHipAttachment";
|
|
36
|
+
motorParentName = "Torso";
|
|
37
|
+
motorName = "Left Hip";
|
|
38
|
+
limitData = RagdollMotorLimitData.R6_HIP_LIMITS;
|
|
39
|
+
};
|
|
40
40
|
{
|
|
41
|
-
part0Name = "Torso"
|
|
42
|
-
part1Name =
|
|
43
|
-
attachmentName = "RightHipAttachment"
|
|
44
|
-
motorParentName = "Torso"
|
|
45
|
-
motorName = "Right Hip"
|
|
46
|
-
limitData = RagdollMotorLimitData.R6_HIP_LIMITS
|
|
47
|
-
}
|
|
41
|
+
part0Name = "Torso";
|
|
42
|
+
part1Name ="Right Leg";
|
|
43
|
+
attachmentName = "RightHipAttachment";
|
|
44
|
+
motorParentName = "Torso";
|
|
45
|
+
motorName = "Right Hip";
|
|
46
|
+
limitData = RagdollMotorLimitData.R6_HIP_LIMITS;
|
|
47
|
+
};
|
|
48
48
|
{
|
|
49
|
-
part0Name = "Torso"
|
|
50
|
-
part1Name =
|
|
51
|
-
attachmentName = "LeftShoulderRagdollAttachment"
|
|
52
|
-
motorParentName = "Torso"
|
|
53
|
-
motorName = "Left Shoulder"
|
|
54
|
-
limitData = RagdollMotorLimitData.R6_SHOULDER_LIMITS
|
|
55
|
-
}
|
|
49
|
+
part0Name = "Torso";
|
|
50
|
+
part1Name ="Left Arm";
|
|
51
|
+
attachmentName = "LeftShoulderRagdollAttachment";
|
|
52
|
+
motorParentName = "Torso";
|
|
53
|
+
motorName = "Left Shoulder";
|
|
54
|
+
limitData = RagdollMotorLimitData.R6_SHOULDER_LIMITS;
|
|
55
|
+
};
|
|
56
56
|
{
|
|
57
|
-
part0Name = "Torso"
|
|
58
|
-
part1Name =
|
|
59
|
-
attachmentName = "RightShoulderRagdollAttachment"
|
|
60
|
-
motorParentName = "Torso"
|
|
61
|
-
motorName = "Right Shoulder"
|
|
62
|
-
limitData = RagdollMotorLimitData.R6_SHOULDER_LIMITS
|
|
63
|
-
}
|
|
57
|
+
part0Name = "Torso";
|
|
58
|
+
part1Name ="Right Arm";
|
|
59
|
+
attachmentName = "RightShoulderRagdollAttachment";
|
|
60
|
+
motorParentName = "Torso";
|
|
61
|
+
motorName = "Right Shoulder";
|
|
62
|
+
limitData = RagdollMotorLimitData.R6_SHOULDER_LIMITS;
|
|
63
|
+
};
|
|
64
64
|
}
|
|
65
65
|
|
|
66
66
|
local R15_RAGDOLL_RIG = {
|
|
67
67
|
{
|
|
68
|
-
part0Name = "UpperTorso"
|
|
69
|
-
part1Name = "Head"
|
|
70
|
-
attachmentName = "NeckRigAttachment"
|
|
71
|
-
motorParentName = "Head"
|
|
72
|
-
motorName = "Neck"
|
|
73
|
-
limitData = RagdollMotorLimitData.NECK_LIMITS
|
|
74
|
-
}
|
|
68
|
+
part0Name = "UpperTorso";
|
|
69
|
+
part1Name = "Head";
|
|
70
|
+
attachmentName = "NeckRigAttachment";
|
|
71
|
+
motorParentName = "Head";
|
|
72
|
+
motorName = "Neck";
|
|
73
|
+
limitData = RagdollMotorLimitData.NECK_LIMITS;
|
|
74
|
+
};
|
|
75
75
|
{
|
|
76
|
-
part0Name = "LowerTorso"
|
|
77
|
-
part1Name = "UpperTorso"
|
|
78
|
-
attachmentName = "WaistRigAttachment"
|
|
79
|
-
motorParentName = "UpperTorso"
|
|
80
|
-
motorName = "Waist"
|
|
81
|
-
limitData = RagdollMotorLimitData.WAIST_LIMITS
|
|
82
|
-
}
|
|
76
|
+
part0Name = "LowerTorso";
|
|
77
|
+
part1Name = "UpperTorso";
|
|
78
|
+
attachmentName = "WaistRigAttachment";
|
|
79
|
+
motorParentName = "UpperTorso";
|
|
80
|
+
motorName = "Waist";
|
|
81
|
+
limitData = RagdollMotorLimitData.WAIST_LIMITS;
|
|
82
|
+
};
|
|
83
83
|
{
|
|
84
|
-
part0Name = "UpperTorso"
|
|
85
|
-
part1Name = "LeftUpperArm"
|
|
86
|
-
attachmentName = "LeftShoulderRagdollAttachment"
|
|
87
|
-
motorParentName = "LeftUpperArm"
|
|
88
|
-
motorName = "LeftShoulder"
|
|
89
|
-
limitData = RagdollMotorLimitData.SHOULDER_LIMITS
|
|
90
|
-
}
|
|
84
|
+
part0Name = "UpperTorso";
|
|
85
|
+
part1Name = "LeftUpperArm";
|
|
86
|
+
attachmentName = "LeftShoulderRagdollAttachment";
|
|
87
|
+
motorParentName = "LeftUpperArm";
|
|
88
|
+
motorName = "LeftShoulder";
|
|
89
|
+
limitData = RagdollMotorLimitData.SHOULDER_LIMITS;
|
|
90
|
+
};
|
|
91
91
|
{
|
|
92
|
-
part0Name = "LeftUpperArm"
|
|
93
|
-
part1Name = "LeftLowerArm"
|
|
94
|
-
attachmentName = "LeftElbowRigAttachment"
|
|
95
|
-
motorParentName = "LeftLowerArm"
|
|
96
|
-
motorName = "LeftElbow"
|
|
97
|
-
limitData = RagdollMotorLimitData.ELBOW_LIMITS
|
|
98
|
-
}
|
|
92
|
+
part0Name = "LeftUpperArm";
|
|
93
|
+
part1Name = "LeftLowerArm";
|
|
94
|
+
attachmentName = "LeftElbowRigAttachment";
|
|
95
|
+
motorParentName = "LeftLowerArm";
|
|
96
|
+
motorName = "LeftElbow";
|
|
97
|
+
limitData = RagdollMotorLimitData.ELBOW_LIMITS;
|
|
98
|
+
};
|
|
99
99
|
{
|
|
100
|
-
part0Name = "LeftLowerArm"
|
|
101
|
-
part1Name = "LeftHand"
|
|
102
|
-
attachmentName = "LeftWristRigAttachment"
|
|
103
|
-
motorParentName = "LeftHand"
|
|
104
|
-
motorName = "LeftWrist"
|
|
105
|
-
limitData = RagdollMotorLimitData.WRIST_LIMITS
|
|
106
|
-
}
|
|
100
|
+
part0Name = "LeftLowerArm";
|
|
101
|
+
part1Name = "LeftHand";
|
|
102
|
+
attachmentName = "LeftWristRigAttachment";
|
|
103
|
+
motorParentName = "LeftHand";
|
|
104
|
+
motorName = "LeftWrist";
|
|
105
|
+
limitData = RagdollMotorLimitData.WRIST_LIMITS;
|
|
106
|
+
};
|
|
107
107
|
{
|
|
108
|
-
part0Name = "UpperTorso"
|
|
109
|
-
part1Name = "RightUpperArm"
|
|
110
|
-
attachmentName = "RightShoulderRagdollAttachment"
|
|
111
|
-
motorParentName = "RightUpperArm"
|
|
112
|
-
motorName = "RightShoulder"
|
|
113
|
-
limitData = RagdollMotorLimitData.SHOULDER_LIMITS
|
|
114
|
-
}
|
|
108
|
+
part0Name = "UpperTorso";
|
|
109
|
+
part1Name = "RightUpperArm";
|
|
110
|
+
attachmentName = "RightShoulderRagdollAttachment";
|
|
111
|
+
motorParentName = "RightUpperArm";
|
|
112
|
+
motorName = "RightShoulder";
|
|
113
|
+
limitData = RagdollMotorLimitData.SHOULDER_LIMITS;
|
|
114
|
+
};
|
|
115
115
|
{
|
|
116
|
-
part0Name = "RightUpperArm"
|
|
117
|
-
part1Name = "RightLowerArm"
|
|
118
|
-
attachmentName = "RightElbowRigAttachment"
|
|
119
|
-
motorParentName = "RightLowerArm"
|
|
120
|
-
motorName = "RightElbow"
|
|
121
|
-
limitData = RagdollMotorLimitData.ELBOW_LIMITS
|
|
122
|
-
}
|
|
116
|
+
part0Name = "RightUpperArm";
|
|
117
|
+
part1Name = "RightLowerArm";
|
|
118
|
+
attachmentName = "RightElbowRigAttachment";
|
|
119
|
+
motorParentName = "RightLowerArm";
|
|
120
|
+
motorName = "RightElbow";
|
|
121
|
+
limitData = RagdollMotorLimitData.ELBOW_LIMITS;
|
|
122
|
+
};
|
|
123
123
|
{
|
|
124
|
-
part0Name = "RightLowerArm"
|
|
125
|
-
part1Name = "RightHand"
|
|
126
|
-
attachmentName = "RightWristRigAttachment"
|
|
127
|
-
motorParentName = "RightHand"
|
|
128
|
-
motorName = "RightWrist"
|
|
129
|
-
limitData = RagdollMotorLimitData.WRIST_LIMITS
|
|
130
|
-
}
|
|
124
|
+
part0Name = "RightLowerArm";
|
|
125
|
+
part1Name = "RightHand";
|
|
126
|
+
attachmentName = "RightWristRigAttachment";
|
|
127
|
+
motorParentName = "RightHand";
|
|
128
|
+
motorName = "RightWrist";
|
|
129
|
+
limitData = RagdollMotorLimitData.WRIST_LIMITS;
|
|
130
|
+
};
|
|
131
131
|
|
|
132
132
|
{
|
|
133
|
-
part0Name = "LowerTorso"
|
|
134
|
-
part1Name = "LeftUpperLeg"
|
|
135
|
-
attachmentName = "LeftHipRigAttachment"
|
|
136
|
-
motorParentName = "LeftUpperLeg"
|
|
137
|
-
motorName = "LeftHip"
|
|
138
|
-
limitData = RagdollMotorLimitData.HIP_LIMITS
|
|
139
|
-
}
|
|
133
|
+
part0Name = "LowerTorso";
|
|
134
|
+
part1Name = "LeftUpperLeg";
|
|
135
|
+
attachmentName = "LeftHipRigAttachment";
|
|
136
|
+
motorParentName = "LeftUpperLeg";
|
|
137
|
+
motorName = "LeftHip";
|
|
138
|
+
limitData = RagdollMotorLimitData.HIP_LIMITS;
|
|
139
|
+
};
|
|
140
140
|
{
|
|
141
|
-
part0Name = "LeftUpperLeg"
|
|
142
|
-
part1Name = "LeftLowerLeg"
|
|
143
|
-
attachmentName = "LeftKneeRigAttachment"
|
|
144
|
-
motorParentName = "LeftLowerLeg"
|
|
145
|
-
motorName = "LeftKnee"
|
|
146
|
-
limitData = RagdollMotorLimitData.KNEE_LIMITS
|
|
147
|
-
}
|
|
141
|
+
part0Name = "LeftUpperLeg";
|
|
142
|
+
part1Name = "LeftLowerLeg";
|
|
143
|
+
attachmentName = "LeftKneeRigAttachment";
|
|
144
|
+
motorParentName = "LeftLowerLeg";
|
|
145
|
+
motorName = "LeftKnee";
|
|
146
|
+
limitData = RagdollMotorLimitData.KNEE_LIMITS;
|
|
147
|
+
};
|
|
148
148
|
{
|
|
149
|
-
part0Name = "LeftLowerLeg"
|
|
150
|
-
part1Name = "LeftFoot"
|
|
151
|
-
attachmentName = "LeftAnkleRigAttachment"
|
|
152
|
-
motorParentName = "LeftFoot"
|
|
153
|
-
motorName = "LeftAnkle"
|
|
154
|
-
limitData = RagdollMotorLimitData.ANKLE_LIMITS
|
|
155
|
-
}
|
|
149
|
+
part0Name = "LeftLowerLeg";
|
|
150
|
+
part1Name = "LeftFoot";
|
|
151
|
+
attachmentName = "LeftAnkleRigAttachment";
|
|
152
|
+
motorParentName = "LeftFoot";
|
|
153
|
+
motorName = "LeftAnkle";
|
|
154
|
+
limitData = RagdollMotorLimitData.ANKLE_LIMITS;
|
|
155
|
+
};
|
|
156
156
|
|
|
157
157
|
{
|
|
158
|
-
part0Name = "LowerTorso"
|
|
159
|
-
part1Name = "RightUpperLeg"
|
|
160
|
-
attachmentName = "RightHipRigAttachment"
|
|
161
|
-
motorParentName = "RightUpperLeg"
|
|
162
|
-
motorName = "RightHip"
|
|
163
|
-
limitData = RagdollMotorLimitData.HIP_LIMITS
|
|
164
|
-
}
|
|
158
|
+
part0Name = "LowerTorso";
|
|
159
|
+
part1Name = "RightUpperLeg";
|
|
160
|
+
attachmentName = "RightHipRigAttachment";
|
|
161
|
+
motorParentName = "RightUpperLeg";
|
|
162
|
+
motorName = "RightHip";
|
|
163
|
+
limitData = RagdollMotorLimitData.HIP_LIMITS;
|
|
164
|
+
};
|
|
165
165
|
{
|
|
166
|
-
part0Name = "RightUpperLeg"
|
|
167
|
-
part1Name = "RightLowerLeg"
|
|
168
|
-
attachmentName = "RightKneeRigAttachment"
|
|
169
|
-
motorParentName = "RightLowerLeg"
|
|
170
|
-
motorName = "RightKnee"
|
|
171
|
-
limitData = RagdollMotorLimitData.KNEE_LIMITS
|
|
172
|
-
}
|
|
166
|
+
part0Name = "RightUpperLeg";
|
|
167
|
+
part1Name = "RightLowerLeg";
|
|
168
|
+
attachmentName = "RightKneeRigAttachment";
|
|
169
|
+
motorParentName = "RightLowerLeg";
|
|
170
|
+
motorName = "RightKnee";
|
|
171
|
+
limitData = RagdollMotorLimitData.KNEE_LIMITS;
|
|
172
|
+
};
|
|
173
173
|
{
|
|
174
|
-
part0Name = "RightLowerLeg"
|
|
175
|
-
part1Name = "RightFoot"
|
|
176
|
-
attachmentName = "RightAnkleRigAttachment"
|
|
177
|
-
motorParentName = "RightFoot"
|
|
178
|
-
motorName = "RightAnkle"
|
|
179
|
-
limitData = RagdollMotorLimitData.ANKLE_LIMITS
|
|
180
|
-
}
|
|
174
|
+
part0Name = "RightLowerLeg";
|
|
175
|
+
part1Name = "RightFoot";
|
|
176
|
+
attachmentName = "RightAnkleRigAttachment";
|
|
177
|
+
motorParentName = "RightFoot";
|
|
178
|
+
motorName = "RightAnkle";
|
|
179
|
+
limitData = RagdollMotorLimitData.ANKLE_LIMITS;
|
|
180
|
+
};
|
|
181
181
|
}
|
|
182
182
|
|
|
183
183
|
function RagdollBallSocketUtils.getRigData(rigType)
|
|
@@ -207,24 +207,19 @@ function RagdollBallSocketUtils.ensureBallSockets(character, rigType)
|
|
|
207
207
|
RxBrioUtils.switchMapBrio(function(motor)
|
|
208
208
|
if motor then
|
|
209
209
|
return RxBrioUtils.flatCombineLatest({
|
|
210
|
-
motor = Rx.of(motor)
|
|
211
|
-
part1 = RxR15Utils.observeCharacterPartBrio(character, part1Name)
|
|
212
|
-
attachment0 = RxR15Utils.observeRigAttachmentBrio(character, part0Name, attachmentName)
|
|
213
|
-
attachment1 = RxR15Utils.observeRigAttachmentBrio(character, part1Name, attachmentName)
|
|
214
|
-
limitData = Rx.of(limitData)
|
|
210
|
+
motor = Rx.of(motor);
|
|
211
|
+
part1 = RxR15Utils.observeCharacterPartBrio(character, part1Name);
|
|
212
|
+
attachment0 = RxR15Utils.observeRigAttachmentBrio(character, part0Name, attachmentName);
|
|
213
|
+
attachment1 = RxR15Utils.observeRigAttachmentBrio(character, part1Name, attachmentName);
|
|
214
|
+
limitData = Rx.of(limitData);
|
|
215
215
|
})
|
|
216
216
|
else
|
|
217
217
|
return Rx.of({})
|
|
218
218
|
end
|
|
219
|
-
end)
|
|
219
|
+
end);
|
|
220
220
|
RxBrioUtils.where(function(motorState)
|
|
221
|
-
return motorState.attachment0
|
|
222
|
-
|
|
223
|
-
and motorState.part1
|
|
224
|
-
and motorState.motor
|
|
225
|
-
and true
|
|
226
|
-
or false
|
|
227
|
-
end),
|
|
221
|
+
return motorState.attachment0 and motorState.attachment1 and motorState.part1 and motorState.motor and true or false
|
|
222
|
+
end);
|
|
228
223
|
})
|
|
229
224
|
|
|
230
225
|
topMaid:GiveTask(observable:Subscribe(function(brio)
|
|
@@ -246,22 +241,25 @@ function RagdollBallSocketUtils.ensureBallSockets(character, rigType)
|
|
|
246
241
|
ballSocket.Attachment0 = motorState.attachment0
|
|
247
242
|
ballSocket.Attachment1 = motorState.attachment1
|
|
248
243
|
|
|
249
|
-
maid:GiveTask(limitValue.UpperAngle:Observe()
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
244
|
+
maid:GiveTask(limitValue.UpperAngle:Observe()
|
|
245
|
+
:Subscribe(function(value)
|
|
246
|
+
ballSocket.UpperAngle = value
|
|
247
|
+
end))
|
|
248
|
+
maid:GiveTask(limitValue.TwistLowerAngle:Observe()
|
|
249
|
+
:Subscribe(function(value)
|
|
250
|
+
ballSocket.TwistLowerAngle = value
|
|
251
|
+
end))
|
|
252
|
+
maid:GiveTask(limitValue.TwistUpperAngle:Observe()
|
|
253
|
+
:Subscribe(function(value)
|
|
254
|
+
ballSocket.TwistUpperAngle = value
|
|
255
|
+
end))
|
|
258
256
|
|
|
259
257
|
maid:GiveTask(Rx.combineLatest({
|
|
260
|
-
frictionTorque = limitValue.FrictionTorque:Observe()
|
|
261
|
-
referenceGravity = limitValue.ReferenceGravity:Observe()
|
|
262
|
-
referenceMass = limitValue.ReferenceMass:Observe()
|
|
263
|
-
gravity = RxInstanceUtils.observeProperty(Workspace, "Gravity")
|
|
264
|
-
mass = RxPhysicsUtils.observePartMass(motorState.part1)
|
|
258
|
+
frictionTorque = limitValue.FrictionTorque:Observe();
|
|
259
|
+
referenceGravity = limitValue.ReferenceGravity:Observe();
|
|
260
|
+
referenceMass = limitValue.ReferenceMass:Observe();
|
|
261
|
+
gravity = RxInstanceUtils.observeProperty(Workspace, "Gravity");
|
|
262
|
+
mass = RxPhysicsUtils.observePartMass(motorState.part1);
|
|
265
263
|
}):Subscribe(function(state)
|
|
266
264
|
local gravityScale = state.gravity / state.referenceGravity
|
|
267
265
|
local referenceMass = state.referenceMass
|
|
@@ -270,10 +268,12 @@ function RagdollBallSocketUtils.ensureBallSockets(character, rigType)
|
|
|
270
268
|
end))
|
|
271
269
|
|
|
272
270
|
ballSocket.Parent = motorState.part1
|
|
271
|
+
|
|
273
272
|
end))
|
|
274
273
|
end
|
|
275
274
|
|
|
276
275
|
return topMaid
|
|
277
276
|
end
|
|
278
277
|
|
|
279
|
-
|
|
278
|
+
|
|
279
|
+
return RagdollBallSocketUtils
|