using System;
using Il2CppInterop.Common.Attributes;
using Il2CppInterop.Runtime;
using Il2CppInterop.Runtime.InteropTypes.Arrays;
using Il2CppSystem;
using Il2CppSystem.Collections.Generic;
using Il2CppSystem.Reflection;
using UnityEngine;

namespace Obi
{
	// Token: 0x02000556 RID: 1366
	public static class ObiUtils : Il2CppSystem.Object
	{
		// Token: 0x06009A0D RID: 39437 RVA: 0x0027AAB8 File Offset: 0x00278CB8
		[CallerCount(1)]
		[CachedScanResults(RefRangeStart = 645728, RefRangeEnd = 645729, XrefRangeStart = 645721, XrefRangeEnd = 645728, MetadataInitTokenRva = 0L, MetadataInitFlagRva = 0L)]
		public unsafe static void DrawArrowGizmo(float bodyLenght, float bodyWidth, float headLenght, float headWidth)
		{
			IntPtr* ptr;
			checked
			{
				ptr = stackalloc IntPtr[unchecked((UIntPtr)4) * (UIntPtr)sizeof(IntPtr)];
				*ptr = ref bodyLenght;
			}
			ptr[checked(unchecked((UIntPtr)1) * (UIntPtr)sizeof(IntPtr)) / (UIntPtr)sizeof(IntPtr)] = ref bodyWidth;
			ptr[checked(unchecked((UIntPtr)2) * (UIntPtr)sizeof(IntPtr)) / (UIntPtr)sizeof(IntPtr)] = ref headLenght;
			ptr[checked(unchecked((UIntPtr)3) * (UIntPtr)sizeof(IntPtr)) / (UIntPtr)sizeof(IntPtr)] = ref headWidth;
			IntPtr intPtr2;
			IntPtr intPtr = IL2CPP.il2cpp_runtime_invoke(ObiUtils.NativeMethodInfoPtr_DrawArrowGizmo_Public_Static_Void_Single_Single_Single_Single_0, 0, (void**)ptr, ref intPtr2);
			Il2CppException.RaiseExceptionIfNecessary(intPtr2);
		}

		// Token: 0x06009A0E RID: 39438 RVA: 0x0027AB38 File Offset: 0x00278D38
		[CallerCount(0)]
		[CachedScanResults(RefRangeStart = 0, RefRangeEnd = 0, XrefRangeStart = 645729, XrefRangeEnd = 645732, MetadataInitTokenRva = 0L, MetadataInitFlagRva = 0L)]
		public unsafe static void ArrayFill<T>(Il2CppArrayBase<T> arrayToFill, Il2CppArrayBase<T> fillValue)
		{
			IntPtr* ptr;
			checked
			{
				ptr = stackalloc IntPtr[unchecked((UIntPtr)2) * (UIntPtr)sizeof(IntPtr)];
				*ptr = IL2CPP.Il2CppObjectBaseToPtr(arrayToFill);
			}
			ptr[checked(unchecked((UIntPtr)1) * (UIntPtr)sizeof(IntPtr)) / (UIntPtr)sizeof(IntPtr)] = IL2CPP.Il2CppObjectBaseToPtr(fillValue);
			IntPtr intPtr2;
			IntPtr intPtr = IL2CPP.il2cpp_runtime_invoke(ObiUtils.MethodInfoStoreGeneric_ArrayFill_Public_Static_Void_Il2CppArrayBase_1_T_Il2CppArrayBase_1_T_0<T>.Pointer, 0, (void**)ptr, ref intPtr2);
			Il2CppException.RaiseExceptionIfNecessary(intPtr2);
		}

