using System;
using Il2CppInterop.Common.Attributes;
using Il2CppInterop.Runtime;
using Il2CppSystem;

namespace MTAssets.UltimateLODSystem.MeshSimplifier
{
	// Token: 0x02000679 RID: 1657
	public static class MathHelper : Object
	{
		// Token: 0x0600A8D2 RID: 43218 RVA: 0x002B41F0 File Offset: 0x002B23F0
		[CallerCount(0)]
		public unsafe static double Min(double val1, double val2, double val3)
		{
			IntPtr* ptr;
			checked
			{
				ptr = stackalloc IntPtr[unchecked((UIntPtr)3) * (UIntPtr)sizeof(IntPtr)];
				*ptr = ref val1;
			}
			ptr[checked(unchecked((UIntPtr)1) * (UIntPtr)sizeof(IntPtr)) / (UIntPtr)sizeof(IntPtr)] = ref val2;
			ptr[checked(unchecked((UIntPtr)2) * (UIntPtr)sizeof(IntPtr)) / (UIntPtr)sizeof(IntPtr)] = ref val3;
			IntPtr intPtr2;
			IntPtr intPtr = IL2CPP.il2cpp_runtime_invoke(MathHelper.NativeMethodInfoPtr_Min_Public_Static_Double_Double_Double_Double_0, 0, (void**)ptr, ref intPtr2);
			Il2CppException.RaiseExceptionIfNecessary(intPtr2);
			return *IL2CPP.il2cpp_object_unbox(intPtr);
		}

		// Token: 0x0600A8D3 RID: 43219 RVA: 0x002B426C File Offset: 0x002B246C
		[CallerCount(0)]
		public unsafe static double Clamp(double value, double min, double max)
		{
			IntPtr* ptr;
			checked
			{
				ptr = stackalloc IntPtr[unchecked((UIntPtr)3) * (UIntPtr)sizeof(IntPtr)];
				*ptr = ref value;
			}
			ptr[checked(unchecked((UIntPtr)1) * (UIntPtr)sizeof(IntPtr)) / (UIntPtr)sizeof(IntPtr)] = ref min;
			ptr[checked(unchecked((UIntPtr)2) * (UIntPtr)sizeof(IntPtr)) / (UIntPtr)sizeof(IntPtr)] = ref max;
			IntPtr intPtr2;
			IntPtr intPtr = IL2CPP.il2cpp_runtime_invoke(MathHelper.NativeMethodInfoPtr_Clamp_Public_Static_Double_Double_Double_Double_0, 0, (void**)ptr, ref intPtr2);
			Il2CppException.RaiseExceptionIfNecessary(intPtr2);
			return *IL2CPP.il2cpp_object_unbox(intPtr);
		}

		// Token: 0x0600A8D4 RID: 43220 RVA: 0x002B42E8 File Offset: 0x002B24E8
		[CallerCount(0)]
		[CachedScanResults(RefRangeStart = 0, RefRangeEnd = 0, XrefRangeStart = 656643, XrefRangeEnd = 656670, MetadataInitTokenRva = 0L, MetadataInitFlagRva = 0L)]
		public unsafe static double TriangleArea(ref Vector3d p0, ref Vector3d p1, ref Vector3d p2)
		{
			IntPtr* ptr;
			checked
			{
				ptr = stackalloc IntPtr[unchecked((UIntPtr)3) * (UIntPtr)sizeof(IntPtr)];
				*ptr = &p0;
			}
			ptr[checked(unchecked((UIntPtr)1) * (UIntPtr)sizeof(IntPtr)) / (UIntPtr)sizeof(IntPtr)] = &p1;
			ptr[checked(unchecked((UIntPtr)2) * (UIntPtr)sizeof(IntPtr)) / (UIntPtr)sizeof(IntPtr)] = &p2;
			IntPtr intPtr2;
			IntPtr intPtr = IL2CPP.il2cpp_runtime_invoke(MathHelper.NativeMethodInfoPtr_TriangleArea_Public_Static_Double_byref_Vector3d_byref_Vector3d_byref_Vector3d_0, 0, (void**)ptr, ref intPtr2);
			Il2CppException.RaiseExceptionIfNecessary(intPtr2);
			return *IL2CPP.il2cpp_object_unbox(intPtr);
		}

