physics

using System;
using System.Runtime.CompilerServices;
using UnityEngine.Internal;
namespace UnityEngine
{
    public class Physics
    {
        //
        // Static Fields
        //
        public const int IgnoreRaycastLayer = 4;

        public const int DefaultRaycastLayers = -5;

        public const int AllLayers = -1;

        public const int kIgnoreRaycastLayer = 4;

        public const int kDefaultRaycastLayers = -5;

        public const int kAllLayers = -1;

        //
        // Static Properties
        //
        public static extern float bounceThreshold
        {
            [WrapperlessIcall]
            [MethodImpl (MethodImplOptions.InternalCall)]
            get;
            [WrapperlessIcall]
            [MethodImpl (MethodImplOptions.InternalCall)]
            set;
        }

        [Obsolete ("Please use bounceThreshold instead.")]
        public static float bounceTreshold
        {
            get
            {
                return Physics.bounceThreshold;
            }
            set
            {
                Physics.bounceThreshold = value;
            }
        }

        public static Vector3 gravity
        {
            get
            {
                Vector3 result;
                Physics.INTERNAL_get_gravity (out result);
                return result;
            }
            set
            {
                Physics.INTERNAL_set_gravity (ref value);
            }
        }

        public static extern float maxAngularVelocity
        {
            [WrapperlessIcall]
            [MethodImpl (MethodImplOptions.InternalCall)]
            get;
            [WrapperlessIcall]
            [MethodImpl (MethodImplOptions.InternalCall)]
            set;
        }

        public static extern float minPenetrationForPenalty
        {
            [WrapperlessIcall]
            [MethodImpl (MethodImplOptions.InternalCall)]
            get;
            [WrapperlessIcall]
            [MethodImpl (MethodImplOptions.InternalCall)]
            set;
        }

        [Obsolete ("penetrationPenaltyForce has no effect.")]
        public static extern float penetrationPenaltyForce
        {
            [WrapperlessIcall]
            [MethodImpl (MethodImplOptions.InternalCall)]
            get;
            [WrapperlessIcall]
            [MethodImpl (MethodImplOptions.InternalCall)]
            set;
        }

        public static extern float sleepAngularVelocity
        {
            [WrapperlessIcall]
            [MethodImpl (MethodImplOptions.InternalCall)]
            get;
            [WrapperlessIcall]
            [MethodImpl (MethodImplOptions.InternalCall)]
            set;
        }

        public static extern float sleepVelocity
        {
            [WrapperlessIcall]
            [MethodImpl (MethodImplOptions.InternalCall)]
            get;
            [WrapperlessIcall]
            [MethodImpl (MethodImplOptions.InternalCall)]
            set;
        }

        public static extern int solverIterationCount
        {
            [WrapperlessIcall]
            [MethodImpl (MethodImplOptions.InternalCall)]
            get;
            [WrapperlessIcall]
            [MethodImpl (MethodImplOptions.InternalCall)]
            set;
        }

        //
        // Static Methods
        //
        [ExcludeFromDocs]
        public static bool CapsuleCast (Vector3 point1, Vector3 point2, float radius, Vector3 direction, out RaycastHit hitInfo, float distance)
        {
            int layerMask = -5;
            return Physics.CapsuleCast (point1, point2, radius, direction, out hitInfo, distance, layerMask);
        }

        [ExcludeFromDocs]
        public static bool CapsuleCast (Vector3 point1, Vector3 point2, float radius, Vector3 direction, out RaycastHit hitInfo)
        {
            int layerMask = -5;
            float distance = float.PositiveInfinity;
            return Physics.CapsuleCast (point1, point2, radius, direction, out hitInfo, distance, layerMask);
        }

        public static bool CapsuleCast (Vector3 point1, Vector3 point2, float radius, Vector3 direction, out RaycastHit hitInfo, [DefaultValue ("Mathf.Infinity")] float distance, [DefaultValue ("DefaultRaycastLayers")] int layerMask)
        {
            return Physics.Internal_CapsuleCast (point1, point2, radius, direction, out hitInfo, distance, layerMask);
        }

        public static bool CapsuleCast (Vector3 point1, Vector3 point2, float radius, Vector3 direction, [DefaultValue ("Mathf.Infinity")] float distance, [DefaultValue ("DefaultRaycastLayers")] int layerMask)
        {
            RaycastHit raycastHit;
            return Physics.Internal_CapsuleCast (point1, point2, radius, direction, out raycastHit, distance, layerMask);
        }

        [ExcludeFromDocs]
        public static bool CapsuleCast (Vector3 point1, Vector3 point2, float radius, Vector3 direction, float distance)
        {
            int layerMask = -5;
            return Physics.CapsuleCast (point1, point2, radius, direction, distance, layerMask);
        }

