namespace ExitGames.Demos.DemoPunVoice
{

	// [TypeInfo RVA: 0x0]
	public class MouseLookHelper : Object
	{
		public float XSensitivity; // 0x10
		public float YSensitivity; // 0x14
		public bool clampVerticalRotation; // 0x18
		public float MinimumX; // 0x1C
		public float MaximumX; // 0x20
		public bool smooth; // 0x24
		public float smoothTime; // 0x28
		private UnityEngine.Quaternion m_CharacterTargetRot; // 0x2C
		private UnityEngine.Quaternion m_CameraTargetRot; // 0x3C

		// RVA: 0x3281CE8 VA: 0x781896CCE8
		public void Init(UnityEngine.Transform character, UnityEngine.Transform camera);
		/*
		 *   UnityEngine_Vector4 UVar1;
		 *
		 *   if (character != null) {
		 *     UVar1 = UnityEngine.Transform.get_localRotation(character);
		 *     (this.m_CharacterTargetRot).x = UVar1.x;
		 *     (this.m_CharacterTargetRot).y = UVar1.y;
		 *     (this.m_CharacterTargetRot).z = UVar1.z;
		 *     (this.m_CharacterTargetRot).w = UVar1.w;
		 *     if (camera != null) {
		 *       UVar1 = UnityEngine.Transform.get_localRotation(camera);
		 *       (this.m_CameraTargetRot).x = UVar1.x;
		 *       (this.m_CameraTargetRot).y = UVar1.y;
		 *       (this.m_CameraTargetRot).z = UVar1.z;
		 *       (this.m_CameraTargetRot).w = UVar1.w;
		 *       return;
		 *     }
		 *   }
		 *   IL2CPP.ThrowNullReferenceException();
		 */
		// RVA: 0x3281EE8 VA: 0x781896CEE8
		public void LookRotation(UnityEngine.Transform character, UnityEngine.Transform camera);
		/*
		 *   bool bVar1;
		 *   undefined1 auVar2 [12];
		 *   undefined1 auVar3 [16];
		 *   undefined *puVar4;
		 *   undefined *puVar5;
		 *   undefined *puVar6;
		 *   void *methodInfo_00;
		 *   long lVar7;
		 *   float fVar8;
		 *   float fVar9;
		 *   float fVar10;
		 *   undefined4 extraout_var;
		 *   undefined4 extraout_var_00;
		 *   float fVar11;
		 *   undefined1 auVar13 [16];
		 *   undefined4 uVar14;
		 *   float fVar15;
		 *   float fVar16;
		 *   undefined4 uVar20;
		 *   undefined1 auVar18 [16];
		 *   undefined1 auVar19 [16];
		 *   undefined1 auVar22 [16];
		 *   undefined1 auVar23 [16];
		 *   float fVar24;
		 *   float fVar25;
		 *   float fVar26;
		 *   float fVar27;
		 *   UnityEngine_Vector3 euler;
		 *   UnityEngine_Vector4 UVar28;
		 *   UnityEngine_Vector4 UVar29;
		 *   float fVar12;
		 *   float fVar17;
		 *   float fVar21;
		 *
		 *   puVar6 = PTR_DAT_070c56f8;
		 *   if ((bRam000000000754acb1 & 1) == 0) {
		 *     func_0x031fdc8c(PTR_DAT_070c56f8);
		 *     func_0x031fdc8c(PTR_DAT_070c5330);
		 *     func_0x031fdc8c(PTR_DAT_070c5338);
		 *     bRam000000000754acb1 = 1;
		 *   }
		 *   puVar5 = PTR_DAT_070c5338;
		 *   puVar4 = PTR_DAT_070c5330;
		 *   if (*(int *)(*(long *)puVar6 + 0xe4) == 0) {
		 *     func_0x031fde08();
		 *   }
		 *   fVar8 = CrossPlatformInputManager.GetAxis(*(void **)puVar5);
		 *   fVar11 = this.XSensitivity;
		 *   fVar9 = CrossPlatformInputManager.GetAxis(*(void **)puVar4);
		 *   fVar10 = _UNK_0134ef54;
		 *   uVar14 = (this.m_CharacterTargetRot).x;
		 *   uVar20 = (this.m_CharacterTargetRot).y;
		 *   auVar3._4_4_ = uVar20;
		 *   auVar3._0_4_ = uVar14;
		 *   fVar25 = this.YSensitivity;
		 *   fVar15 = (this.m_CharacterTargetRot).z;
		 *   fVar16 = (this.m_CharacterTargetRot).w;
		 *   auVar2._4_8_ = 0;
		 *   auVar2._0_4_ = fVar8 * fVar11 * _UNK_0134ef54;
		 *   UVar28 = UnityEngine.Quaternion.Internal_FromEulerRad((UnityEngine_Vector3)(auVar2 << 0x20));
		 *   fVar21 = UVar28.w;
		 *   fVar17 = UVar28.z;
		 *   fVar12 = UVar28.y;
		 *   fVar11 = UVar28.x;
		 *   auVar3._8_8_ = 0;
		 *   auVar22._4_4_ = fVar21;
		 *   auVar22._0_4_ = fVar21;
		 *   auVar22._8_4_ = fVar21;
		 *   auVar22._12_4_ = fVar21;
		 *   auVar13._4_4_ = fVar21;
		 *   auVar13._0_4_ = fVar11;
		 *   auVar13._8_4_ = extraout_var;
		 *   auVar13._12_4_ = extraout_var_00;
		 *   auVar22 = NEON_ext(auVar22,auVar13,4,1);
		 *   auVar19._4_4_ = fVar21;
		 *   auVar19._0_4_ = fVar11;
		 *   auVar19._8_4_ = fVar17;
		 *   auVar19._12_4_ = extraout_var_00;
		 *   auVar23._4_4_ = fVar21;
		 *   auVar23._0_4_ = fVar11;
		 *   auVar23._8_4_ = fVar17;
		 *   auVar23._12_4_ = extraout_var_00;
		 *   auVar23 = NEON_ext(auVar19,auVar23,4,1);
		 *   fVar8 = auVar23._4_4_;
		 *   auVar13 = NEON_ext(ZEXT416((uint)fVar15),ZEXT416((uint)fVar15),4,1);
		 *   auVar13 = NEON_ext(auVar13,auVar3,0xc,1);
		 *   auVar18._4_4_ = fVar12;
		 *   auVar18._0_4_ = fVar8;
		 *   auVar18._8_4_ = fVar8;
		 *   auVar18._12_4_ = auVar23._12_4_;
		 *   auVar19 = NEON_rev64(auVar18,4);
		 *   fVar26 = (this.m_CameraTargetRot).z;
		 *   fVar27 = (this.m_CameraTargetRot).w;
		 *   euler.x = -(fVar9 * fVar25) * fVar10;
		 *   fVar25 = (this.m_CameraTargetRot).x;
		 *   fVar24 = (this.m_CameraTargetRot).y;
		 *   (this.m_CharacterTargetRot).z =
		 *        (fVar16 * fVar17 + fVar15 * auVar22._8_4_ + (float)uVar14 * fVar12) -
		 *        auVar13._8_4_ * auVar19._8_4_;
		 *   (this.m_CharacterTargetRot).w =
		 *        ((fVar16 * fVar21 - (float)uVar14 * auVar22._12_4_) - (float)uVar20 * fVar12) -
		 *        auVar13._0_4_ * auVar19._12_4_;
		 *   (this.m_CharacterTargetRot).x =
		 *        (fVar16 * fVar11 + (float)uVar14 * auVar22._0_4_ + (float)uVar20 * fVar8) -
		 *        auVar13._0_4_ * auVar19._0_4_;
		 *   (this.m_CharacterTargetRot).y =
		 *        ((float)uVar20 * fVar21 + fVar16 * fVar12 + fVar15 * auVar23._12_4_) -
		 *        auVar13._4_4_ * auVar19._4_4_;
		 *   euler.y = 0.0;
		 *   euler.z = 0.0;
		 *   UVar28 = UnityEngine.Quaternion.Internal_FromEulerRad(euler);
		 *   fVar11 = UVar28.w;
		 *   fVar9 = UVar28.z;
		 *   fVar8 = UVar28.y;
		 *   fVar10 = UVar28.x;
		 *   bVar1 = this.clampVerticalRotation;
		 *   UVar28.x = (fVar24 * fVar9 + fVar27 * fVar10 + fVar25 * fVar11) - fVar26 * fVar8;
		 *   UVar28.y = (fVar26 * fVar10 + fVar27 * fVar8 + fVar24 * fVar11) - fVar25 * fVar9;
		 *   UVar28.z = (fVar25 * fVar8 + fVar27 * fVar9 + fVar26 * fVar11) - fVar24 * fVar10;
		 *   UVar28.w = ((fVar27 * fVar11 - fVar25 * fVar10) - fVar24 * fVar8) - fVar26 * fVar9;
		 *   (this.m_CameraTargetRot).x = UVar28.x;
		 *   (this.m_CameraTargetRot).y = UVar28.y;
		 *   (this.m_CameraTargetRot).z = UVar28.z;
		 *   (this.m_CameraTargetRot).w = UVar28.w;
		 *   if (bVar1 != false) {
		 *     UVar28 = MouseLookHelper.ClampRotationAroundXAxis(this,UVar28);
		 *     (this.m_CameraTargetRot).x = UVar28.x;
		 *     (this.m_CameraTargetRot).y = UVar28.y;
		 *     (this.m_CameraTargetRot).z = UVar28.z;
		 *     (this.m_CameraTargetRot).w = 1.0;
		 *   }
		 *   if (this.smooth == false) {
		 *     if ((character != null) &&
		 *        (UnityEngine.Transform.set_localRotation(character,this.m_CharacterTargetRot), camera != null)) {
		 * LAB_03382230:
		 *       if ((bRam000000000755ff1f & 1) == 0) {
		 *         func_0x031fdc8c(PTR_DAT_0714f6d0,0);
		 *         bRam000000000755ff1f = 1;
		 *       }
		 *       if (camera == null) {
		 *         IL2CPP.ThrowNullReferenceException();
		 *       }
		 *       lVar7 = *(long *)((long)camera + 0x10);
		 *       if (lVar7 == 0) {
		 *         UnityEngine.Bindings.ThrowHelper.ThrowNullReferenceException(camera)
		 *         ;
		 *       }
		 *       if (pcRam000000000755ff80 == null) {
		 *         pcRam000000000755ff80 = (code *)func_0x031fdc50(&UNK_01380e4d);
		 *       }
		 *       (*pcRam000000000755ff80)(lVar7,&stack0xffffffffffffffd0);
		 *       return;
		 *     }
		 *   }
		 *   else if (character != null) {
		 *     UVar29 = UnityEngine.Transform.get_localRotation(character);
		 *     fVar8 = this.smoothTime;
		 *     UVar28 = this.m_CharacterTargetRot;
		 *     fVar10 = UnityEngine.Time.get_deltaTime();
		 *     UVar28 = UnityEngine.Quaternion.Slerp(UVar29,UVar28,fVar8 * fVar10);
		 *     UnityEngine.Transform.set_localRotation(character,UVar28);
		 *     if (camera != null) {
		 *       UVar29 = UnityEngine.Transform.get_localRotation(camera);
		 *       UVar28 = this.m_CameraTargetRot;
		 *       fVar8 = this.smoothTime;
		 *       fVar10 = UnityEngine.Time.get_deltaTime();
		 *       UnityEngine.Quaternion.Slerp(UVar29,UVar28,fVar8 * fVar10);
		 *       goto LAB_03382230;
		 *     }
		 *   }
		 *   IL2CPP.ThrowNullReferenceException();
		 */
		// RVA: 0x3282A88 VA: 0x781896DA88
		private UnityEngine.Quaternion ClampRotationAroundXAxis(UnityEngine.Quaternion q);
		/*
		 *   float fVar1;
		 *   float fVar2;
		 *   float fVar3;
		 *   float fVar4;
		 *   UnityEngine_Vector4 UVar5;
		 *
		 *   fVar4 = q.w;
		 *   fVar1 = (float)func_0x06cb3a20(q.x / fVar4);
		 *   fVar1 = fVar1 * _UNK_0134e99c;
		 *   fVar3 = this.MaximumX;
		 *   if (fVar1 <= this.MaximumX) {
		 *     fVar3 = fVar1;
		 *   }
		 *   fVar2 = this.MinimumX;
		 *   if (this.MinimumX <= fVar1) {
		 *     fVar2 = fVar3;
		 *   }
		 *   UVar5.x = func_0x06cb3a00(fVar2 * _UNK_0134ef5c);
		 *   UVar5.y = q.y / fVar4;
		 *   UVar5.w = 1.0;
		 *   UVar5.z = q.z / fVar4;
		 *   return UVar5;
		 */
		// RVA: 0x32822F0 VA: 0x781896D2F0
		public void .ctor();
		/*
		 *   undefined8 uVar1;
		 *   undefined4 uVar2;
		 *   undefined8 uVar3;
		 *
		 *   uVar1 = _UNK_0134e2a0;
		 *   this.clampVerticalRotation = true;
		 *   uVar3 = _UNK_0134e2a0;
		 *   _UNK_0134e2a0 = (undefined4)uVar1;
		 *   _UNK_0134e2a4 = SUB84(uVar1,4);
		 *   uVar2 = _UNK_0134e2a4;
		 *   this.MinimumX = (float)_UNK_0134e2a0;
		 *   _UNK_0134e2a0 = uVar3;
		 *   this.MaximumX = (float)uVar2;
		 *   this.XSensitivity = 2.0;
		 *   this.YSensitivity = 2.0;
		 *   this.smoothTime = 5.0;
		 *   return;
		 */
	}
}