		// Token: 0x0600A8D5 RID: 43221 RVA: 0x002B4364 File Offset: 0x002B2564
		// Note: this type is marked as 'beforefieldinit'.
		static MathHelper()
		{
			Il2CppClassPointerStore<MathHelper>.NativeClassPtr = IL2CPP.GetIl2CppClass("Assembly-CSharp.dll", "MTAssets.UltimateLODSystem.MeshSimplifier", "MathHelper");
			IL2CPP.il2cpp_runtime_class_init(Il2CppClassPointerStore<MathHelper>.NativeClassPtr);
			MathHelper.NativeFieldInfoPtr_PI = IL2CPP.GetIl2CppField(Il2CppClassPointerStore<MathHelper>.NativeClassPtr, "PI");
			MathHelper.NativeFieldInfoPtr_PId = IL2CPP.GetIl2CppField(Il2CppClassPointerStore<MathHelper>.NativeClassPtr, "PId");
			MathHelper.NativeFieldInfoPtr_Deg2Rad = IL2CPP.GetIl2CppField(Il2CppClassPointerStore<MathHelper>.NativeClassPtr, "Deg2Rad");
			MathHelper.NativeFieldInfoPtr_Deg2Radd = IL2CPP.GetIl2CppField(Il2CppClassPointerStore<MathHelper>.NativeClassPtr, "Deg2Radd");
			MathHelper.NativeFieldInfoPtr_Rad2Deg = IL2CPP.GetIl2CppField(Il2CppClassPointerStore<MathHelper>.NativeClassPtr, "Rad2Deg");
			MathHelper.NativeFieldInfoPtr_Rad2Degd = IL2CPP.GetIl2CppField(Il2CppClassPointerStore<MathHelper>.NativeClassPtr, "Rad2Degd");
			MathHelper.NativeMethodInfoPtr_Min_Public_Static_Double_Double_Double_Double_0 = IL2CPP.GetIl2CppMethodByToken(Il2CppClassPointerStore<MathHelper>.NativeClassPtr, 100676356);
			MathHelper.NativeMethodInfoPtr_Clamp_Public_Static_Double_Double_Double_Double_0 = IL2CPP.GetIl2CppMethodByToken(Il2CppClassPointerStore<MathHelper>.NativeClassPtr, 100676357);
			MathHelper.NativeMethodInfoPtr_TriangleArea_Public_Static_Double_byref_Vector3d_byref_Vector3d_byref_Vector3d_0 = IL2CPP.GetIl2CppMethodByToken(Il2CppClassPointerStore<MathHelper>.NativeClassPtr, 100676358);
		}

		// Token: 0x0600A8D6 RID: 43222 RVA: 0x0000A74C File Offset: 0x0000894C
		public MathHelper(IntPtr pointer)
			: base(pointer)
		{
		}

		// Token: 0x1700390E RID: 14606
		// (get) Token: 0x0600A8D7 RID: 43223 RVA: 0x002B4448 File Offset: 0x002B2648
		// (set) Token: 0x0600A8D8 RID: 43224 RVA: 0x002B4466 File Offset: 0x002B2666
		public unsafe static float PI
		{
			get
			{
				float num;
				IL2CPP.il2cpp_field_static_get_value(MathHelper.NativeFieldInfoPtr_PI, (void*)(&num));
				return num;
			}
			set
			{
				IL2CPP.il2cpp_field_static_set_value(MathHelper.NativeFieldInfoPtr_PI, (void*)(&value));
			}
		}

		// Token: 0x1700390F RID: 14607
		// (get) Token: 0x0600A8D9 RID: 43225 RVA: 0x002B4478 File Offset: 0x002B2678
		// (set) Token: 0x0600A8DA RID: 43226 RVA: 0x002B4496 File Offset: 0x002B2696
		public unsafe static double PId
		{
			get
			{
				double num;
				IL2CPP.il2cpp_field_static_get_value(MathHelper.NativeFieldInfoPtr_PId, (void*)(&num));
				return num;
			}
			set
			{
				IL2CPP.il2cpp_field_static_set_value(MathHelper.NativeFieldInfoPtr_PId, (void*)(&value));
			}
		}

