// Token: 0x0600271F RID: 10015 RVA: 0x000C0EA8 File Offset: 0x000BF2A8
    public void Collide(ref Vector3 particlePosition, float particleRadius)
    {
        float num  = this.m_Radius * Mathf.Abs(base.transform.lossyScale.x);
        float num2 = this.m_Height * 0.5f - this.m_Radius;

        if (num2 <= 0f)
        {
            if (this.m_Bound == DynamicBoneCollider.Bound.Outside)
            {
                DynamicBoneCollider.OutsideSphere(ref particlePosition, particleRadius, base.transform.TransformPoint(this.m_Center), num);
            }
            else
            {
                DynamicBoneCollider.InsideSphere(ref particlePosition, particleRadius, base.transform.TransformPoint(this.m_Center), num);
            }
        }
        else
        {
            Vector3 center  = this.m_Center;
            Vector3 center2 = this.m_Center;
            DynamicBoneCollider.Direction direction = this.m_Direction;
            if (direction != DynamicBoneCollider.Direction.X)
            {
                if (direction != DynamicBoneCollider.Direction.Y)
                {
                    if (direction == DynamicBoneCollider.Direction.Z)
                    {
                        center.z  -= num2;
                        center2.z += num2;
                    }
                }
                else
                {
                    center.y  -= num2;
                    center2.y += num2;
                }
            }
            else
            {
                center.x  -= num2;
                center2.x += num2;
            }
            if (this.m_Bound == DynamicBoneCollider.Bound.Outside)
            {
                DynamicBoneCollider.OutsideCapsule(ref particlePosition, particleRadius, base.transform.TransformPoint(center), base.transform.TransformPoint(center2), num);
            }
            else
            {
                DynamicBoneCollider.InsideCapsule(ref particlePosition, particleRadius, base.transform.TransformPoint(center), base.transform.TransformPoint(center2), num);
            }
        }
    }
Beispiel #2
0
    // Token: 0x06000017 RID: 23 RVA: 0x000034B4 File Offset: 0x000016B4
    public void Collide(ref Vector3 particlePosition, float particleRadius)
    {
        float num  = this.m_Radius * Mathf.Abs(base.transform.lossyScale.x);
        float num2 = this.m_Height * 0.5f - this.m_Radius;
        bool  flag = num2 <= 0f;

        if (flag)
        {
            bool flag2 = this.m_Bound == DynamicBoneCollider.Bound.Outside;
            if (flag2)
            {
                DynamicBoneCollider.OutsideSphere(ref particlePosition, particleRadius, base.transform.TransformPoint(this.m_Center), num);
            }
            else
            {
                DynamicBoneCollider.InsideSphere(ref particlePosition, particleRadius, base.transform.TransformPoint(this.m_Center), num);
            }
        }
        else
        {
            Vector3 center  = this.m_Center;
            Vector3 center2 = this.m_Center;
            switch (this.m_Direction)
            {
            case DynamicBoneCollider.Direction.X:
                center.x  -= num2;
                center2.x += num2;
                break;

            case DynamicBoneCollider.Direction.Y:
                center.y  -= num2;
                center2.y += num2;
                break;

            case DynamicBoneCollider.Direction.Z:
                center.z  -= num2;
                center2.z += num2;
                break;
            }
            bool flag3 = this.m_Bound == DynamicBoneCollider.Bound.Outside;
            if (flag3)
            {
                DynamicBoneCollider.OutsideCapsule(ref particlePosition, particleRadius, base.transform.TransformPoint(center), base.transform.TransformPoint(center2), num);
            }
            else
            {
                DynamicBoneCollider.InsideCapsule(ref particlePosition, particleRadius, base.transform.TransformPoint(center), base.transform.TransformPoint(center2), num);
            }
        }
    }