mirror of
https://github.com/CapsAdmin/pac3.git
synced 2025-03-04 03:03:01 -05:00
Cleanup
This commit is contained in:
parent
69fbd90b75
commit
02d0342fa6
@ -35,25 +35,21 @@ do -- bones
|
||||
|
||||
function PART:GetBonePosition()
|
||||
local parent = self:GetParent()
|
||||
|
||||
if parent:IsValid() and parent.ClassName == "jiggle" then
|
||||
return parent.pos, parent.ang
|
||||
end
|
||||
|
||||
do -- legacy behavior, inherit parent matrix from sprite, particle, etc
|
||||
if
|
||||
if parent:IsValid() then
|
||||
if parent.ClassName == "jiggle" then
|
||||
return parent.pos, parent.ang
|
||||
elseif
|
||||
not parent.is_model_part and
|
||||
not parent.is_entity_part and
|
||||
not parent.is_bone_part and
|
||||
not self.is_bone_part and
|
||||
parent.WorldMatrix and
|
||||
parent.ClassName ~= "jiggle"
|
||||
parent.WorldMatrix
|
||||
then
|
||||
return parent:GetWorldPosition(), parent:GetWorldAngles()
|
||||
end
|
||||
end
|
||||
|
||||
local owner = self:GetParentOwner()
|
||||
|
||||
if owner:IsValid() then
|
||||
-- if there is no parent, default to owner bones
|
||||
return pac.GetBonePosAng(owner, self.BoneOverride or self.Bone)
|
||||
@ -63,25 +59,32 @@ do -- bones
|
||||
end
|
||||
|
||||
function PART:GetBoneMatrix()
|
||||
|
||||
do -- legacy behavior, inherit parent matrix from sprite, particle, etc
|
||||
local parent = self:GetParent()
|
||||
if
|
||||
local parent = self:GetParent()
|
||||
if parent:IsValid() then
|
||||
if parent.ClassName == "jiggle" then
|
||||
local bone_matrix = Matrix()
|
||||
bone_matrix:SetTranslation(parent.pos)
|
||||
bone_matrix:SetAngles(parent.ang)
|
||||
return bone_matrix
|
||||
elseif
|
||||
not parent.is_model_part and
|
||||
not parent.is_entity_part and
|
||||
not parent.is_bone_part and
|
||||
not self.is_bone_part and
|
||||
parent.WorldMatrix and
|
||||
parent.ClassName ~= "jiggle"
|
||||
parent.WorldMatrix
|
||||
then
|
||||
return parent.WorldMatrix
|
||||
end
|
||||
end
|
||||
|
||||
local pos, ang = self:GetBonePosition()
|
||||
|
||||
local bone_matrix = Matrix()
|
||||
bone_matrix:SetTranslation(pos)
|
||||
bone_matrix:SetAngles(ang)
|
||||
local owner = self:GetParentOwner()
|
||||
if owner:IsValid() then
|
||||
-- if there is no parent, default to owner bones
|
||||
local pos, ang = pac.GetBonePosAng(owner, self.BoneOverride or self.Bone)
|
||||
bone_matrix:SetTranslation(pos)
|
||||
bone_matrix:SetAngles(ang)
|
||||
end
|
||||
|
||||
return bone_matrix
|
||||
end
|
||||
|
@ -11,7 +11,7 @@ PART.ManualDraw = true
|
||||
PART.HandleModifiersManually = true
|
||||
PART.Icon = 'icon16/brick.png'
|
||||
PART.Group = "entity"
|
||||
PART.is_model_part = false
|
||||
PART.is_entity_part = true
|
||||
|
||||
BUILDER:StartStorableVars()
|
||||
:SetPropertyGroup("generic")
|
||||
|
Loading…
Reference in New Issue
Block a user