Merge branch 'BugFixes' of https://github.com/NoriteSC/FlaxEngineFork into NoriteSC-BugFixes
# Conflicts: # Source/Engine/Networking/NetworkReplicator.cpp
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user