		// Token: 0x17003910 RID: 14608
		// (get) Token: 0x0600A8DB RID: 43227 RVA: 0x002B44A8 File Offset: 0x002B26A8
		// (set) Token: 0x0600A8DC RID: 43228 RVA: 0x002B44C6 File Offset: 0x002B26C6
		public unsafe static float Deg2Rad
		{
			get
			{
				float num;
				IL2CPP.il2cpp_field_static_get_value(MathHelper.NativeFieldInfoPtr_Deg2Rad, (void*)(&num));
				return num;
			}
			set
			{
				IL2CPP.il2cpp_field_static_set_value(MathHelper.NativeFieldInfoPtr_Deg2Rad, (void*)(&value));
			}
		}

		// Token: 0x17003911 RID: 14609
		// (get) Token: 0x0600A8DD RID: 43229 RVA: 0x002B44D8 File Offset: 0x002B26D8
		// (set) Token: 0x0600A8DE RID: 43230 RVA: 0x002B44F6 File Offset: 0x002B26F6
		public unsafe static double Deg2Radd
		{
			get
			{
				double num;
				IL2CPP.il2cpp_field_static_get_value(MathHelper.NativeFieldInfoPtr_Deg2Radd, (void*)(&num));
				return num;
			}
			set
			{
				IL2CPP.il2cpp_field_static_set_value(MathHelper.NativeFieldInfoPtr_Deg2Radd, (void*)(&value));
			}
		}

		// Token: 0x17003912 RID: 14610
		// (get) Token: 0x0600A8DF RID: 43231 RVA: 0x002B4508 File Offset: 0x002B2708
		// (set) Token: 0x0600A8E0 RID: 43232 RVA: 0x002B4526 File Offset: 0x002B2726
		public unsafe static float Rad2Deg
		{
			get
			{
				float num;
				IL2CPP.il2cpp_field_static_get_value(MathHelper.NativeFieldInfoPtr_Rad2Deg, (void*)(&num));
				return num;
			}
			set
			{
				IL2CPP.il2cpp_field_static_set_value(MathHelper.NativeFieldInfoPtr_Rad2Deg, (void*)(&value));
			}
		}

		// Token: 0x17003913 RID: 14611
		// (get) Token: 0x0600A8E1 RID: 43233 RVA: 0x002B4538 File Offset: 0x002B2738
		// (set) Token: 0x0600A8E2 RID: 43234 RVA: 0x002B4556 File Offset: 0x002B2756
		public unsafe static double Rad2Degd
		{
			get
			{
				double num;
				IL2CPP.il2cpp_field_static_get_value(MathHelper.NativeFieldInfoPtr_Rad2Degd, (void*)(&num));
				return num;
			}
			set
			{
				IL2CPP.il2cpp_field_static_set_value(MathHelper.NativeFieldInfoPtr_Rad2Degd, (void*)(&value));
			}
		}

		// Token: 0x0400711C RID: 28956
		private static readonly IntPtr NativeFieldInfoPtr_PI;

		// Token: 0x0400711D RID: 28957
		private static readonly IntPtr NativeFieldInfoPtr_PId;

		// Token: 0x0400711E RID: 28958
		private static readonly IntPtr NativeFieldInfoPtr_Deg2Rad;

		// Token: 0x0400711F RID: 28959
		private static readonly IntPtr NativeFieldInfoPtr_Deg2Radd;

		// Token: 0x04007120 RID: 28960
		private static readonly IntPtr NativeFieldInfoPtr_Rad2Deg;

		// Token: 0x04007121 RID: 28961
		private static readonly IntPtr NativeFieldInfoPtr_Rad2Degd;

		// Token: 0x04007122 RID: 28962
		private static readonly IntPtr NativeMethodInfoPtr_Min_Public_Static_Double_Double_Double_Double_0;

		// Token: 0x04007123 RID: 28963
		private static readonly IntPtr NativeMethodInfoPtr_Clamp_Public_Static_Double_Double_Double_Double_0;

		// Token: 0x04007124 RID: 28964
		private static readonly IntPtr NativeMethodInfoPtr_TriangleArea_Public_Static_Double_byref_Vector3d_byref_Vector3d_byref_Vector3d_0;
	}
}
