Merge branch 'BugFixes' of https://github.com/NoriteSC/FlaxEngineFork into NoriteSC-BugFixes

# Conflicts:
#	Source/Engine/Networking/NetworkReplicator.cpp
This commit is contained in:
Wojtek Figat
2023-09-28 12:28:19 +02:00
6 changed files with 37 additions and 38 deletions

View File

@@ -146,7 +146,7 @@ void Joint::Create()
if (_enableAutoAnchor && target)
{
// Place target anchor at the joint location
desc.Pos1 = Target->GetTransform().WorldToLocal(GetPosition());
desc.Pos1 = (Target->GetOrientation() * (GetPosition() - Target->GetPosition())) + Target->GetPosition();
desc.Rot1 = WorldToLocal(Target->GetOrientation(), GetOrientation());
}
_joint = CreateJoint(desc);
@@ -197,8 +197,9 @@ Vector3 Joint::GetTargetPosition() const
if (Target)
{
if (_enableAutoAnchor)
position = Target->GetTransform().WorldToLocal(GetPosition());
position = Target->GetOrientation() * position + Target->GetPosition();
position = (Target->GetOrientation() * (GetPosition() - Target->GetPosition())) + Target->GetPosition();
else
position = Target->GetOrientation() * position + Target->GetPosition();
}
return position;
}