        [ExcludeFromDocs]
        public static bool CapsuleCast (Vector3 point1, Vector3 point2, float radius, Vector3 direction)
        {
            int layerMask = -5;
            float distance = float.PositiveInfinity;
            return Physics.CapsuleCast (point1, point2, radius, direction, distance, layerMask);
        }

        [ExcludeFromDocs]
        public static RaycastHit[] CapsuleCastAll (Vector3 point1, Vector3 point2, float radius, Vector3 direction)
        {
            int layermask = -5;
            float distance = float.PositiveInfinity;
            return Physics.INTERNAL_CALL_CapsuleCastAll (ref point1, ref point2, radius, ref direction, distance, layermask);
        }

        [ExcludeFromDocs]
        public static RaycastHit[] CapsuleCastAll (Vector3 point1, Vector3 point2, float radius, Vector3 direction, float distance)
        {
            int layermask = -5;
            return Physics.INTERNAL_CALL_CapsuleCastAll (ref point1, ref point2, radius, ref direction, distance, layermask);
        }

        public static RaycastHit[] CapsuleCastAll (Vector3 point1, Vector3 point2, float radius, Vector3 direction, [DefaultValue ("Mathf.Infinity")] float distance, [DefaultValue ("DefaultRaycastLayers")] int layermask)
        {
            return Physics.INTERNAL_CALL_CapsuleCastAll (ref point1, ref point2, radius, ref direction, distance, layermask);
        }

        public static bool CheckCapsule (Vector3 start, Vector3 end, float radius, [DefaultValue ("DefaultRaycastLayers")] int layermask)
        {
            return Physics.INTERNAL_CALL_CheckCapsule (ref start, ref end, radius, layermask);
        }

        [ExcludeFromDocs]
        public static bool CheckCapsule (Vector3 start, Vector3 end, float radius)
        {
            int layermask = -5;
            return Physics.INTERNAL_CALL_CheckCapsule (ref start, ref end, radius, layermask);
        }

        public static bool CheckSphere (Vector3 position, float radius, [DefaultValue ("DefaultRaycastLayers")] int layerMask)
        {
            return Physics.INTERNAL_CALL_CheckSphere (ref position, radius, layerMask);
        }

        [ExcludeFromDocs]
        public static bool CheckSphere (Vector3 position, float radius)
        {
            int layerMask = -5;
            return Physics.INTERNAL_CALL_CheckSphere (ref position, radius, layerMask);
        }

        [WrapperlessIcall]
        [MethodImpl (MethodImplOptions.InternalCall)]
        public static extern bool GetIgnoreLayerCollision (int layer1, int layer2);

        [ExcludeFromDocs]
        public static void IgnoreCollision (Collider collider1, Collider collider2)
        {
            bool ignore = true;
            Physics.IgnoreCollision (collider1, collider2, ignore);
        }

        [WrapperlessIcall]
        [MethodImpl (MethodImplOptions.InternalCall)]
        public static extern void IgnoreCollision (Collider collider1, Collider collider2, [DefaultValue ("true")] bool ignore);

        [ExcludeFromDocs]
        public static void IgnoreLayerCollision (int layer1, int layer2)
        {
            bool ignore = true;
            Physics.IgnoreLayerCollision (layer1, layer2, ignore);
        }

        [WrapperlessIcall]
        [MethodImpl (MethodImplOptions.InternalCall)]
        public static extern void IgnoreLayerCollision (int layer1, int layer2, [DefaultValue ("true")] bool ignore);

        [ExcludeFromDocs]
        public static bool Linecast (Vector3 start, Vector3 end, out RaycastHit hitInfo)
        {
            int layerMask = -5;
            return Physics.Linecast (start, end, out hitInfo, layerMask);
        }

        public static bool Linecast (Vector3 start, Vector3 end, out RaycastHit hitInfo, [DefaultValue ("DefaultRaycastLayers")] int layerMask)
        {
            Vector3 direction = end - start;
            return Physics.Raycast (start, direction, out hitInfo, direction.magnitude, layerMask);
        }

        [ExcludeFromDocs]
        public static bool Linecast (Vector3 start, Vector3 end)
        {
            int layerMask = -5;
            return Physics.Linecast (start, end, layerMask);
        }

        public static bool Linecast (Vector3 start, Vector3 end, [DefaultValue ("DefaultRaycastLayers")] int layerMask)
        {
            Vector3 direction = end - start;
            return Physics.Raycast (start, direction, direction.magnitude, layerMask);
        }

        [ExcludeFromDocs]
        public static Collider[] OverlapSphere (Vector3 position, float radius)
        {
            int layerMask = -1;
            return Physics.INTERNAL_CALL_OverlapSphere (ref position, radius, layerMask);
        }