		// Token: 0x06009A0F RID: 39439 RVA: 0x0027AB9C File Offset: 0x00278D9C
		[CallerCount(0)]
		[CachedScanResults(RefRangeStart = 0, RefRangeEnd = 0, XrefRangeStart = 645732, XrefRangeEnd = 645744, MetadataInitTokenRva = 0L, MetadataInitFlagRva = 0L)]
		public unsafe static IList<T> Swap<T>(this IList<T> list, int indexA, int indexB)
		{
			IntPtr* ptr;
			checked
			{
				ptr = stackalloc IntPtr[unchecked((UIntPtr)3) * (UIntPtr)sizeof(IntPtr)];
				*ptr = IL2CPP.Il2CppObjectBaseToPtr(list);
			}
			ptr[checked(unchecked((UIntPtr)1) * (UIntPtr)sizeof(IntPtr)) / (UIntPtr)sizeof(IntPtr)] = ref indexA;
			ptr[checked(unchecked((UIntPtr)2) * (UIntPtr)sizeof(IntPtr)) / (UIntPtr)sizeof(IntPtr)] = ref indexB;
			IntPtr intPtr2;
			IntPtr intPtr = IL2CPP.il2cpp_runtime_invoke(ObiUtils.MethodInfoStoreGeneric_Swap_Public_Static_IList_1_T_IList_1_T_Int32_Int32_0<T>.Pointer, 0, (void**)ptr, ref intPtr2);
			Il2CppException.RaiseExceptionIfNecessary(intPtr2);
			IntPtr intPtr3 = intPtr;
			return (intPtr3 != 0) ? new IList<T>(intPtr3) : null;
		}

		// Token: 0x06009A10 RID: 39440 RVA: 0x0027AC20 File Offset: 0x00278E20
		[CallerCount(0)]
		[CachedScanResults(RefRangeStart = 0, RefRangeEnd = 0, XrefRangeStart = 645744, XrefRangeEnd = 645745, MetadataInitTokenRva = 0L, MetadataInitFlagRva = 0L)]
		public unsafe static void AddRange<T>(ref Il2CppArrayBase<T> array, Il2CppArrayBase<T> other)
		{
			IntPtr* ptr;
			IntPtr intPtr;
			checked
			{
				ptr = stackalloc IntPtr[unchecked((UIntPtr)2) * (UIntPtr)sizeof(IntPtr)];
				ref IntPtr ptr2 = ref *ptr;
				intPtr = IL2CPP.Il2CppObjectBaseToPtr(array);
				ptr2 = &intPtr;
			}
			ptr[checked(unchecked((UIntPtr)1) * (UIntPtr)sizeof(IntPtr)) / (UIntPtr)sizeof(IntPtr)] = IL2CPP.Il2CppObjectBaseToPtr(other);
			IntPtr intPtr3;
			IntPtr intPtr2 = IL2CPP.il2cpp_runtime_invoke(ObiUtils.MethodInfoStoreGeneric_AddRange_Public_Static_Void_byref_Il2CppArrayBase_1_T_Il2CppArrayBase_1_T_0<T>.Pointer, 0, (void**)ptr, ref intPtr3);
			Il2CppException.RaiseExceptionIfNecessary(intPtr3);
			IntPtr intPtr4 = intPtr;
			array = ((intPtr4 == 0) ? null : new Il2CppArrayBase(intPtr4));
		}

