vp_FPSCamera.LateUpdate C# (CSharp) Méthode

LateUpdate() public méthode

public LateUpdate ( ) : void
Résultat void
    void LateUpdate()
    {
        // rotate the parent gameobject (i.e. player model)
        // NOTE: that this rotation does not pitch the player model, it only uses yaw
        Quaternion xQuaternion = Quaternion.AngleAxis(m_Yaw + m_InitialRotation.x, Vector3.up);
        Quaternion yQuaternion = Quaternion.AngleAxis(0, Vector3.left);
        gameObject.transform.parent.transform.rotation = xQuaternion * yQuaternion;

        // pitch and yaw the camera
        yQuaternion = Quaternion.AngleAxis(m_Pitch - m_InitialRotation.y, Vector3.left);
        gameObject.camera.transform.rotation = xQuaternion * yQuaternion;

        // roll the camera
        gameObject.camera.transform.localEulerAngles += new Vector3(0, 0, m_RotationSpring.State.z);
    }