Skip to content

Commit

Permalink
Custom Jolt constraint configs now properly adjust the parent local f…
Browse files Browse the repository at this point in the history
…rame
  • Loading branch information
jankrassnigg committed Dec 22, 2022
1 parent 933d703 commit cde817f
Showing 1 changed file with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,18 @@ ezResult ezJoltConstraintComponent::FindParentBody(ezUInt32& out_uiJoltBodyID)
}
return EZ_SUCCESS;
}
else
{
if (GetUserFlag(0) == true)
{
ezTransform globalFrame = m_LocalFrameA;

// m_localFrameA is already valid
// assume it was in global space and move it into local space of the found parent
m_LocalFrameA.SetLocalTransform(pRbComp->GetOwner()->GetGlobalTransform(), globalFrame);
m_LocalFrameA.m_vPosition = m_LocalFrameA.m_vPosition.CompMul(pObject->GetGlobalScaling());
}
}
}

pRbComp->EnsureSimulationStarted();
Expand Down

0 comments on commit cde817f

Please sign in to comment.