        public static Collider[] OverlapSphere (Vector3 position, float radius, [DefaultValue ("AllLayers")] int layerMask)
        {
            return Physics.INTERNAL_CALL_OverlapSphere (ref position, radius, layerMask);
        }

        public static bool Raycast (Vector3 origin, Vector3 direction, out RaycastHit hitInfo, [DefaultValue ("Mathf.Infinity")] float distance, [DefaultValue ("DefaultRaycastLayers")] int layerMask)
        {
            return Physics.Internal_Raycast (origin, direction, out hitInfo, distance, layerMask);
        }

        [ExcludeFromDocs]
        public static bool Raycast (Ray ray, float distance)
        {
            int layerMask = -5;
            return Physics.Raycast (ray, distance, layerMask);
        }

        [ExcludeFromDocs]
        public static bool Raycast (Vector3 origin, Vector3 direction, out RaycastHit hitInfo, float distance)
        {
            int layerMask = -5;
            return Physics.Raycast (origin, direction, out hitInfo, distance, layerMask);
        }

        [ExcludeFromDocs]
        public static bool Raycast (Vector3 origin, Vector3 direction, out RaycastHit hitInfo)
        {
            int layerMask = -5;
            float distance = float.PositiveInfinity;
            return Physics.Raycast (origin, direction, out hitInfo, distance, layerMask);
        }

        [ExcludeFromDocs]
        public static bool Raycast (Ray ray)
        {
            int layerMask = -5;
            float distance = float.PositiveInfinity;
            return Physics.Raycast (ray, distance, layerMask);
        }

        [ExcludeFromDocs]
        public static bool Raycast (Ray ray, out RaycastHit hitInfo)
        {
            int layerMask = -5;
            float distance = float.PositiveInfinity;
            return Physics.Raycast (ray, out hitInfo, distance, layerMask);
        }

        [ExcludeFromDocs]
        public static bool Raycast (Ray ray, out RaycastHit hitInfo, float distance)
        {
            int layerMask = -5;
            return Physics.Raycast (ray, out hitInfo, distance, layerMask);
        }

        public static bool Raycast (Ray ray, [DefaultValue ("Mathf.Infinity")] float distance, [DefaultValue ("DefaultRaycastLayers")] int layerMask)
        {
            return Physics.Raycast (ray.origin, ray.direction, distance, layerMask);
        }

        public static bool Raycast (Ray ray, out RaycastHit hitInfo, [DefaultValue ("Mathf.Infinity")] float distance, [DefaultValue ("DefaultRaycastLayers")] int layerMask)
        {
            return Physics.Raycast (ray.origin, ray.direction, out hitInfo, distance, layerMask);
        }

        [ExcludeFromDocs]
        public static bool Raycast (Vector3 origin, Vector3 direction, float distance)
        {
            int layerMask = -5;
            return Physics.Raycast (origin, direction, distance, layerMask);
        }

        [ExcludeFromDocs]
        public static bool Raycast (Vector3 origin, Vector3 direction)
        {
            int layerMask = -5;
            float distance = float.PositiveInfinity;
            return Physics.Raycast (origin, direction, distance, layerMask);
        }

        public static bool Raycast (Vector3 origin, Vector3 direction, [DefaultValue ("Mathf.Infinity")] float distance, [DefaultValue ("DefaultRaycastLayers")] int layerMask)
        {
            return Physics.Internal_RaycastTest (origin, direction, distance, layerMask);
        }

        public static RaycastHit[] RaycastAll (Vector3 origin, Vector3 direction, [DefaultValue ("Mathf.Infinity")] float distance, [DefaultValue ("DefaultRaycastLayers")] int layermask)
        {
            return Physics.INTERNAL_CALL_RaycastAll (ref origin, ref direction, distance, layermask);
        }

        [ExcludeFromDocs]
        public static RaycastHit[] RaycastAll (Vector3 origin, Vector3 direction, float distance)
        {
            int layermask = -5;
            return Physics.INTERNAL_CALL_RaycastAll (ref origin, ref direction, distance, layermask);
        }

        [ExcludeFromDocs]
        public static RaycastHit[] RaycastAll (Vector3 origin, Vector3 direction)
        {
            int layermask = -5;
            float distance = float.PositiveInfinity;
            return Physics.INTERNAL_CALL_RaycastAll (ref origin, ref direction, distance, layermask);
        }

        [ExcludeFromDocs]
        public static RaycastHit[] RaycastAll (Ray ray, float distance)
        {
            int layerMask = -5;
            return Physics.RaycastAll (ray, distance, layerMask);
        }

        [ExcludeFromDocs]
        public static RaycastHit[] RaycastAll (Ray ray)
        {
            int layerMask = -5;
            float distance = float.PositiveInfinity;
            return Physics.RaycastAll (ray, distance, layerMask);
        }

