mirror of
https://github.com/Winded/RagdollMover.git
synced 2025-03-04 03:13:36 -05:00
Fixed issue with locking IK bones, although the whole fix was making the tool calculate IKs twice. There is probably a better way to do this
This commit is contained in:
parent
e5c98b9948
commit
8245a6dfa8
@ -313,6 +313,7 @@ function GetOffsetTable(tool,ent,rotate, bonelocks)
|
||||
end
|
||||
|
||||
local function RecursiveSetParent(ostable, sbone, rlocks, plocks, RTable, bone)
|
||||
|
||||
local parent = ostable[bone].parent
|
||||
if not RTable[parent] then RecursiveSetParent(ostable, sbone, rlocks, plocks, RTable, parent) end
|
||||
|
||||
@ -365,6 +366,19 @@ local function SetBoneOffsets(tool, ent,ostable,sbone, rlocks, plocks)
|
||||
end
|
||||
end
|
||||
|
||||
for k,v in pairs(ent.rgmIKChains) do -- calculating IKs twice for proper bone locking stuff to IKs, perhaps there is a simpler way to do these
|
||||
if tobool(tool:GetClientNumber(DefIKnames[v.type],0)) then
|
||||
|
||||
local footdata = ostable[v.foot]
|
||||
if not RTable[footdata.parent] then
|
||||
RecursiveSetParent(ostable, sbone, rlocks, plocks, RTable, footdata.parent)
|
||||
end
|
||||
|
||||
local RT = ProcessIK(ent,v,sbone,RTable, footdata)
|
||||
table.Merge(RTable,RT)
|
||||
end
|
||||
end
|
||||
|
||||
for i=0,ent:GetBoneCount()-1 do
|
||||
local pb = BoneToPhysBone(ent,i)
|
||||
if ostable[pb] and not RTable[pb] then
|
||||
|
Loading…
Reference in New Issue
Block a user