mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-02-20 15:41:01 +00:00
RigidbodySync.GetFromAttached: store AttachedRigidbody.GetPosition() in local var
This commit is contained in:
parent
ad2c84acb2
commit
99cf46a23f
@ -70,9 +70,10 @@ public abstract class SectoredRigidbodySync : BaseSectoredSync
|
||||
return;
|
||||
}
|
||||
|
||||
transform.position = ReferenceTransform.ToRelPos(AttachedRigidbody.GetPosition());
|
||||
var pos = AttachedRigidbody.GetPosition();
|
||||
transform.position = ReferenceTransform.ToRelPos(pos);
|
||||
transform.rotation = ReferenceTransform.ToRelRot(AttachedRigidbody.GetRotation());
|
||||
Velocity = ReferenceRigidbody.ToRelVel(AttachedRigidbody.GetVelocity(), AttachedRigidbody.GetPosition());
|
||||
Velocity = ReferenceRigidbody.ToRelVel(AttachedRigidbody.GetVelocity(), pos);
|
||||
AngularVelocity = ReferenceRigidbody.ToRelAngVel(AttachedRigidbody.GetAngularVelocity());
|
||||
}
|
||||
|
||||
|
@ -64,9 +64,10 @@ public abstract class UnsectoredRigidbodySync : BaseUnsectoredSync
|
||||
|
||||
protected override void GetFromAttached()
|
||||
{
|
||||
transform.position = ReferenceTransform.ToRelPos(AttachedRigidbody.GetPosition());
|
||||
var pos = AttachedRigidbody.GetPosition();
|
||||
transform.position = ReferenceTransform.ToRelPos(pos);
|
||||
transform.rotation = ReferenceTransform.ToRelRot(AttachedRigidbody.GetRotation());
|
||||
Velocity = ReferenceRigidbody.ToRelVel(AttachedRigidbody.GetVelocity(), AttachedRigidbody.GetPosition());
|
||||
Velocity = ReferenceRigidbody.ToRelVel(AttachedRigidbody.GetVelocity(), pos);
|
||||
AngularVelocity = ReferenceRigidbody.ToRelAngVel(AttachedRigidbody.GetAngularVelocity());
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user