为VR装备旋转实现缓和效果

时间:2019-04-24 05:27:31

标签: unity3d virtual-reality oculus

我目前正在基于Oculus Controller的Rotation旋转VR Rig,想要添加一种简化控制器旋转时的效果。

当前基于以下代码,它看起来像VR摄像机已附加到Controller and Rotating,但我想对其进行改进,以使其看起来像摄像机在跟随控制器一样平稳。 代码(CSharp):

var ControllerPosition;
var rotationDelta = Quaternion.Inverse(controllerPreviousRotation) * currentRotation;

float angle = rotationdelta.eulerAngles.y;

transform.RotateAround(
                        ControllerPosition,
                         Vector3.up,
                         angle);

尝试过Lerp,由于控制器的上一次旋转与当前旋转之间的差异非常小,因此效果不可见。任何帮助都会有所帮助。

0 个答案:

没有答案
相关问题