		// Token: 0x06009A11 RID: 39441 RVA: 0x0027ACA4 File Offset: 0x00278EA4
		[CallerCount(0)]
		[CachedScanResults(RefRangeStart = 0, RefRangeEnd = 0, XrefRangeStart = 645745, XrefRangeEnd = 645748, MetadataInitTokenRva = 0L, MetadataInitFlagRva = 0L)]
		public unsafe static void RemoveRange<T>(ref Il2CppArrayBase<T> array, int index, int count)
		{
			IntPtr* ptr;
			IntPtr intPtr;
			checked
			{
				ptr = stackalloc IntPtr[unchecked((UIntPtr)3) * (UIntPtr)sizeof(IntPtr)];
				ref IntPtr ptr2 = ref *ptr;
				intPtr = IL2CPP.Il2CppObjectBaseToPtr(array);
				ptr2 = &intPtr;
			}
			ptr[checked(unchecked((UIntPtr)1) * (UIntPtr)sizeof(IntPtr)) / (UIntPtr)sizeof(IntPtr)] = ref index;
			ptr[checked(unchecked((UIntPtr)2) * (UIntPtr)sizeof(IntPtr)) / (UIntPtr)sizeof(IntPtr)] = ref count;
			IntPtr intPtr3;
			IntPtr intPtr2 = IL2CPP.il2cpp_runtime_invoke(ObiUtils.MethodInfoStoreGeneric_RemoveRange_Public_Static_Void_byref_Il2CppArrayBase_1_T_Int32_Int32_0<T>.Pointer, 0, (void**)ptr, ref intPtr3);
			Il2CppException.RaiseExceptionIfNecessary(intPtr3);
			IntPtr intPtr4 = intPtr;
			array = ((intPtr4 == 0) ? null : new Il2CppArrayBase(intPtr4));
		}

		// Token: 0x06009A12 RID: 39442 RVA: 0x0027AD34 File Offset: 0x00278F34
		[CallerCount(1)]
		[CachedScanResults(RefRangeStart = 645799, RefRangeEnd = 645800, XrefRangeStart = 645748, XrefRangeEnd = 645799, MetadataInitTokenRva = 0L, MetadataInitFlagRva = 0L)]
		public unsafe static Bounds Transform(this Bounds b, Matrix4x4 m)
		{
			IntPtr* ptr;
			checked
			{
				ptr = stackalloc IntPtr[unchecked((UIntPtr)2) * (UIntPtr)sizeof(IntPtr)];
				*ptr = ref b;
			}
			ptr[checked(unchecked((UIntPtr)1) * (UIntPtr)sizeof(IntPtr)) / (UIntPtr)sizeof(IntPtr)] = ref m;
			IntPtr intPtr2;
			IntPtr intPtr = IL2CPP.il2cpp_runtime_invoke(ObiUtils.NativeMethodInfoPtr_Transform_Public_Static_Bounds_Bounds_Matrix4x4_0, 0, (void**)ptr, ref intPtr2);
			Il2CppException.RaiseExceptionIfNecessary(intPtr2);
			return *IL2CPP.il2cpp_object_unbox(intPtr);
		}

		// Token: 0x06009A13 RID: 39443 RVA: 0x0027AD9C File Offset: 0x00278F9C
		[CallerCount(0)]
		public unsafe static float Remap(this float value, float from1, float to1, float from2, float to2)
		{
			IntPtr* ptr;
			checked
			{
				ptr = stackalloc IntPtr[unchecked((UIntPtr)5) * (UIntPtr)sizeof(IntPtr)];
				*ptr = ref value;
			}
			ptr[checked(unchecked((UIntPtr)1) * (UIntPtr)sizeof(IntPtr)) / (UIntPtr)sizeof(IntPtr)] = ref from1;
			ptr[checked(unchecked((UIntPtr)2) * (UIntPtr)sizeof(IntPtr)) / (UIntPtr)sizeof(IntPtr)] = ref to1;
			ptr[checked(unchecked((UIntPtr)3) * (UIntPtr)sizeof(IntPtr)) / (UIntPtr)sizeof(IntPtr)] = ref from2;
			ptr[checked(unchecked((UIntPtr)4) * (UIntPtr)sizeof(IntPtr)) / (UIntPtr)sizeof(IntPtr)] = ref to2;
			IntPtr intPtr2;
			IntPtr intPtr = IL2CPP.il2cpp_runtime_invoke(ObiUtils.NativeMethodInfoPtr_Remap_Public_Static_Single_Single_Single_Single_Single_Single_0, 0, (void**)ptr, ref intPtr2);
			Il2CppException.RaiseExceptionIfNecessary(intPtr2);
			return *IL2CPP.il2cpp_object_unbox(intPtr);
		}

