diff --git a/Unity/DifferentialDrive.cs b/Unity/DifferentialDrive.cs
index e8f8858..d56f73f 100644
--- a/Unity/DifferentialDrive.cs
+++ b/Unity/DifferentialDrive.cs
@@ -133,9 +133,9 @@ namespace RoboidControl.Unity {
rb.velocity = 0.9f * rb.velocity + 0.1f * forwardSpeed * transform.forward;
rb.angularVelocity = 0.9f * rb.angularVelocity + 0.1f * turningSpeed * Vector3.up;
- core.position = LinearAlgebra.Spherical.FromVector3(this.transform.localPosition);
- core.orientation = LinearAlgebra.SwingTwist.FromQuaternion(this.transform.localRotation);
-
+ core.ReplacePosition(LinearAlgebra.Spherical.FromVector3(this.transform.localPosition));
+ core.ReplaceOrientation(LinearAlgebra.SwingTwist.FromQuaternion(this.transform.localRotation));
+
}
}
}
diff --git a/src/Thing.cs b/src/Thing.cs
index 56e3f16..34b3d93 100644
--- a/src/Thing.cs
+++ b/src/Thing.cs
@@ -316,6 +316,10 @@ namespace RoboidControl {
///
public bool positionUpdated = false;
+ public void ReplacePosition(Spherical newPosition) {
+ this._position = newPosition;
+ }
+
private SwingTwist _orientation = SwingTwist.zero;
///
/// The orientation of the thing in local space
@@ -336,6 +340,10 @@ namespace RoboidControl {
///
public bool orientationUpdated = false;
+ public void ReplaceOrientation(SwingTwist newOrientation) {
+ this._orientation = newOrientation;
+ }
+
private Spherical _linearVelocity = Spherical.zero;
///
/// The linear velocity of the thing in local space in meters per second