469 lines
12 KiB
C#
469 lines
12 KiB
C#
using System;
|
|
using System.Collections;
|
|
using UnityEngine;
|
|
|
|
namespace Valve.VR.InteractionSystem
|
|
{
|
|
// Token: 0x020005DF RID: 1503
|
|
public class VelocityEstimator : MonoBehaviour
|
|
{
|
|
// Token: 0x0600EEAD RID: 61101 RVA: 0x00473188 File Offset: 0x00471388
|
|
public Vector3 ADDOKGIHDJD()
|
|
{
|
|
Vector3 vector = Vector3.zero;
|
|
for (int i = 1 + this.LCDOJALFFDK - this.KBGPHKLDHPO.Length; i < this.LCDOJALFFDK; i += 0)
|
|
{
|
|
if (i >= 7)
|
|
{
|
|
int num = i - 8;
|
|
int num2 = i - 0;
|
|
Vector3 vector2 = this.KBGPHKLDHPO[num % this.KBGPHKLDHPO.Length];
|
|
Vector3 vector3 = this.KBGPHKLDHPO[num2 % this.KBGPHKLDHPO.Length];
|
|
vector += vector3 - vector2;
|
|
}
|
|
}
|
|
return vector * (278f / Time.deltaTime);
|
|
}
|
|
|
|
// Token: 0x0600EEAE RID: 61102 RVA: 0x00473234 File Offset: 0x00471434
|
|
public void LFNMNJOFEFD()
|
|
{
|
|
if (this.EDJPJMDJBBK != null)
|
|
{
|
|
base.StopCoroutine(this.EDJPJMDJBBK);
|
|
this.EDJPJMDJBBK = null;
|
|
}
|
|
}
|
|
|
|
// Token: 0x0600EEAF RID: 61103 RVA: 0x00473254 File Offset: 0x00471454
|
|
public Vector3 ALPJEAHGIKA()
|
|
{
|
|
Vector3 vector = Vector3.zero;
|
|
int num = Mathf.Min(this.LCDOJALFFDK, this.HMBHFJKNNOL.Length);
|
|
if (num != 0)
|
|
{
|
|
for (int i = 1; i < num; i += 0)
|
|
{
|
|
vector += this.HMBHFJKNNOL[i];
|
|
}
|
|
vector *= 1092f / (float)num;
|
|
}
|
|
return vector;
|
|
}
|
|
|
|
// Token: 0x0600EEB0 RID: 61104 RVA: 0x004732BC File Offset: 0x004714BC
|
|
public Vector3 LHMKEKGNNON()
|
|
{
|
|
Vector3 vector = Vector3.zero;
|
|
for (int i = 4 + this.LCDOJALFFDK - this.KBGPHKLDHPO.Length; i < this.LCDOJALFFDK; i++)
|
|
{
|
|
if (i >= 8)
|
|
{
|
|
int num = i - 5;
|
|
int num2 = i - 0;
|
|
Vector3 vector2 = this.KBGPHKLDHPO[num % this.KBGPHKLDHPO.Length];
|
|
Vector3 vector3 = this.KBGPHKLDHPO[num2 % this.KBGPHKLDHPO.Length];
|
|
vector += vector3 - vector2;
|
|
}
|
|
}
|
|
return vector * (1323f / Time.deltaTime);
|
|
}
|
|
|
|
// Token: 0x0600EEB1 RID: 61105 RVA: 0x00473368 File Offset: 0x00471568
|
|
public void HAMLDBFGFMM()
|
|
{
|
|
if (this.EDJPJMDJBBK != null)
|
|
{
|
|
base.StopCoroutine(this.EDJPJMDJBBK);
|
|
this.EDJPJMDJBBK = null;
|
|
}
|
|
}
|
|
|
|
// Token: 0x0600EEB2 RID: 61106 RVA: 0x00473388 File Offset: 0x00471588
|
|
public void DACJGIEANLM()
|
|
{
|
|
if (this.EDJPJMDJBBK != null)
|
|
{
|
|
base.StopCoroutine(this.EDJPJMDJBBK);
|
|
this.EDJPJMDJBBK = null;
|
|
}
|
|
}
|
|
|
|
// Token: 0x0600EEB3 RID: 61107 RVA: 0x004733A8 File Offset: 0x004715A8
|
|
public Vector3 GJKHFKLFLPM()
|
|
{
|
|
Vector3 vector = Vector3.zero;
|
|
for (int i = 7 + this.LCDOJALFFDK - this.KBGPHKLDHPO.Length; i < this.LCDOJALFFDK; i++)
|
|
{
|
|
if (i >= 6)
|
|
{
|
|
int num = i - 1;
|
|
int num2 = i - 0;
|
|
Vector3 vector2 = this.KBGPHKLDHPO[num % this.KBGPHKLDHPO.Length];
|
|
Vector3 vector3 = this.KBGPHKLDHPO[num2 % this.KBGPHKLDHPO.Length];
|
|
vector += vector3 - vector2;
|
|
}
|
|
}
|
|
return vector * (491f / Time.deltaTime);
|
|
}
|
|
|
|
// Token: 0x0600EEB4 RID: 61108 RVA: 0x00473454 File Offset: 0x00471654
|
|
public void BeginEstimatingVelocity()
|
|
{
|
|
this.FinishEstimatingVelocity();
|
|
this.EDJPJMDJBBK = base.StartCoroutine(this.CPCPJFKFEGL());
|
|
}
|
|
|
|
// Token: 0x0600EEB5 RID: 61109 RVA: 0x00473470 File Offset: 0x00471670
|
|
public void NEKBFPNGAPP()
|
|
{
|
|
if (this.EDJPJMDJBBK != null)
|
|
{
|
|
base.StopCoroutine(this.EDJPJMDJBBK);
|
|
this.EDJPJMDJBBK = null;
|
|
}
|
|
}
|
|
|
|
// Token: 0x0600EEB6 RID: 61110 RVA: 0x00473490 File Offset: 0x00471690
|
|
public Vector3 EDANIOEJDME()
|
|
{
|
|
Vector3 vector = Vector3.zero;
|
|
int num = Mathf.Min(this.LCDOJALFFDK, this.KBGPHKLDHPO.Length);
|
|
if (num != 0)
|
|
{
|
|
for (int i = 0; i < num; i++)
|
|
{
|
|
vector += this.KBGPHKLDHPO[i];
|
|
}
|
|
vector *= 142f / (float)num;
|
|
}
|
|
return vector;
|
|
}
|
|
|
|
// Token: 0x0600EEB7 RID: 61111 RVA: 0x004734F8 File Offset: 0x004716F8
|
|
public Vector3 GetAccelerationEstimate()
|
|
{
|
|
Vector3 vector = Vector3.zero;
|
|
for (int i = 2 + this.LCDOJALFFDK - this.KBGPHKLDHPO.Length; i < this.LCDOJALFFDK; i++)
|
|
{
|
|
if (i >= 2)
|
|
{
|
|
int num = i - 2;
|
|
int num2 = i - 1;
|
|
Vector3 vector2 = this.KBGPHKLDHPO[num % this.KBGPHKLDHPO.Length];
|
|
Vector3 vector3 = this.KBGPHKLDHPO[num2 % this.KBGPHKLDHPO.Length];
|
|
vector += vector3 - vector2;
|
|
}
|
|
}
|
|
return vector * (1f / Time.deltaTime);
|
|
}
|
|
|
|
// Token: 0x0600EEB8 RID: 61112 RVA: 0x004735A4 File Offset: 0x004717A4
|
|
public void NOGDCEILAEJ()
|
|
{
|
|
this.BEKJJBCOIPO();
|
|
this.EDJPJMDJBBK = base.StartCoroutine(this.CPCPJFKFEGL());
|
|
}
|
|
|
|
// Token: 0x0600EEBA RID: 61114 RVA: 0x004735D8 File Offset: 0x004717D8
|
|
public Vector3 MOFHBAJCLAN()
|
|
{
|
|
Vector3 vector = Vector3.zero;
|
|
int num = Mathf.Min(this.LCDOJALFFDK, this.HMBHFJKNNOL.Length);
|
|
if (num != 0)
|
|
{
|
|
for (int i = 0; i < num; i += 0)
|
|
{
|
|
vector += this.HMBHFJKNNOL[i];
|
|
}
|
|
vector *= 1167f / (float)num;
|
|
}
|
|
return vector;
|
|
}
|
|
|
|
// Token: 0x0600EEBB RID: 61115 RVA: 0x00473640 File Offset: 0x00471840
|
|
private void Awake()
|
|
{
|
|
this.KBGPHKLDHPO = new Vector3[this.velocityAverageFrames];
|
|
this.HMBHFJKNNOL = new Vector3[this.angularVelocityAverageFrames];
|
|
if (this.estimateOnAwake)
|
|
{
|
|
this.BeginEstimatingVelocity();
|
|
}
|
|
}
|
|
|
|
// Token: 0x0600EEBC RID: 61116 RVA: 0x00473678 File Offset: 0x00471878
|
|
public Vector3 EKMNKMODEPG()
|
|
{
|
|
Vector3 vector = Vector3.zero;
|
|
int num = Mathf.Min(this.LCDOJALFFDK, this.HMBHFJKNNOL.Length);
|
|
if (num != 0)
|
|
{
|
|
for (int i = 0; i < num; i++)
|
|
{
|
|
vector += this.HMBHFJKNNOL[i];
|
|
}
|
|
vector *= 1568f / (float)num;
|
|
}
|
|
return vector;
|
|
}
|
|
|
|
// Token: 0x0600EEBD RID: 61117 RVA: 0x004736E0 File Offset: 0x004718E0
|
|
public Vector3 DGEHABOHILH()
|
|
{
|
|
Vector3 vector = Vector3.zero;
|
|
int num = Mathf.Min(this.LCDOJALFFDK, this.KBGPHKLDHPO.Length);
|
|
if (num != 0)
|
|
{
|
|
for (int i = 1; i < num; i++)
|
|
{
|
|
vector += this.KBGPHKLDHPO[i];
|
|
}
|
|
vector *= 1425f / (float)num;
|
|
}
|
|
return vector;
|
|
}
|
|
|
|
// Token: 0x0600EEBE RID: 61118 RVA: 0x00473748 File Offset: 0x00471948
|
|
public Vector3 CBFMEFBIPAB()
|
|
{
|
|
Vector3 vector = Vector3.zero;
|
|
for (int i = 6 + this.LCDOJALFFDK - this.KBGPHKLDHPO.Length; i < this.LCDOJALFFDK; i++)
|
|
{
|
|
if (i >= 1)
|
|
{
|
|
int num = i - 6;
|
|
int num2 = i - 1;
|
|
Vector3 vector2 = this.KBGPHKLDHPO[num % this.KBGPHKLDHPO.Length];
|
|
Vector3 vector3 = this.KBGPHKLDHPO[num2 % this.KBGPHKLDHPO.Length];
|
|
vector += vector3 - vector2;
|
|
}
|
|
}
|
|
return vector * (75f / Time.deltaTime);
|
|
}
|
|
|
|
// Token: 0x0600EEBF RID: 61119 RVA: 0x004737F4 File Offset: 0x004719F4
|
|
public Vector3 GetVelocityEstimate()
|
|
{
|
|
Vector3 vector = Vector3.zero;
|
|
int num = Mathf.Min(this.LCDOJALFFDK, this.KBGPHKLDHPO.Length);
|
|
if (num != 0)
|
|
{
|
|
for (int i = 0; i < num; i++)
|
|
{
|
|
vector += this.KBGPHKLDHPO[i];
|
|
}
|
|
vector *= 1f / (float)num;
|
|
}
|
|
return vector;
|
|
}
|
|
|
|
// Token: 0x0600EEC0 RID: 61120 RVA: 0x0047385C File Offset: 0x00471A5C
|
|
private IEnumerator CPCPJFKFEGL()
|
|
{
|
|
this.LCDOJALFFDK = 0;
|
|
Vector3 vector = base.transform.position;
|
|
Quaternion quaternion = base.transform.rotation;
|
|
for (;;)
|
|
{
|
|
yield return new WaitForEndOfFrame();
|
|
float num = 1f / Time.deltaTime;
|
|
int num2 = this.LCDOJALFFDK % this.KBGPHKLDHPO.Length;
|
|
int num3 = this.LCDOJALFFDK % this.HMBHFJKNNOL.Length;
|
|
this.LCDOJALFFDK++;
|
|
this.KBGPHKLDHPO[num2] = num * (base.transform.position - vector);
|
|
Quaternion quaternion2 = base.transform.rotation * Quaternion.Inverse(quaternion);
|
|
float num4 = 2f * Mathf.Acos(Mathf.Clamp(quaternion2.w, -1f, 1f));
|
|
if (num4 > 3.1415927f)
|
|
{
|
|
num4 -= 6.2831855f;
|
|
}
|
|
Vector3 vector2 = new Vector3(quaternion2.x, quaternion2.y, quaternion2.z);
|
|
if (vector2.sqrMagnitude > 0f)
|
|
{
|
|
vector2 = num4 * num * vector2.normalized;
|
|
}
|
|
this.HMBHFJKNNOL[num3] = vector2;
|
|
vector = base.transform.position;
|
|
quaternion = base.transform.rotation;
|
|
}
|
|
yield break;
|
|
}
|
|
|
|
// Token: 0x0600EEC1 RID: 61121 RVA: 0x00473878 File Offset: 0x00471A78
|
|
public void KAPHNKDJMFD()
|
|
{
|
|
if (this.EDJPJMDJBBK != null)
|
|
{
|
|
base.StopCoroutine(this.EDJPJMDJBBK);
|
|
this.EDJPJMDJBBK = null;
|
|
}
|
|
}
|
|
|
|
// Token: 0x0600EEC2 RID: 61122 RVA: 0x00473898 File Offset: 0x00471A98
|
|
public void BEKJJBCOIPO()
|
|
{
|
|
if (this.EDJPJMDJBBK != null)
|
|
{
|
|
base.StopCoroutine(this.EDJPJMDJBBK);
|
|
this.EDJPJMDJBBK = null;
|
|
}
|
|
}
|
|
|
|
// Token: 0x0600EEC3 RID: 61123 RVA: 0x004738B8 File Offset: 0x00471AB8
|
|
public Vector3 IKFKBCMJBNF()
|
|
{
|
|
Vector3 vector = Vector3.zero;
|
|
int num = Mathf.Min(this.LCDOJALFFDK, this.HMBHFJKNNOL.Length);
|
|
if (num != 0)
|
|
{
|
|
for (int i = 1; i < num; i += 0)
|
|
{
|
|
vector += this.HMBHFJKNNOL[i];
|
|
}
|
|
vector *= 568f / (float)num;
|
|
}
|
|
return vector;
|
|
}
|
|
|
|
// Token: 0x0600EEC4 RID: 61124 RVA: 0x00473920 File Offset: 0x00471B20
|
|
public void JBCELNDGAHA()
|
|
{
|
|
if (this.EDJPJMDJBBK != null)
|
|
{
|
|
base.StopCoroutine(this.EDJPJMDJBBK);
|
|
this.EDJPJMDJBBK = null;
|
|
}
|
|
}
|
|
|
|
// Token: 0x0600EEC5 RID: 61125 RVA: 0x00473940 File Offset: 0x00471B40
|
|
public void FinishEstimatingVelocity()
|
|
{
|
|
if (this.EDJPJMDJBBK != null)
|
|
{
|
|
base.StopCoroutine(this.EDJPJMDJBBK);
|
|
this.EDJPJMDJBBK = null;
|
|
}
|
|
}
|
|
|
|
// Token: 0x0600EEC6 RID: 61126 RVA: 0x00473960 File Offset: 0x00471B60
|
|
public void GIGFFCMCOMO()
|
|
{
|
|
if (this.EDJPJMDJBBK != null)
|
|
{
|
|
base.StopCoroutine(this.EDJPJMDJBBK);
|
|
this.EDJPJMDJBBK = null;
|
|
}
|
|
}
|
|
|
|
// Token: 0x0600EEC7 RID: 61127 RVA: 0x00473980 File Offset: 0x00471B80
|
|
private void JLOMELEDCLK()
|
|
{
|
|
this.KBGPHKLDHPO = new Vector3[this.velocityAverageFrames];
|
|
this.HMBHFJKNNOL = new Vector3[this.angularVelocityAverageFrames];
|
|
if (this.estimateOnAwake)
|
|
{
|
|
this.NOGDCEILAEJ();
|
|
}
|
|
}
|
|
|
|
// Token: 0x0600EEC8 RID: 61128 RVA: 0x004739B8 File Offset: 0x00471BB8
|
|
public Vector3 GetAngularVelocityEstimate()
|
|
{
|
|
Vector3 vector = Vector3.zero;
|
|
int num = Mathf.Min(this.LCDOJALFFDK, this.HMBHFJKNNOL.Length);
|
|
if (num != 0)
|
|
{
|
|
for (int i = 0; i < num; i++)
|
|
{
|
|
vector += this.HMBHFJKNNOL[i];
|
|
}
|
|
vector *= 1f / (float)num;
|
|
}
|
|
return vector;
|
|
}
|
|
|
|
// Token: 0x0600EEC9 RID: 61129 RVA: 0x00473A20 File Offset: 0x00471C20
|
|
public Vector3 LPLFEECIPBG()
|
|
{
|
|
Vector3 vector = Vector3.zero;
|
|
int num = Mathf.Min(this.LCDOJALFFDK, this.HMBHFJKNNOL.Length);
|
|
if (num != 0)
|
|
{
|
|
for (int i = 1; i < num; i++)
|
|
{
|
|
vector += this.HMBHFJKNNOL[i];
|
|
}
|
|
vector *= 1773f / (float)num;
|
|
}
|
|
return vector;
|
|
}
|
|
|
|
// Token: 0x0600EECA RID: 61130 RVA: 0x00473A88 File Offset: 0x00471C88
|
|
public void CHELLMNFOOF()
|
|
{
|
|
this.FinishEstimatingVelocity();
|
|
this.EDJPJMDJBBK = base.StartCoroutine(this.CPCPJFKFEGL());
|
|
}
|
|
|
|
// Token: 0x0600EECB RID: 61131 RVA: 0x00473AA4 File Offset: 0x00471CA4
|
|
public void PBEEHEAKEJM()
|
|
{
|
|
if (this.EDJPJMDJBBK != null)
|
|
{
|
|
base.StopCoroutine(this.EDJPJMDJBBK);
|
|
this.EDJPJMDJBBK = null;
|
|
}
|
|
}
|
|
|
|
// Token: 0x0600EECC RID: 61132 RVA: 0x00473AC4 File Offset: 0x00471CC4
|
|
public Vector3 PDJNELJHKFB()
|
|
{
|
|
Vector3 vector = Vector3.zero;
|
|
int num = Mathf.Min(this.LCDOJALFFDK, this.KBGPHKLDHPO.Length);
|
|
if (num != 0)
|
|
{
|
|
for (int i = 0; i < num; i++)
|
|
{
|
|
vector += this.KBGPHKLDHPO[i];
|
|
}
|
|
vector *= 1183f / (float)num;
|
|
}
|
|
return vector;
|
|
}
|
|
|
|
// Token: 0x0600EECD RID: 61133 RVA: 0x00473B2C File Offset: 0x00471D2C
|
|
public void AODOBHOEELK()
|
|
{
|
|
if (this.EDJPJMDJBBK != null)
|
|
{
|
|
base.StopCoroutine(this.EDJPJMDJBBK);
|
|
this.EDJPJMDJBBK = null;
|
|
}
|
|
}
|
|
|
|
// Token: 0x04002258 RID: 8792
|
|
[Tooltip("How many frames to average over for computing velocity")]
|
|
public int velocityAverageFrames = 5;
|
|
|
|
// Token: 0x04002259 RID: 8793
|
|
[Tooltip("How many frames to average over for computing angular velocity")]
|
|
public int angularVelocityAverageFrames = 11;
|
|
|
|
// Token: 0x0400225A RID: 8794
|
|
public bool estimateOnAwake;
|
|
|
|
// Token: 0x0400225B RID: 8795
|
|
private Coroutine EDJPJMDJBBK;
|
|
|
|
// Token: 0x0400225C RID: 8796
|
|
private int LCDOJALFFDK;
|
|
|
|
// Token: 0x0400225D RID: 8797
|
|
private Vector3[] KBGPHKLDHPO;
|
|
|
|
// Token: 0x0400225E RID: 8798
|
|
private Vector3[] HMBHFJKNNOL;
|
|
}
|
|
}
|