		// Token: 0x06009A14 RID: 39444 RVA: 0x0027AE3C File Offset: 0x0027903C
		[CallerCount(2)]
		[CachedScanResults(RefRangeStart = 645801, RefRangeEnd = 645803, XrefRangeStart = 645800, XrefRangeEnd = 645801, MetadataInitTokenRva = 0L, MetadataInitFlagRva = 0L)]
		public unsafe static float Mod(float a, float b)
		{
			IntPtr* ptr;
			checked
			{
				ptr = stackalloc IntPtr[unchecked((UIntPtr)2) * (UIntPtr)sizeof(IntPtr)];
				*ptr = ref a;
			}
			ptr[checked(unchecked((UIntPtr)1) * (UIntPtr)sizeof(IntPtr)) / (UIntPtr)sizeof(IntPtr)] = ref b;
			IntPtr intPtr2;
			IntPtr intPtr = IL2CPP.il2cpp_runtime_invoke(ObiUtils.NativeMethodInfoPtr_Mod_Public_Static_Single_Single_Single_0, 0, (void**)ptr, ref intPtr2);
			Il2CppException.RaiseExceptionIfNecessary(intPtr2);
			return *IL2CPP.il2cpp_object_unbox(intPtr);
		}

		// Token: 0x06009A15 RID: 39445 RVA: 0x0027AEA4 File Offset: 0x002790A4
		[CallerCount(0)]
		[CachedScanResults(RefRangeStart = 0, RefRangeEnd = 0, XrefRangeStart = 645803, XrefRangeEnd = 645807, MetadataInitTokenRva = 0L, MetadataInitFlagRva = 0L)]
		public unsafe static float TriangleArea(Vector3 p1, Vector3 p2, Vector3 p3)
		{
			IntPtr* ptr;
			checked
			{
				ptr = stackalloc IntPtr[unchecked((UIntPtr)3) * (UIntPtr)sizeof(IntPtr)];
				*ptr = ref p1;
			}
			ptr[checked(unchecked((UIntPtr)1) * (UIntPtr)sizeof(IntPtr)) / (UIntPtr)sizeof(IntPtr)] = ref p2;
			ptr[checked(unchecked((UIntPtr)2) * (UIntPtr)sizeof(IntPtr)) / (UIntPtr)sizeof(IntPtr)] = ref p3;
			IntPtr intPtr2;
			IntPtr intPtr = IL2CPP.il2cpp_runtime_invoke(ObiUtils.NativeMethodInfoPtr_TriangleArea_Public_Static_Single_Vector3_Vector3_Vector3_0, 0, (void**)ptr, ref intPtr2);
			Il2CppException.RaiseExceptionIfNecessary(intPtr2);
			return *IL2CPP.il2cpp_object_unbox(intPtr);
		}

