3 namespace droid.Runtime.Utilities.Misc.Orientation {
6 [SerializeField] Vector3 _forward;
15 if (this.targetPose) {
16 this.rot = this.targetPose.rotation;
18 var projection_on_plane = Vector3.ProjectOnPlane(this.targetPose.up, Vector3.up);
20 var rot = this.transform.rotation;
21 var normalised_proj = projection_on_plane.normalized;
22 var view = Quaternion.Euler(0, -90, 0) * normalised_proj;
23 if (view != Vector3.zero) {
24 rot.SetLookRotation(view, Vector3.down);
27 this.transform.rotation = rot;