4 namespace droid.Runtime.Utilities.Misc.Extensions {
7 Vector3 _last_recorded_move;
8 Quaternion _last_recorded_rotation;
9 Vector3 _previous_position;
10 Quaternion _previous_rotation;
13 return this.transform.position != this._previous_position
14 || this.transform.rotation != this._previous_rotation;
18 var distance_moved = Vector3.Distance(this.transform.position,
this._last_recorded_move);
19 var angle_rotated = Quaternion.Angle(this.transform.rotation,
this._last_recorded_rotation);
20 if (distance_moved > sensitivity || angle_rotated > sensitivity) {
21 this.UpdateLastRecordedTranform();
28 void UpdatePreviousTranform() {
29 this._previous_position = this.transform.position;
30 this._previous_rotation = this.transform.rotation;
33 void UpdateLastRecordedTranform() {
34 this._last_recorded_move = this.transform.position;
35 this._last_recorded_rotation = this.transform.rotation;
39 this.UpdatePreviousTranform();
40 this.UpdateLastRecordedTranform();
43 void Update() { this.UpdatePreviousTranform(); }
bool IsInMotion(float sensitivity)