		// Token: 0x06009A16 RID: 39446 RVA: 0x0027AF20 File Offset: 0x00279120
		// Note: this type is marked as 'beforefieldinit'.
		static ObiUtils()
		{
			Il2CppClassPointerStore<ObiUtils>.NativeClassPtr = IL2CPP.GetIl2CppClass("Assembly-CSharp.dll", "Obi", "ObiUtils");
			IL2CPP.il2cpp_runtime_class_init(Il2CppClassPointerStore<ObiUtils>.NativeClassPtr);
			ObiUtils.NativeMethodInfoPtr_DrawArrowGizmo_Public_Static_Void_Single_Single_Single_Single_0 = IL2CPP.GetIl2CppMethodByToken(Il2CppClassPointerStore<ObiUtils>.NativeClassPtr, 100675324);
			ObiUtils.NativeMethodInfoPtr_ArrayFill_Public_Static_Void_Il2CppArrayBase_1_T_Il2CppArrayBase_1_T_0 = IL2CPP.GetIl2CppMethodByToken(Il2CppClassPointerStore<ObiUtils>.NativeClassPtr, 100675325);
			ObiUtils.NativeMethodInfoPtr_Swap_Public_Static_IList_1_T_IList_1_T_Int32_Int32_0 = IL2CPP.GetIl2CppMethodByToken(Il2CppClassPointerStore<ObiUtils>.NativeClassPtr, 100675326);
			ObiUtils.NativeMethodInfoPtr_AddRange_Public_Static_Void_byref_Il2CppArrayBase_1_T_Il2CppArrayBase_1_T_0 = IL2CPP.GetIl2CppMethodByToken(Il2CppClassPointerStore<ObiUtils>.NativeClassPtr, 100675327);
			ObiUtils.NativeMethodInfoPtr_RemoveRange_Public_Static_Void_byref_Il2CppArrayBase_1_T_Int32_Int32_0 = IL2CPP.GetIl2CppMethodByToken(Il2CppClassPointerStore<ObiUtils>.NativeClassPtr, 100675328);
			ObiUtils.NativeMethodInfoPtr_Transform_Public_Static_Bounds_Bounds_Matrix4x4_0 = IL2CPP.GetIl2CppMethodByToken(Il2CppClassPointerStore<ObiUtils>.NativeClassPtr, 100675329);
			ObiUtils.NativeMethodInfoPtr_Remap_Public_Static_Single_Single_Single_Single_Single_Single_0 = IL2CPP.GetIl2CppMethodByToken(Il2CppClassPointerStore<ObiUtils>.NativeClassPtr, 100675330);
			ObiUtils.NativeMethodInfoPtr_Mod_Public_Static_Single_Single_Single_0 = IL2CPP.GetIl2CppMethodByToken(Il2CppClassPointerStore<ObiUtils>.NativeClassPtr, 100675331);
			ObiUtils.NativeMethodInfoPtr_TriangleArea_Public_Static_Single_Vector3_Vector3_Vector3_0 = IL2CPP.GetIl2CppMethodByToken(Il2CppClassPointerStore<ObiUtils>.NativeClassPtr, 100675332);
		}

		// Token: 0x06009A17 RID: 39447 RVA: 0x0000A74C File Offset: 0x0000894C
		public ObiUtils(IntPtr pointer)
			: base(pointer)
		{
		}

		// Token: 0x040066CD RID: 26317
		private static readonly IntPtr NativeMethodInfoPtr_DrawArrowGizmo_Public_Static_Void_Single_Single_Single_Single_0;

		// Token: 0x040066CE RID: 26318
		private static readonly IntPtr NativeMethodInfoPtr_ArrayFill_Public_Static_Void_Il2CppArrayBase_1_T_Il2CppArrayBase_1_T_0;

		// Token: 0x040066CF RID: 26319
		private static readonly IntPtr NativeMethodInfoPtr_Swap_Public_Static_IList_1_T_IList_1_T_Int32_Int32_0;

		// Token: 0x040066D0 RID: 26320
		private static readonly IntPtr NativeMethodInfoPtr_AddRange_Public_Static_Void_byref_Il2CppArrayBase_1_T_Il2CppArrayBase_1_T_0;

		// Token: 0x040066D1 RID: 26321
		private static readonly IntPtr NativeMethodInfoPtr_RemoveRange_Public_Static_Void_byref_Il2CppArrayBase_1_T_Int32_Int32_0;

		// Token: 0x040066D2 RID: 26322
		private static readonly IntPtr NativeMethodInfoPtr_Transform_Public_Static_Bounds_Bounds_Matrix4x4_0;

		// Token: 0x040066D3 RID: 26323
		private static readonly IntPtr NativeMethodInfoPtr_Remap_Public_Static_Single_Single_Single_Single_Single_Single_0;

		// Token: 0x040066D4 RID: 26324
		private static readonly IntPtr NativeMethodInfoPtr_Mod_Public_Static_Single_Single_Single_0;

		// Token: 0x040066D5 RID: 26325
		private static readonly IntPtr NativeMethodInfoPtr_TriangleArea_Public_Static_Single_Vector3_Vector3_Vector3_0;