        public static RaycastHit[] RaycastAll (Ray ray, [DefaultValue ("Mathf.Infinity")] float distance, [DefaultValue ("DefaultRaycastLayers")] int layerMask)
        {
            return Physics.RaycastAll (ray.origin, ray.direction, distance, layerMask);
        }

        [ExcludeFromDocs]
        public static bool SphereCast (Ray ray, float radius)
        {
            int layerMask = -5;
            float distance = float.PositiveInfinity;
            return Physics.SphereCast (ray, radius, distance, layerMask);
        }

        public static bool SphereCast (Ray ray, float radius, [DefaultValue ("Mathf.Infinity")] float distance, [DefaultValue ("DefaultRaycastLayers")] int layerMask)
        {
            RaycastHit raycastHit;
            return Physics.Internal_CapsuleCast (ray.origin, ray.origin, radius, ray.direction, out raycastHit, distance, layerMask);
        }

        [ExcludeFromDocs]
        public static bool SphereCast (Ray ray, float radius, out RaycastHit hitInfo, float distance)
        {
            int layerMask = -5;
            return Physics.SphereCast (ray, radius, out hitInfo, distance, layerMask);
        }

        [ExcludeFromDocs]
        public static bool SphereCast (Ray ray, float radius, float distance)
        {
            int layerMask = -5;
            return Physics.SphereCast (ray, radius, distance, layerMask);
        }

        [ExcludeFromDocs]
        public static bool SphereCast (Vector3 origin, float radius, Vector3 direction, out RaycastHit hitInfo, float distance)
        {
            int layerMask = -5;
            return Physics.SphereCast (origin, radius, direction, out hitInfo, distance, layerMask);
        }

        [ExcludeFromDocs]
        public static bool SphereCast (Vector3 origin, float radius, Vector3 direction, out RaycastHit hitInfo)
        {
            int layerMask = -5;
            float distance = float.PositiveInfinity;
            return Physics.SphereCast (origin, radius, direction, out hitInfo, distance, layerMask);
        }

        public static bool SphereCast (Vector3 origin, float radius, Vector3 direction, out RaycastHit hitInfo, [DefaultValue ("Mathf.Infinity")] float distance, [DefaultValue ("DefaultRaycastLayers")] int layerMask)
        {
            return Physics.Internal_CapsuleCast (origin, origin, radius, direction, out hitInfo, distance, layerMask);
        }

        [ExcludeFromDocs]
        public static bool SphereCast (Ray ray, float radius, out RaycastHit hitInfo)
        {
            int layerMask = -5;
            float distance = float.PositiveInfinity;
            return Physics.SphereCast (ray, radius, out hitInfo, distance, layerMask);
        }

        public static bool SphereCast (Ray ray, float radius, out RaycastHit hitInfo, [DefaultValue ("Mathf.Infinity")] float distance, [DefaultValue ("DefaultRaycastLayers")] int layerMask)
        {
            return Physics.Internal_CapsuleCast (ray.origin, ray.origin, radius, ray.direction, out hitInfo, distance, layerMask);
        }

        public static RaycastHit[] SphereCastAll (Vector3 origin, float radius, Vector3 direction, [DefaultValue ("Mathf.Infinity")] float distance, [DefaultValue ("DefaultRaycastLayers")] int layerMask)
        {
            return Physics.CapsuleCastAll (origin, origin, radius, direction, distance, layerMask);
        }

        [ExcludeFromDocs]
        public static RaycastHit[] SphereCastAll (Vector3 origin, float radius, Vector3 direction)
        {
            int layerMask = -5;
            float distance = float.PositiveInfinity;
            return Physics.SphereCastAll (origin, radius, direction, distance, layerMask);
        }

        [ExcludeFromDocs]
        public static RaycastHit[] SphereCastAll (Vector3 origin, float radius, Vector3 direction, float distance)
        {
            int layerMask = -5;
            return Physics.SphereCastAll (origin, radius, direction, distance, layerMask);
        }

        public static RaycastHit[] SphereCastAll (Ray ray, float radius, [DefaultValue ("Mathf.Infinity")] float distance, [DefaultValue ("DefaultRaycastLayers")] int layerMask)
        {
            return Physics.CapsuleCastAll (ray.origin, ray.origin, radius, ray.direction, distance, layerMask);
        }

        [ExcludeFromDocs]
        public static RaycastHit[] SphereCastAll (Ray ray, float radius)
        {
            int layerMask = -5;
            float distance = float.PositiveInfinity;
            return Physics.SphereCastAll (ray, radius, distance, layerMask);
        }

        [ExcludeFromDocs]
        public static RaycastHit[] SphereCastAll (Ray ray, float radius, float distance)
        {
            int layerMask = -5;
            return Physics.SphereCastAll (ray, radius, distance, layerMask);
        }
    }
}

你可能感兴趣的:(physics)