using System;
using System.Collections.Generic;
using Cpp2IlInjected;
using UnityEngine;

namespace Obi
{
	// Token: 0x020004B3 RID: 1203
	[Token(Token = "0x20004B3")]
	[DisallowMultipleComponent]
	public class ObiAerodynamicConstraints : ObiBatchedConstraints
	{
		// Token: 0x06002AB3 RID: 10931 RVA: 0x0005CEB8 File Offset: 0x0005B0B8
		[Token(Token = "0x6002AB3")]
		[Address(RVA = "0x43BB70", Offset = "0x43A970", VA = "0x18043BB70", Slot = "8")]
		public override Oni.ConstraintType GetConstraintType()
		{
			return Oni.ConstraintType.Aerodynamics;
		}

		// Token: 0x06002AB4 RID: 10932 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x6002AB4")]
		[Address(RVA = "0xFFB2E0", Offset = "0xFFA0E0", VA = "0x180FFB2E0", Slot = "9")]
		public override List<ObiConstraintBatch> GetBatches()
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x06002AB5 RID: 10933 RVA: 0x0005CEC8 File Offset: 0x0005B0C8
		[Token(Token = "0x6002AB5")]
		[Address(RVA = "0xFFB6C0", Offset = "0xFFA4C0", VA = "0x180FFB6C0")]
		public void OnValidate()
		{
			float num = this.airDensity;
			float num2 = Mathf.Max((float)0, num);
			float num3 = this.dragCoefficient;
			this.airDensity = num2;
			float num4 = Mathf.Max((float)0, num3);
			float num5 = this.liftCoefficient;
			this.dragCoefficient = num4;
			float num6 = Mathf.Max((float)0, num5);
			this.liftCoefficient = num6;
		}

		// Token: 0x06002AB6 RID: 10934 RVA: 0x0005CF1C File Offset: 0x0005B11C
		[Token(Token = "0x6002AB6")]
		[Address(RVA = "0xFFB280", Offset = "0xFFA080", VA = "0x180FFB280", Slot = "10")]
		public override void Clear()
		{
			int num = 0;
			bool flag = base.RemoveFromSolver(num);
			this.batches.Clear();
		}

		// Token: 0x06002AB7 RID: 10935 RVA: 0x0005CF44 File Offset: 0x0005B144
		[Token(Token = "0x6002AB7")]
		[Address(RVA = "0xFFB1E0", Offset = "0xFF9FE0", VA = "0x180FFB1E0")]
		public void AddBatch(ObiAerodynamicConstraintBatch batch)
		{
			if (batch != 0)
			{
				int constraintType = (int)batch.GetConstraintType();
				Oni.ConstraintType constraintType2 = this.GetConstraintType();
				if (constraintType == (int)constraintType2)
				{
					this.batches.Add(batch);
				}
			}
		}

		// Token: 0x06002AB8 RID: 10936 RVA: 0x0005CF7C File Offset: 0x0005B17C
		[Token(Token = "0x6002AB8")]
		[Address(RVA = "0xFFB710", Offset = "0xFFA510", VA = "0x180FFB710")]
		public void RemoveBatch(ObiAerodynamicConstraintBatch batch)
		{
			bool flag = this.batches.Remove(batch);
		}

		// Token: 0x06002AB9 RID: 10937 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x6002AB9")]
		[Address(RVA = "0xFFB410", Offset = "0xFFA210", VA = "0x180FFB410")]
		public void OnDrawGizmosSelected()
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x06002ABA RID: 10938 RVA: 0x0005CF9C File Offset: 0x0005B19C
		[Token(Token = "0x6002ABA")]
		[Address(RVA = "0xFFB770", Offset = "0xFFA570", VA = "0x180FFB770")]
		public ObiAerodynamicConstraints()
		{
			List<ObiAerodynamicConstraintBatch> list = new List();
			this.batches = list;
			base..ctor();
		}

		// Token: 0x0400336C RID: 13164
		[FieldOffset(Offset = "0x30")]
		[Token(Token = "0x400336C")]
		[Tooltip("Air density in kg/m3. Higher densities will make both drag and lift forces stronger.")]
		public float airDensity = 1.225f;

		// Token: 0x0400336D RID: 13165
		[FieldOffset(Offset = "0x34")]
		[Token(Token = "0x400336D")]
		[Tooltip("How much is the cloth affected by drag forces. Extreme values can cause the cloth to behave unrealistically, so use with care.")]
		public float dragCoefficient = 0.05f;

		// Token: 0x0400336E RID: 13166
		[FieldOffset(Offset = "0x38")]
		[Token(Token = "0x400336E")]
		[Tooltip("How much is the cloth affected by lift forces. Extreme values can cause the cloth to behave unrealistically, so use with care.")]
		public float liftCoefficient = 0.05f;

		// Token: 0x0400336F RID: 13167
		[FieldOffset(Offset = "0x40")]
		[Token(Token = "0x400336F")]
		[HideInInspector]
		[SerializeField]
		private List<ObiAerodynamicConstraintBatch> batches;
	}
}