		// Token: 0x02000557 RID: 1367
		private sealed class MethodInfoStoreGeneric_ArrayFill_Public_Static_Void_Il2CppArrayBase_1_T_Il2CppArrayBase_1_T_0<T>
		{
			// Token: 0x040066D6 RID: 26326
			internal static IntPtr Pointer = IL2CPP.il2cpp_method_get_from_reflection(IL2CPP.Il2CppObjectBaseToPtrNotNull(new MethodInfo(IL2CPP.il2cpp_method_get_object(ObiUtils.NativeMethodInfoPtr_ArrayFill_Public_Static_Void_Il2CppArrayBase_1_T_Il2CppArrayBase_1_T_0, Il2CppClassPointerStore<ObiUtils>.NativeClassPtr)).MakeGenericMethod(new Il2CppReferenceArray<Type>(new Type[] { Type.internal_from_handle(IL2CPP.il2cpp_class_get_type(Il2CppClassPointerStore<T>.NativeClassPtr)) }))));
		}

		// Token: 0x02000558 RID: 1368
		private sealed class MethodInfoStoreGeneric_Swap_Public_Static_IList_1_T_IList_1_T_Int32_Int32_0<T>
		{
			// Token: 0x040066D7 RID: 26327
			internal static IntPtr Pointer = IL2CPP.il2cpp_method_get_from_reflection(IL2CPP.Il2CppObjectBaseToPtrNotNull(new MethodInfo(IL2CPP.il2cpp_method_get_object(ObiUtils.NativeMethodInfoPtr_Swap_Public_Static_IList_1_T_IList_1_T_Int32_Int32_0, Il2CppClassPointerStore<ObiUtils>.NativeClassPtr)).MakeGenericMethod(new Il2CppReferenceArray<Type>(new Type[] { Type.internal_from_handle(IL2CPP.il2cpp_class_get_type(Il2CppClassPointerStore<T>.NativeClassPtr)) }))));
		}

		// Token: 0x02000559 RID: 1369
		private sealed class MethodInfoStoreGeneric_AddRange_Public_Static_Void_byref_Il2CppArrayBase_1_T_Il2CppArrayBase_1_T_0<T>
		{
			// Token: 0x040066D8 RID: 26328
			internal static IntPtr Pointer = IL2CPP.il2cpp_method_get_from_reflection(IL2CPP.Il2CppObjectBaseToPtrNotNull(new MethodInfo(IL2CPP.il2cpp_method_get_object(ObiUtils.NativeMethodInfoPtr_AddRange_Public_Static_Void_byref_Il2CppArrayBase_1_T_Il2CppArrayBase_1_T_0, Il2CppClassPointerStore<ObiUtils>.NativeClassPtr)).MakeGenericMethod(new Il2CppReferenceArray<Type>(new Type[] { Type.internal_from_handle(IL2CPP.il2cpp_class_get_type(Il2CppClassPointerStore<T>.NativeClassPtr)) }))));
		}

		// Token: 0x0200055A RID: 1370
		private sealed class MethodInfoStoreGeneric_RemoveRange_Public_Static_Void_byref_Il2CppArrayBase_1_T_Int32_Int32_0<T>
		{
			// Token: 0x040066D9 RID: 26329
			internal static IntPtr Pointer = IL2CPP.il2cpp_method_get_from_reflection(IL2CPP.Il2CppObjectBaseToPtrNotNull(new MethodInfo(IL2CPP.il2cpp_method_get_object(ObiUtils.NativeMethodInfoPtr_RemoveRange_Public_Static_Void_byref_Il2CppArrayBase_1_T_Int32_Int32_0, Il2CppClassPointerStore<ObiUtils>.NativeClassPtr)).MakeGenericMethod(new Il2CppReferenceArray<Type>(new Type[] { Type.internal_from_handle(IL2CPP.il2cpp_class_get_type(Il2CppClassPointerStore<T>.NativeClassPtr)) }))));
		}
	}
}
