コード例 #1
0
 public static void addVolume(LandscapeHoleVolume volume)
 {
     if (LandscapeHoleSystem.volumes.Count >= LandscapeHoleSystem.MAX_LANDSCAPE_HOLES)
     {
         return;
     }
     LandscapeHoleSystem.landscapeHoles[LandscapeHoleSystem.volumes.Count] = volume.transform.worldToLocalMatrix;
     LandscapeHoleSystem.volumes.Add(volume);
     LandscapeHoleSystem.sendToGPU();
 }
コード例 #2
0
        public static void removeVolume(LandscapeHoleVolume volume)
        {
            int num = LandscapeHoleSystem.volumes.IndexOf(volume);

            if (num < 0)
            {
                return;
            }
            LandscapeHoleSystem.volumes.RemoveAt(num);
            LandscapeHoleSystem.landscapeHoles[num] = LandscapeHoleSystem.landscapeHoles[LandscapeHoleSystem.volumes.Count];
            LandscapeHoleSystem.sendToGPU();
        }
コード例 #3
0
 // Token: 0x06000E5A RID: 3674 RVA: 0x00063754 File Offset: 0x00061B54
 public static bool isPointInsideHoleVolume(Vector3 point, out LandscapeHoleVolume volume)
 {
     for (int i = 0; i < LandscapeHoleSystem.volumes.Count; i++)
     {
         volume = LandscapeHoleSystem.volumes[i];
         if (LandscapeHoleUtility.isPointInsideHoleVolume(volume, point))
         {
             return(true);
         }
     }
     volume = null;
     return(false);
 }
コード例 #4
0
 // Token: 0x06000E5C RID: 3676 RVA: 0x000637FC File Offset: 0x00061BFC
 public static bool doesRayIntersectHoleVolume(Ray ray, out RaycastHit hit, out LandscapeHoleVolume volume, float maxDistance)
 {
     for (int i = 0; i < LandscapeHoleSystem.volumes.Count; i++)
     {
         volume = LandscapeHoleSystem.volumes[i];
         if (LandscapeHoleUtility.doesRayIntersectHoleVolume(volume, ray, out hit, maxDistance))
         {
             return(true);
         }
     }
     hit    = default(RaycastHit);
     volume = null;
     return(false);
 }
コード例 #5
0
        private static void handleUpdated()
        {
            bool flag = false;

            for (int i = 0; i < LandscapeHoleSystem.volumes.Count; i++)
            {
                LandscapeHoleVolume landscapeHoleVolume = LandscapeHoleSystem.volumes[i];
                if (landscapeHoleVolume.transform.hasChanged)
                {
                    LandscapeHoleSystem.landscapeHoles[i]    = landscapeHoleVolume.transform.worldToLocalMatrix;
                    landscapeHoleVolume.transform.hasChanged = false;
                    flag = true;
                }
            }
            if (flag)
            {
                LandscapeHoleSystem.sendToGPU();
            }
        }
コード例 #6
0
 // Token: 0x06000E5D RID: 3677 RVA: 0x0006384D File Offset: 0x00061C4D
 public static bool doesRayIntersectHoleVolume(LandscapeHoleVolume volume, Ray ray, out RaycastHit hit, float maxDistance)
 {
     return(volume.box.Raycast(ray, out hit, maxDistance));
 }
コード例 #7
0
        // Token: 0x06000E5B RID: 3675 RVA: 0x0006379C File Offset: 0x00061B9C
        public static bool isPointInsideHoleVolume(LandscapeHoleVolume volume, Vector3 point)
        {
            Vector3 vector = volume.transform.InverseTransformPoint(point);

            return(Mathf.Abs(vector.x) < 0.5f && Mathf.Abs(vector.y) < 0.5f && Mathf.Abs(vector.z) < 0.5f);
        }