Пример #1
0
        // Token: 0x06001D83 RID: 7555 RVA: 0x000899C4 File Offset: 0x00087BC4
        private void BuildAirLinks(ReadOnlyCollection <MapNode> nodes, MapNode.MoveProbe moveProbe)
        {
            Vector3 position = base.transform.position;

            for (int i = 0; i < nodes.Count; i++)
            {
                MapNode mapNode = nodes[i];
                if (!(mapNode == this))
                {
                    Vector3 position2    = mapNode.transform.position;
                    float   num          = MapNode.maxConnectionDistance * 2f;
                    float   num2         = num * num;
                    float   sqrMagnitude = (position2 - position).sqrMagnitude;
                    if (sqrMagnitude < num2)
                    {
                        float distanceScore = Mathf.Sqrt(sqrMagnitude);
                        for (int j = 0; j < 3; j++)
                        {
                            if ((this.forbiddenHulls & (HullMask)(1 << j)) == HullMask.None && (mapNode.forbiddenHulls & (HullMask)(1 << j)) == HullMask.None)
                            {
                                moveProbe.SetHull((HullClassification)j);
                                Vector3 vector  = position;
                                Vector3 vector2 = position2;
                                if (moveProbe.CapsuleOverlapTest(vector) && moveProbe.CapsuleOverlapTest(vector2) && moveProbe.FlyTest(vector, vector2, 6f))
                                {
                                    this.AddLink(mapNode, distanceScore, 0f, (HullClassification)j);
                                }
                            }
                        }
                    }
                }
            }
        }
Пример #2
0
        // Token: 0x06001D82 RID: 7554 RVA: 0x00089844 File Offset: 0x00087A44
        private void BuildGroundLinks(ReadOnlyCollection <MapNode> nodes, MapNode.MoveProbe moveProbe)
        {
            Vector3 position = base.transform.position;

            for (int i = 0; i < nodes.Count; i++)
            {
                MapNode mapNode = nodes[i];
                if (!(mapNode == this))
                {
                    Vector3 position2    = mapNode.transform.position;
                    float   num          = MapNode.maxConnectionDistance;
                    float   num2         = num * num;
                    float   sqrMagnitude = (position2 - position).sqrMagnitude;
                    if (sqrMagnitude < num2)
                    {
                        float distanceScore = Mathf.Sqrt(sqrMagnitude);
                        for (int j = 0; j < 3; j++)
                        {
                            moveProbe.SetHull((HullClassification)j);
                            if ((this.forbiddenHulls & (HullMask)(1 << j)) == HullMask.None && (mapNode.forbiddenHulls & (HullMask)(1 << j)) == HullMask.None)
                            {
                                Vector3 b       = Vector3.up * (moveProbe.testCharacterController.height * 0.5f);
                                Vector3 b2      = Vector3.up * 0.01f;
                                Vector3 a       = moveProbe.GetGroundPosition(position) + b2;
                                Vector3 a2      = moveProbe.GetGroundPosition(position2) + b2;
                                Vector3 vector  = a + b;
                                Vector3 vector2 = a2 + b;
                                if (moveProbe.CapsuleOverlapTest(vector) && moveProbe.CapsuleOverlapTest(vector2))
                                {
                                    bool  flag = moveProbe.GroundTest(vector, vector2, 6f);
                                    float num3 = (!flag) ? moveProbe.JumpTest(vector, vector2, 7.5f) : 0f;
                                    if (flag || (num3 > 0f && num3 < 10f))
                                    {
                                        this.AddLink(mapNode, distanceScore, num3, (HullClassification)j);
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }