|
|
|
|
using System;
|
|
|
|
|
using UnityEngine;
|
|
|
|
|
|
|
|
|
|
namespace MU3
|
|
|
|
|
{
|
|
|
|
|
// Token: 0x020004DF RID: 1247
|
|
|
|
|
public struct SimpleKDTree
|
|
|
|
|
{
|
|
|
|
|
// Token: 0x06001ED0 RID: 7888 RVA: 0x000C2B88 File Offset: 0x000C2B88
|
|
|
|
|
public void initialize(SwingJointColliderInformation[] information)
|
|
|
|
|
{
|
|
|
|
|
this.wholeInformation_ = information;
|
|
|
|
|
this.information_ = new SwingJointColliderInformation[this.wholeInformation_.Length << 1];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Token: 0x06001ED1 RID: 7889 RVA: 0x000C2BA8 File Offset: 0x000C2BA8
|
|
|
|
|
public void update(Transform trans)
|
|
|
|
|
{
|
|
|
|
|
Vector3 forward = trans.forward;
|
|
|
|
|
this.plane_ = new Plane(trans.position, forward);
|
|
|
|
|
this.numRight_ = 0;
|
|
|
|
|
this.numLeft_ = 0;
|
|
|
|
|
int num = this.wholeInformation_.Length;
|
|
|
|
|
for (int i = 0; i < this.wholeInformation_.Length; i++)
|
|
|
|
|
{
|
|
|
|
|
int sideOfPlane = this.wholeInformation_[i].getSideOfPlane(ref this.plane_);
|
|
|
|
|
if (sideOfPlane != 0)
|
|
|
|
|
{
|
|
|
|
|
if (sideOfPlane != 1)
|
|
|
|
|
{
|
|
|
|
|
if (sideOfPlane == 2)
|
|
|
|
|
{
|
|
|
|
|
this.information_[this.numRight_] = this.wholeInformation_[i];
|
|
|
|
|
this.numRight_++;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
this.information_[num] = this.wholeInformation_[i];
|
|
|
|
|
this.numLeft_++;
|
|
|
|
|
num++;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Token: 0x06001ED2 RID: 7890 RVA: 0x000C2CA8 File Offset: 0x000C2CA8
|
|
|
|
|
public SwingJointColliderInformation[] getCollideCandidates(out int start, out int end, Vector3 position, float radius)
|
|
|
|
|
{
|
|
|
|
|
float num = this.plane_.dot(position);
|
|
|
|
|
int num2;
|
|
|
|
|
if (0f <= num)
|
|
|
|
|
{
|
|
|
|
|
num2 = ((num > radius) ? 2 : 1);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
num2 = ((-radius > num) ? 0 : 1);
|
|
|
|
|
}
|
|
|
|
|
if (num2 == 0)
|
|
|
|
|
{
|
|
|
|
|
start = this.wholeInformation_.Length;
|
|
|
|
|
end = start + this.numLeft_;
|
|
|
|
|
return this.information_;
|
|
|
|
|
}
|
|
|
|
|
if (num2 != 1)
|
|
|
|
|
{
|
|
|
|
|
start = 0;
|
|
|
|
|
end = this.numRight_;
|
|
|
|
|
return this.information_;
|
|
|
|
|
}
|
|
|
|
|
start = 0;
|
|
|
|
|
end = this.wholeInformation_.Length;
|
|
|
|
|
return this.wholeInformation_;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Token: 0x06001ED3 RID: 7891 RVA: 0x000C2D48 File Offset: 0x000C2D48
|
|
|
|
|
public void onDrawGizmos()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Token: 0x040048E6 RID: 18662
|
|
|
|
|
private Plane plane_;
|
|
|
|
|
|
|
|
|
|
// Token: 0x040048E7 RID: 18663
|
|
|
|
|
private int numRight_;
|
|
|
|
|
|
|
|
|
|
// Token: 0x040048E8 RID: 18664
|
|
|
|
|
private int numLeft_;
|
|
|
|
|
|
|
|
|
|
// Token: 0x040048E9 RID: 18665
|
|
|
|
|
private SwingJointColliderInformation[] wholeInformation_;
|
|
|
|
|
|
|
|
|
|
// Token: 0x040048EA RID: 18666
|
|
|
|
|
private SwingJointColliderInformation[] information_;
|
|
|
|
|
}
|
|
|
|
|
}
|