Skip to content

Physics bindings

SDraw edited this page Jun 2, 2023 · 1 revision

Refer to Unity's Physics documentation for properties and methods description.

Static properties

  • AllLayers: get, int
  • DefaultRaycastLayers: get, int
  • gravity: get/set, Vector3
  • IgnoreRaycastLayer: get, int

Static methods

  • bool BoxCast(Vector3 center, Vector3 halfExtents, Vector3 direction, Quaternion orientation = Quaternion.identity, float maxDistance = Mathf.Infinity, int layerMask = Physics.DefaultRaycastLayers, string queryTriggerInteraction = "UseGlobal")

  • table BoxCastAll(Vector3 center, Vector3 halfExtents, Vector3 direction, Quaternion orientation = Quaternion.identity, float maxDistance = Mathf.Infinity, int layerMask = Physics.DefaultRaycastLayers, string queryTriggerInteraction = "UseGlobal"): table with RaycastHit elements, sorted by hit distance from near to far

  • bool CapsuleCast(Vector3 pointA, Vector3 pointB, float radius, Vector3 direction, float maxDistance = Mathf.Infinity, int layerMask = Physics.DefaultRaycastLayers, string queryTriggerInteraction = "UseGlobal")

  • table CapsuleCastAll(Vector3 pointA, Vector3 pointB, float radius, Vector3 direction, float maxDistance = Mathf.Infinity, int layerMask = Physics.DefaultRaycastLayers, string queryTriggerInteraction = "UseGlobal"): table with RaycastHit elements, sorted by hit distance from near to far

  • bool CheckBox(Vector3 center, Vector3 halfExtents, Quaternion orientation = Quaternion.identity, int layerMask = Physics.DefaultRaycastLayers, string queryTriggerInteraction = "UseGlobal")

  • bool CheckCapsule(Vector3 pointA, Vector3 pointB, float radius, int layerMask = Physics.DefaultRaycastLayers, string queryTriggerInteraction = "UseGlobal")

  • bool CheckSphere(Vector3 center, float radius, int layerMask = Physics.DefaultRaycastLayers, string queryTriggerInteraction = "UseGlobal")

  • Vector3 ClosestPoint(Vector3 point, Collider collider, Vector3 position, Quaternion rotation)

  • Vector3 float ComputePenetration(Collider colliderA, Vector3 positionA, Quaternion rotationA, Collider colliderB, Vector3 positionB, Quaternion rotationB)

  • bool GetIgnoreCollision(Collider colliderA, Collider colliderB)

  • bool GetIgnoreLayerCollision(int layerA, int layerB)

  • bool IgnoreCollision(Collider colliderA, Collider colliderB, bool state)

  • bool Linecast(Vector3 pointA, Vector3 pointB, int layerMask = Physics.DefaultRaycastLayers, string queryTriggerInteraction = "UseGlobal")

  • table OverlapBox(Vector3 center, Vector3 halfExtents, Quaternion orientation = Quaternion.identity, int layerMask = Physics.DefaultRaycastLayers, string queryTriggerInteraction = "UseGlobal"): table with Collider elements

  • table OverlapCapsule(Vector3 pointA, Vector3 pointB, float radius, int layerMask = Physics.DefaultRaycastLayers, string queryTriggerInteraction = "UseGlobal"): table with Collider elements

  • table OverlapSphere(Vector3 point, float radius, int layerMask = Physics.DefaultRaycastLayers, string queryTriggerInteraction = "UseGlobal"): table with Collider elements

  • bool Raycast(Vector3 origin, Vector3 direction, float maxDistance = Mathf.Infinity, int layerMask = Physics.DefaultRaycastLayers, string queryTriggerInteraction = "UseGlobal")

  • table RaycastAll(Vector3 origin, Vector3 direction, float maxDistance = Mathf.Infinity, int layerMask = Physics.DefaultRaycastLayers, string queryTriggerInteraction = "UseGlobal"): table with RaycastHit elements, sorted by hit distance from near to far

  • bool SphereCast(Vector3 position, float radius, Vector3 direction, float maxDistance = Mathf.Infinity, int layerMask = Physics.DefaultRaycastLayers, string queryTriggerInteraction = "UseGlobal")

  • table SphereCastAll(Vector3 position, float radius, Vector3 direction, float maxDistance = Mathf.Infinity, int layerMask = Physics.DefaultRaycastLayers, string queryTriggerInteraction = "UseGlobal"): table with RaycastHit elements, sorted by hit distance from near to far